Prompt

Execute a predefined prompt

POST
/core/aiservices/v4/prompt/{promptId}/execute

Execute a published and active prompt template from the AI console.

Authorization

accessToken
AuthorizationBearer <token>

JWT Bearer Token authentication for API access

In: header

Path Parameters

promptId*string

ID of the prompt template from the AI console. Only published and active prompt IDs are allowed.

Match^[a-zA-Z0-9]{2,4}-\d{4,15}$
Length7 <= length <= 20

Request Body

application/json

department*string

Name of the department. Must be a valid department name.

Match^[^~`!#$%\^*()=\[\],;'"|<>\/?+{}]+$
Length1 <= length <= 64
languageCode*string

The language used for the prompt template.

Value in

  • "en-US"
  • "fr-FR"
  • "en-GB"
  • "es-ES"
  • "it-IT"
  • "nl-NL"
  • "da-DA"
  • "sv-SE"
  • "pt-PT"
  • "fi-FI"
  • "no-NB"
  • "no-NN"
  • "ja-JA"
  • "de-DE"
  • "pt-BR"
  • "zh-CN"
  • "zh-TW"
  • "ko-KO"
  • "ru-RU"
  • "el-EL"
  • "tr-TR"
  • "pl-PL"
  • "cs-CS"
  • "sk-SK"
  • "hu-HU"
  • "sr-SR"
  • "ar-SA"
  • "hr-HR"
  • "ro-RO"
  • "th-TH"
  • "xx-XX"
replacements?array<|>

List of variable replacements (either static or search).

Itemsitems <= 5
eventType?string

Event type logged when the API executes successfully.

Default"generate"

Value in

  • "generate"
  • "regenerate"
clientSessionId?string

Client provided sessionID to store events against.

Match^[\w\W]*$
Lengthlength <= 255
streaming?boolean

Whether to stream the response instead of returning inline.

Defaultfalse

Response Body

application/json

application/json

curl -X POST "https://example.com/core/aiservices/v4/prompt/strings/execute" \  -H "Content-Type: application/json" \  -d '{    "department": "Service",    "languageCode": "en-US"  }'
{  "generatedResponse": "Customer enquired about the order status...",  "eventType": "generate",  "sessionId": "79e43699-c210-49cd-b512-05607f727b98",  "clientSessionId": "123e4567-e89b-12d3-a456-426614174000",  "sessionStatus": "active",  "eventRegistration": "successful"}