---
schema_version: "1"
id: 3002495cbe57639e8b1d1097cb0f87c176232bd23812ad1c07f62949b4bacaf8
title: Einstein Bots API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/bot-api/einstein-bot/references/generated-api-specs/bot-api-v5.md
canonical_url: https://developer.salesforce.com/docs/service/einstein-bot-api/references/bot-api-v5
source_site: developer.salesforce.com
content_type: documentation
content_hash: 967e087ceda03e1f0540ac158bdf7a7dd03c87611b840d1da4844a01f34c90b1
products:
  - Einstein Bots API and SDK
  - Enstein Bot API and SDK
---
Einstein Bots API

# Einstein Bots API

**Version:** v5.1.0

## Servers

*   `https://runtime-api-na-west.prod.chatbots.sfdc.sh` Einstein Bots API - NA West
*   `https://runtime-api-na-east.prod.chatbots.sfdc.sh` Einstein Bots API - NA East
*   `https://runtime-api-eu-west.prod.chatbots.sfdc.sh` Einstein Bots API - EU West
*   `https://runtime-api-eu-east.prod.chatbots.sfdc.sh` Einstein Bots API - EU East
*   `https://runtime-api-ap-west.prod.chatbots.sfdc.sh` Einstein Bots API - AP West
*   `https://runtime-api-ap-east.prod.chatbots.sfdc.sh` Einstein Bots API - AP East

## Security

*   `chatbotAuth` (oauth2) chatbotAuth supports authorization code and implicit Oauth flows.
    *   OAuth flow authorizationCode (authorizationUrl: https://login.salesforce.com/services/oauth2/authorize, tokenUrl: https://login.salesforce.com/services/oauth2/token)
    *   Scope chatbot\_api: Access bot APIs
    *   OAuth flow implicit (authorizationUrl: https://login.salesforce.com/services/oauth2/authorize)
    *   Scope chatbot\_api: Access bot APIs
*   `jwtBearer` (http) Salesforce OAuth access token obtained using the JWT Bearer flow. Use the `chatbot_api` scope with this flow to enable access to the Einstein Bots services.
    *   HTTP scheme: bearer

## Operations

### GET Check the health status

`GET /status`

Operation ID: `checkHealthStatus`. Tags: health.

Returns whether the status of Einstein Bots API is up or down.

#### Responses

*   **200** OK
    
    Media type: `application/json`. Schema: `Status`.
    
*   **default** Something went wrong
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    

### GET Get API versions

`GET /versions`

Operation ID: `getAPIVersions`. Tags: versions.

Retrieve the list of supported Einstein Bots API versions.

#### Responses

*   **200** Supported API versions
    
    Media type: `application/json`. Schema: `SupportedVersions`.
    
*   **default** Something went wrong
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Start a session

`POST /v5.1.0/bots/{bot-id}/sessions`

Operation ID: `startSession`. Tags: bot. Security: chatbotAuth (chatbot\_api); jwtBearer.

Send a message to the bots API to start a new session.

#### Parameters

*   `bot-id` (path, string, required) ID of the Einstein Bot that you want to interact with.
*   `X-Org-Id` (header, string, required) 18-character org ID of the Salesforce org associated with the bot.  
    Example: `00Dx0000000ALskEAG`.
*   `X-Request-ID` (header, string) Request ID. A UUID in string format created by you to help with request tracking.  
    Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`.

#### Request body (required)

Request payload to initiate a session.

Media type: `application/json`. Schema: `InitMessageEnvelope`.

#### Responses

*   **200** OK
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    *   `X-Runtime-CRC` (string) Internal runtime CRC unique to the request.
    *   `X-Bot-Mode` (string) Bot mode.  
        Example: `default`
    
    Media type: `application/json`. Schema: `ResponseEnvelope`.
    
*   **400** Bad Request
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "status": 400,
      "path": "/v1/00DRM00000067To/chatbots/HelloWorldBot/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "BadRequestError",
      "message": "Bad Request",
      "timestamp": 1531245973799,
      "additionalProp1": {}
    }
    ```
    
*   **401** Access bearer token is missing or invalid
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "status": 401,
      "path": "/v1/00DRM00000067To/chatbots/HelloWorldBot/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "UnauthorizedError",
      "message": "Access bearer token is missing or invalid",
      "timestamp": 1531245973799
    }
    ```
    
*   **403** User forbidden from accessing the resource
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "status": 403,
      "path": "/v1/00DRM00000067To/chatbots/HelloWorldBot/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "ForbiddenError",
      "message": "User forbidden from accessing the resource",
      "timestamp": 1531245973799,
      "additionalProp1": {}
    }
    ```
    
*   **404** Resource not found
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "status": 404,
      "path": "/v1/00DRM00000067To/chatbots/HelloWorldBot/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "NotFoundError",
      "message": "Resource not found",
      "timestamp": 1531245973799,
      "additionalProp1": {}
    }
    ```
    
*   **422** Any exception that occurred during the request execution
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "status": 422,
      "path": "v4.0.0/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "RequestProcessingException",
      "message": "Cannot determine the active version for the bot",
      "timestamp": 1531245973799,
      "additionalProp1": {}
    }
    ```
    
*   **423** Server is busy and cannot process the request at this time
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "status": 423,
      "path": "/v1/00DRM00000067To/chatbots/HelloWorldBot/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "ServerBusyError",
      "message": "Server is busy and cannot process the request at this time",
      "timestamp": 1531245973799,
      "additionalProp1": {}
    }
    ```
    
*   **429** Too many requests for the server to handle
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "status": 429,
      "path": "/v1/00DRM00000067To/chatbots/HelloWorldBot/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "TooManyRequestsError",
      "message": "Too many requests for the server to handle",
      "timestamp": 1531245973799,
      "additionalProp1": {}
    }
    ```
    
*   **503** Service is unavailable possibly because Apex or Flow calls timed out
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example_
    
    ```
    {
      "status": 503,
      "path": "/v1/00DRM00000067To/chatbots/HelloWorldBot/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "ServiceUnavailable",
      "message": "Service is unavailable possibly because Apex/Flow calls timed out",
      "timestamp": 1531245973799,
      "additionalProp1": {}
    }
    ```
    
*   **default** Something went wrong
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    

### POST Continue an active session

`POST /v5.1.0/sessions/{session-id}/messages`

Operation ID: `continueSession`. Tags: bot. Security: chatbotAuth (chatbot\_api); jwtBearer.

Send a message to the bots API on an active session.

#### Parameters

*   `session-id` (path, string, required) ID of an active session, which is the `sessionId` returned by the bot when you start a session.
*   `X-Org-Id` (header, string, required) 18-character org ID of the Salesforce org associated with the bot.  
    Example: `00Dx0000000ALskEAG`.
*   `X-Request-ID` (header, string) Request ID. A UUID in string format created by you to help with request tracking.  
    Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`.
*   `X-Runtime-CRC` (header, string) Internal runtime CRC, which is the `X-Runtime-CRC` value from previous response.

#### Request body (required)

Request payload to continue the chat.

Media type: `application/json`. Schema: `ChatMessageEnvelope`.

#### Responses

*   **200** OK
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    *   `X-Runtime-CRC` (string) Internal runtime CRC.
    
    Media type: `application/json`. Schema: `ChatMessageResponseEnvelope`.
    
*   **400** Bad Request
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 400 response._
    
*   **401** Access bearer token is missing or invalid
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 401 response._
    
*   **403** User forbidden from accessing the resource
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 403 response._
    
*   **404** Resource not found
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 404 response._
    
*   **422** Any exception that occurred during the request execution
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 422 response._
    
*   **423** Server is busy and cannot process the request at this time
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 423 response._
    
*   **429** Too many requests for the server to handle
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 429 response._
    
*   **503** Service is unavailable possibly because Apex or Flow calls timed out
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 503 response._
    
*   **default** Something went wrong
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    

### DELETE End an active session

`DELETE /v5.1.0/sessions/{session-id}`

Operation ID: `endSession`. Tags: bot. Security: chatbotAuth (chatbot\_api); jwtBearer.

Send a message to the bots API to end a session

#### Parameters

*   `session-id` (path, string, required) ID of an active session, which is the `sessionId` returned by the bot when you start a session.
*   `X-Org-Id` (header, string, required) 18-character org ID of the Salesforce org associated with the bot.  
    Example: `00Dx0000000ALskEAG`.
*   `X-Session-End-Reason` (header, EndSessionReason, required) Reason session ended.
    
    _Example_
    
    ```
    Transfer
    ```
    
*   `X-Request-ID` (header, string) Request ID. A UUID in string format created by you to help with request tracking.  
    Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`.
*   `X-Runtime-CRC` (header, string) Internal runtime CRC, which is the `X-Runtime-CRC` value from previous response.

#### Responses

*   **200** OK
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    *   `X-Runtime-CRC` (string) Internal runtime CRC.
    
    Media type: `application/json`. Schema: `ChatMessageResponseEnvelope`.
    
*   **400** Bad Request
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 400 response._
    
*   **401** Access bearer token is missing or invalid
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 401 response._
    
*   **403** User forbidden from accessing the resource
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 403 response._
    
*   **404** Resource not found
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 404 response._
    
*   **422** Any exception that occurred during the request execution
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 422 response._
    
*   **423** Server is busy and cannot process the request at this time
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 423 response._
    
*   **429** Too many requests for the server to handle
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 429 response._
    
*   **503** Service is unavailable possibly because Apex or Flow calls timed out
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    
    _Example: same as POST /v5.1.0/bots/{bot-id}/sessions 503 response._
    
*   **default** Something went wrong
    
    Headers:
    
    *   `X-Request-ID` (string) Request ID. A UUID in string format to help with request tracking.  
        Example: `36a73651-a46d-4d16-9a8a-fd436ed62e1a`
    
    Media type: `application/json`. Schema: `Error`.
    

## Schemas

### Status

*   `status` (_string_, required) Health status of Einstein Bots API.  
    Allowed values: `UP`, `DOWN`. Example: `UP`.

### Error

*   `status` (_integer (int32)_, required) HTTP status.
*   `path` (_string_, required) Request path.
*   `requestId` (_string_, required) Request ID. A UUID in string format to help with request tracking.
*   `error` (_string_, required) Error class name.
*   `message` (_string_, required) Exception message.
*   `timestamp` (_integer (int64)_, required) Unix timestamp.

### SupportedVersions

*   `versions` (_array of object_, required) List of supported API versions.
    *   `versionNumber` (_string_) API Version number.
    *   `status` (_string_) API Version status.  
        Allowed values: `ACTIVE`, `DEPRECATED`.

### InitMessageEnvelope

*   `externalSessionKey` (_ExternalSessionKey_, required)
*   `message` (_TextInitMessage_)
*   `forceConfig` (_ForceConfig_, required)
*   `responseOptions` (_ResponseOptions_)
*   `tz` (_string_, nullable) Client timezone where the customer starts the chat.  
    Example: `America/Los_Angeles`.
*   `variables` (_Variables_)
*   `referrers` (_array of Referrer_, nullable) Array of referrers of transferring the session to another bot.

### ResponseEnvelope

*   `sessionId` (_ResponseSessionId_, required)
*   `botVersion` (_BotVersion_, required)
*   `processedSequenceIds` (_array of integer (int64)_, required) Sequence IDs of messages that the bot processed. Except for the initial request to start the session, all requests require a `sequenceId`.  
    Items: Example: `1`.
*   `messages` (_array of TextResponseMessage | ChoicesResponseMessage | EscalateResponseMessage | SessionEndedResponseMessage_, required) Messages from the bot.  
    Minimum: 0.
*   `variables` (_Variables_)
*   `metrics` (_object_) Session metrics.
*   `intents` (_Intents_)
*   `entities` (_Entities_)
*   `_links` (_Links_, required)

### ChatMessageEnvelope

*   `message` (_ChoiceMessage | TextMessage | TransferSucceededRequestMessage | TransferFailedRequestMessage | RedirectMessage_, required) Message to the bot.
    
    One of: `ChoiceMessage`, `TextMessage`, `TransferSucceededRequestMessage`, `TransferFailedRequestMessage`, `RedirectMessage`.
    
*   `responseOptions` (_ResponseOptions_)

### ChatMessageResponseEnvelope

*   `botVersion` (_BotVersion_, required)
*   `processedSequenceIds` (_array of integer (int64)_, required) Sequence IDs of processed messages.  
    Example: `1, 2`.
*   `messages` (_array of TextResponseMessage | ChoicesResponseMessage | EscalateResponseMessage | SessionEndedResponseMessage_, required) Messages from the bot.  
    Minimum: 0.
*   `variables` (_Variables_)
*   `metrics` (_object_) Session metrics.
*   `intents` (_Intents_)
*   `entities` (_Entities_)
*   `_links` (_Links_, required)

### EndSessionReason

Type: `string`.

Allowed values: `UserRequest`, `Transfer`, `Expiration`, `Error`, `Other`. Example: `Transfer`.

### ExternalSessionKey

UUID in string format for the conversation. You can use this parameter to trace the conversation in your bot’s event logs.

Type: `string`.

Example: `57904eb6-5352-4c5e-adf6-5f100572cf5d`.

### TextInitMessage

*   `text` (_string_) Initial message from the customer to the bot to begin a session.  
    Example: `Hello`.

### ForceConfig

API configuration parameters.

*   `endpoint` (_string_, required) Instance URL of your Salesforce org. You can find the value in the **ForceConfig Endpoint** field of the **Add Connection** dialog when you add the connected app to the bot. See [Get Started with Einstein Bot API](https://developer.salesforce.com/docs/service/einstein-bot-api/guide/prerequisites.html).  
    Example: `https://d5e000009s7bceah-dev-ed.my.salesforce.com/`.

### ResponseOptions

Configuration of additional information returned in the response payload.

*   `variables` (_ResponseOptionsVariables_)
*   `metrics` (_boolean_) Indicates whether to include metrics in the response.
*   `intents` (_boolean_) Indicates whether to include all intents detected when processing the current request.
*   `entities` (_boolean_) Indicates whether to include all entities detected when processing the current request.

### Variables

Array of custom and context variables passed to the bot when initiating a session. See [What’s a Variable?](https://help.salesforce.com/s/articleView?id=service.bots_service_whats_a_variable.htm&type=5&_ga=2.50520745.1281711304.1657558186-1967832163.1652719780).

Array of `BooleanVariable | DateVariable | DateTimeVariable | MoneyVariable | NumberVariable | TextVariable | ObjectVariable | RefVariable | ListVariable`.

### Referrer

*   `type` (_string_, required) Referrer type.  
    Allowed values: `Salesforce:Core:Bot:Id`, `Salesforce:BotRuntime:Session:Id`. Example: `Salesforce:Core:Bot:Id`.
*   `value` (_string_, required) ID of referrer.  
    Example: `string`.

### ResponseSessionId

Bot runtime session ID.

Type: `string`.

Example: `57904eb6-5352-4c5e-adf6-5f100572cf5d`.

### BotVersion

Bot configuration version.

Type: `string`.

Example: `0X9RM0000004CD00AM`.

### TextResponseMessage

*   `type` (_string_, required) Message type of a text message to the customer.  
    Allowed values: `text`. Example: `text`.
*   `id` (_MessageId_, required)
*   `text` (_string_, required) Message from the bot.  
    Example: `Hello world!`.
*   `schedule` (_Schedule_)

### ChoicesResponseMessage

*   `type` (_string_, required) Message type of a question with choices.  
    Allowed values: `choices`. Example: `choices`.
*   `id` (_MessageId_, required)
*   `choices` (_array of object_, required) Array of answers to choose from.
    
    Each item: Choice
    
      
    Minimum: 1.
    *   `label` (_string_, required) Choice label.  
        Example: `Order Status`.
    *   `alias` (_string_, nullable) Choice alias, for example, a number to represent the choice.  
        Example: `1`.
    *   `id` (_string_, required) Choice ID.  
        Example: `8a9a745f-0c09-4b13-955c-1ab9e06c7ad7`.
*   `widget` (_string_, required)
    
    "Widget type of how answers appear in the client.
    
    *   `buttons`—Answers appear in clickable pill boxes.
    *   `menu`—Answers appear in clickable boxes vertically stacked."
    
      
    Allowed values: `buttons`, `menu`. Example: `buttons`.
*   `schedule` (_Schedule_)

### EscalateResponseMessage

*   `type` (_string_, required) Message type of an escalation message.  
    Allowed values: `escalate`. Example: `escalate`.
*   `id` (_MessageId_, required)
*   `schedule` (_Schedule_)
*   `targets` (_array of object_, required) Array of transfer targets.  
    Minimum: 0.
    *   `type` (_string_, required) Type of the transfer target.  
        Allowed values: `Salesforce:Core:Bot:Id`, `Salesforce:Core:Queue:Id`, `Salesforce:Core:Skill:Id`, `Salesforce:Core:Flow:Id`. Example: `Salesforce:Core:Bot:Id`.
    *   `value` (_string_, required) ID of the transfer target.

### SessionEndedResponseMessage

*   `type` (_string_, required) Message type informing that the session ended.  
    Allowed values: `sessionEnded`. Example: `sessionEnded`.
*   `id` (_MessageId_, required)
*   `reason` (_string_, required) Reason the session ended.  
    Allowed values: `ClientRequest`, `TransferFailedNotConfigured`, `Action`, `Error`, `InfiniteLoopDetected`. Example: `ClientRequest`.
*   `schedule` (_Schedule_)

### Intents

Array of the intents detected by the bot when processing the request. For a bot, "intent" refers to the goal the customer. See [Use Intents to Understand Your Customers](https://help.salesforce.com/s/articleView?id=service.bots_service_train_bot.htm&type=5&_ga=2.5901875.1281711304.1657558186-1967832163.1652719780).

Array of `NormalizedIntent`.

Minimum: 0.

### Entities

Array of all entities detected by the bot when processing this request. For a bot, "Entities" refer to the modifiers the customer uses to describe their issue and intent is what they really mean.

Array of `NormalizedEntity`.

Minimum: 0.

### Links

List of Einstein Bots API endpoints for HATEOS compliancy.

*   `self` (_HyperLink_, required)
*   `messages` (_HyperLink_)
*   `session` (_HyperLink_)

### ChoiceMessage

*   `type` (_string_, required) Message type for answering a question with choices from the bot.  
    Allowed values: `choice`. Example: `choice`.
*   `sequenceId` (_SequenceId_, required)
*   `inReplyToMessageId` (_InReplyToMessageId_)
*   `choiceIndex` (_integer_, nullable) Index or alias of the chosen answer. The index starts with 1. Either `choiceIndex` or `choiceId` is required.  
    Example: `1`.
*   `choiceId` (_string_, nullable) ID of the answer when you answer by clicking a choice button. Either `choiceIndex` or `choiceId` is required.  
    Example: `8a9a745f-0c09-4b13-955c-1ab9e06c7ad7`.

### TextMessage

*   `type` (_string_, required) Message type for replying to the bot through text.  
    Allowed values: `text`. Example: `text`.
*   `sequenceId` (_SequenceId_, required)
*   `inReplyToMessageId` (_InReplyToMessageId_)
*   `text` (_string_, required) Text reply to the bot. To answer a question with choices with a text message, type the `choiceLabel`.

### TransferSucceededRequestMessage

*   `type` (_string_, required) Message type for the client to inform the bot that the client successfully transferred the session to another target.  
    Allowed values: `transferSucceeded`. Example: `transferSucceeded`.
*   `sequenceId` (_SequenceId_, required)
*   `inReplyToMessageId` (_InReplyToMessageId_)

### TransferFailedRequestMessage

*   `type` (_string_, required) Message type for the client to inform the bot that the client failed to transfer the session to another target.  
    Allowed values: `transferFailed`. Example: `transferFailed`.
*   `sequenceId` (_SequenceId_, required)
*   `inReplyToMessageId` (_InReplyToMessageId_)
*   `reason` (_string_, required) Reason for the failed transfer.  
    Allowed values: `NoAgentAvailable`, `Error`. Example: `NoAgentAvailable`.
*   `description` (_string_, nullable) Description of why the transfer failed.

### RedirectMessage

*   `type` (_string_, required) Message type for the redirecting the client to another bot flow.  
    Allowed values: `redirect`. Example: `redirect`.
*   `sequenceId` (_SequenceId_, required)
*   `dialogId` (_string_, required) Dialog ID to redirect to.  
    Example: `68f934fb-e022-37a7-612e-b74fc87191d9`.

### ResponseOptionsVariables

Variables returned in the response.

*   `include` (_boolean_, required) Indicates whether to include variables in the response.  
    Example: `true`.
*   `filter` (_array of string_, nullable) Filter the returned variables. If missing, null, or empty, no filtering is applied.
    
    Each item: Variable name to filter the returned variables on.
    
      
    Items: Example: `OrderQty`.
    
    _Example_
    
    ```
    [
      "OrderQty",
      "OrderType"
    ]
    ```
    
*   `onlyChanged` (_boolean_, required) Indicates whether the response contains only changed variables.  
    Example: `true`.

### BooleanVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `isShipped`.
*   `type` (_string_, required) Variable type of a boolean variable.  
    Allowed values: `boolean`. Example: `boolean`.
*   `value` (_boolean_, required, nullable) Boolean value.  
    Example: `true`.

### DateVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `orderDate`.
*   `type` (_string_, required) Variable type of a date variable.  
    Allowed values: `date`. Example: `date`.
*   `value` (_string_, required, nullable) Date in format ISO\_LOCAL\_DATE 'YYYY-MM-DD'.  
    Example: `2021-09-21`.

### DateTimeVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `orderDateTime`.
*   `type` (_string_, required) Variable type of a datetime variable.  
    Allowed values: `dateTime`. Example: `dateTime`.
*   `value` (_string_, required, nullable) Datetime in format ISO\_LOCAL\_DATE\_TIME 'YYYY-MM-DDTHH:MM:SS'.  
    Example: `2018-09-21T14:30:00`.

### MoneyVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `orderAmount`.
*   `type` (_string_, required) Variable type of a money variable storing the currency and amount.  
    Allowed values: `money`. Example: `money`.
*   `value` (_string_, required, nullable) Money in format '3\_LETTER\_CURRENCY\_CODE AMOUNT'.  
    Example: `USD 10.40`.

### NumberVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `qty`.
*   `type` (_string_, required) Variable type of a number variable.  
    Allowed values: `number`. Example: `number`.
*   `value` (_number_, required, nullable) Variable value in number format.  
    Example: `10`.

### TextVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `note`.
*   `type` (_string_, required) Variable type of a text variable.  
    Allowed values: `text`. Example: `text`.
*   `value` (_string_, required, nullable) Variable value in text format.  
    Example: `Thanks for your order!`.

### ObjectVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `contact`.
*   `type` (_string_, required) Variable type of an object variable.  
    Allowed values: `object`. Example: `object`.
*   `value` (_object_, required, nullable) Variable value is an object.
    
    Includes all fields of `Variables`.
    
    _Example_
    
    ```
    [
      {
        "name": "fullName",
        "type": "text",
        "value": "Matt Smith"
      }
    ]
    ```
    

### RefVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `target`.
*   `type` (_string_, required) Variable type of a reference ID variable.  
    Allowed values: `ref`. Example: `ref`.
*   `value` (_string_, required, nullable) Variable value in reference ID format.  
    Example: `1M5xx000000000BCAQ`.

### ListVariable

*   `name` (_string_, required) API name of a variable defined in the bot definition.  
    Example: `target`.
*   `type` (_string_, required) Object variable that contains a list.  
    Allowed values: `list`. Example: `list`.
*   `value` (_array of object_, required, nullable) Array of objects.
    
    _Example_
    
    ```
    [
      {
        "type": "ref",
        "value": "1M5xx000000000BCAQ"
      }
    ]
    ```
    

### MessageId

UUID that references this message.

Type: `string`.

Example: `a133c185-73a7-4adf-b6d9-b7fd62babb4e`.

### Schedule

*   `responseDelayMilliseconds` (_integer (int32)_, required) Delay in ms to display the bot’s message to the user. This parameter is set by the bot admin when creating the bot.  
    Example: `1200`.

### NormalizedIntent

*   `label` (_string_, required) Name or ID of the intent.  
    Example: `Password help`.
*   `confidenceScore` (_number_, required) Probability number that the AI assigns to this intent.  
    Example: `0.78`.
*   `intentSource` (_IntentSource_, required)

### NormalizedEntity

*   `confidenceScore` (_number_, required) Probability number that the AI assigns to this entity.  
    Example: `0.4`.
*   `value` (_string_, required) Value of the entity that the customer enters.  
    Example: `USD 30.0`.
*   `type` (_EntityType_, required)
*   `entitySource` (_EntitySource_)

### HyperLink

Hyperlink object included in the Links schema

*   `href` (_string_) Link to the endpoint  
    Example: `https://runtime-api-ap-east.prod.chatbots.sfdc.sh/v5.0.0/sessions`.

### SequenceId

Client-generated sequence number of the message in a session. Increase this number for each subsequent message.

Type: `integer (int64)`.

Example: `1`.

### InReplyToMessageId

Message ID of the previous response you are replying to.

Type: `string`.

Example: `a133c185-73a7-4adf-b6d9-b7fd62babb4e`.

### IntentSource

Prediction system that detects the intent.

*   `DIRECT`—Utterance search or an exact match
*   `CORE_NLP`—Third-party Natural Language Processing (NLP)
*   `EINSTEIN_NLP`—Einstein NLP

Type: `string`.

Allowed values: `DIRECT`, `CORE_NLP`, `EINSTEIN_NLP`. Example: `EINSTEIN_NLP`.

### EntityType

System or custom entity Type ([What’s an Entity?](https://help.salesforce.com/s/articleView?id=service.bots_service_whats_an_entity.htm&type=5)).

Type: `string`.

Example: `MONEY`.

### EntitySource

"Prediction system that detects the entity. The Bot API can call NLPs or it can figure out the entity by itself."

*   `BOT_SERVICE`—Bot detects entity without Natural Language Processing (NLP)
*   `CORE_NLP`—Third-party NLP
*   `EINSTEIN_NLP`—Einstein NLP

Type: `string`.

Allowed values: `BOT_SERVICE`, `CORE_NLP`, `EINSTEIN_NLP`. Example: `EINSTEIN_NLP`.

### EndSessionMessage

Client request to end the session.

*   `type` (_string_, required) Message type for the client requesting the session to end.  
    Allowed values: `endSession`. Example: `endSession`.
*   `sequenceId` (_SequenceId_, required)
*   `inReplyToMessageId` (_InReplyToMessageId_)
*   `reason` (_EndSessionReason_, required)