# Get Prompt Template By ID

Retrieve a prompt template filtered by department and language.

Endpoint: GET /prompts/prompttemplates/{promptID}
Security: oAuthUser, oAuthClient

## Security:

  - `oAuthUser` (unknown)
    oauth2 scopes: https://api.egain.cloud/auth/knowledge.contentmgr.read

  - `oAuthClient` (unknown)
    oauth2 scopes: https://api.egain.cloud/auth/.default

## Path parameters:

  - `promptID` (string, required)
    The promptID of the prompt template you want to fetch details for.

## Query parameters:

  - `department` (string, required)
    Name of the department. Must be a valid department name.

  - `languageCode` (string, required)
    The language used while writing the prompt templates.

## Header parameters:

  - `Accept-Language` (string, required)
    The Language locale accepted by the client (used for locale specific fields in resource representation and in error responses).

## Response 200:

  - `200` (unknown)
    Successful response with list of prompt templates

## Response 200 fields (application/json):

  - `name` (string, required)
    Name of the prompt template
    Example: Generate Title

  - `id` (string, required)
    ID of the prompt template from the AI console
    Example: PROD-26471

  - `description` (string, required)
    Example: Generate article title based on article content

  - `active` (boolean, required)
    A boolean showing whether a prompt is active or inactive.
    Example: true

  - `useFor` (string, required)
    Specifies which console the prompt applies to.
Available values (may be extended in the future):
- advisor
- knowledge
- knowledge-intelligence
- knowledge-orchestration
- custom

  - `appliesTo` (string, required)
    The 'channel' for this prompt. If the `useFor` is set to 'knowledge' then article is used. If `useFor` is set to 'advisor', then either 'chat' or 'email' can be used.
Available values (may be extended in the future):
- article
- chat
- email

  - `instruction` (string, required)
    The prompt instructions.
    Example: I want you to generate...

  - `outputFormat` (string, required)
    The output format for the generated output.
Available values (may be extended in the future):
- html
- text
    Example: html

  - `createdOn` (string, required)
    Date and time when the prompt template was created.
    Example: 2024-04-01T08:00:00Z

  - `modifiedDate` (string, required)
    Date and time when the prompt was last updated.
    Example: 2024-04-30T17:30:00Z

  - `createdBy` (object, required)

  - `createdBy.id` (string)
    The ID of the user that created this resource.

  - `createdBy.userName` (string)
    The resource creator's username.

  - `createdBy.firstName` (string)
    The resource creator's first name.

  - `createdBy.middleName` (string)
    The resource creator's middle name.

  - `createdBy.lastName` (string)
    The resource creator's last name.

  - `reviewStatus` (string, required)
    Review status of the prompt.
Available values (may be extended in the future):
- published
    Example: published

  - `isSystemCreated` (boolean, required)
    A boolean showing whether the prompt template came out of the box or is a custom prompt.
    Example: false

  - `fieldToUpdate` (string, required)
    This will return the specified field to update once a user inserts the generated content.
Available values (may be extended in the future):
- title
- content
- keyword
- description
- summary
- replyarea
- notes
- subject
- classification

It can also return a custom attribute which will follow the following convention:
`custom.<attributeType>.<customAttributeName>`
    Example: custom.contactPerson.cust1

  - `displayAt` (array)
    Specifies where the prompt will be displayed in the console.
Available values (may be extended in the future):
- article.content-area
- article.metadata
- article.fix-prompts
- article.check-prompts

## Response 204:

  - `204` (unknown)
    No content

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 406:

  - `406` (unknown)
    Not Acceptable

## Response 406 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 500:

  - `500` (unknown)
    Internal server error

## Response 500 fields (application/json):

  - `code` (string, required)
    A string that follows the pattern *{integer}-{integer}*.
The first *{integer}* is the http status code.  This code as a whole is unique.
* For example, error codes "400-101" and "404-101" are distinctly different.

  - `developerMessage` (string, required)
    A summary of the error.

  - `details` (array)

  - `details.key` (string, required)

  - `details.value` (string)

  - `userMessage` (string)
    UI friendly messages are only supported by some APIs.
* The client must explicitly request UI friendly messages by passing the
*X-egain-error-message=yes*
 header.

## Response 400 examples:

  - `Unsupported Parameters` (unknown)

  - `Invalid Value` (unknown)

  - `Missing required query parameter` (unknown)

## Response 401 examples:

  - `Unauthorized` (unknown)

## Response 403 examples:

  - `Forbidden` (unknown)

## Response 404 examples:

  - `Not found` (unknown)

## Response 406 examples:

  - `Invalid Accept-Language` (unknown)

## Response 500 examples:

  - `Internal Server Error` (unknown)

