---
schema_version: "1"
id: eb8128285968dbcde1f248c17745ce1fc2901d9731569ae2bf091fa5e0197016
title: Agent API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce/references/generated-api-specs/agent-api.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce/references/agent-api
source_site: developer.salesforce.com
content_type: documentation
content_hash: d3f047223a95761115af6d7e68043d9540935d046320e0ae53a586ed7dee4a14
products:
  - Agentforce Developer Guide
  - Agentforce and Einstein Generative AI
---
Agent API

# Agent API

Use Agent API to communicate with AI agents in your org. Get access to your topics and actions in Agentforce by sending messages to AI agents. Create a Salesforce app in your org, generate a token, and then start using the API. To onboard to this API, see [Get Started with the Agent API](/docs/ai/agentforce/guide/agent-api-get-started.html) and [Agent API Examples](/docs/ai/agentforce/guide/agent-api-examples.html).

### Postman Collection

The quickest way to get started with the Agent API is with our [Postman collection](https://www.postman.com/salesforce-developers/salesforce-developers/collection/gwv9bjy/agent-api).

### Endpoints

*   [Start a Session](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=startSession): Start a session with an agent.
*   [Send a Message (sync)](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=sendMessage): Send a sync message to the agent on an active session.
*   [Send a Message (streaming)](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=sendMessageStream): Send a streaming message to the agent on an active session.
*   [End a Session](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=endSession): End a session.
*   [Submit Feedback](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=submitFeedback): Submit feedback for a message.

**Version:** v1.0.0

## Servers

*   `https://api.salesforce.com/einstein/ai-agent/v1` Agent API - Production Environment

## Security

*   `jwtBearer` (http) Salesforce OAuth access token obtained using the JWT Bearer flow. To learn more, see [Get Started with the Agent API](/docs/ai/agentforce/guide/agent-api-get-started.html).
    *   HTTP scheme: bearer

## Operations

### POST Start a session

`POST /agents/{id}/sessions`

Operation ID: `startSession`.

Begin an agent session. The endpoint contains the ID of the Salesforce agent. You can find this ID in the URL of the agent details page. When you select the agent from Setup, use the ID at the end of the URL.

#### Parameters

*   `id` (path, string, required) The ID of the Salesforce agent. You can find this ID in the URL of the agent details page. When you select the agent from Setup, use the ID at the end of the URL.
*   `Authorization` (header, string, required) Authorization information that contains the JWT.  
    Example: `Bearer •••••`.

#### Request body (required)

Request payload to initiate a session.

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

#### Responses

*   **200** Response to a new session.
    
    Headers:
    
    *   `x-session-mode` (string) Agent session mode.  
        Example: `default`
    
    Media type: `application/json`. Schema: `StartSessionSyncResponseMessage`.
    
*   **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": "/v6/00DRM00000067To/sessions/HelloWorldBot/messages",
      "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
      "error": "BadRequestError",
      "message": "Bad Request",
      "timestamp": 1531245973799
    }
    ```
    
*   **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
    }
    ```
    
*   **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
    }
    ```
    
*   **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 agent",
      "timestamp": 1531245973799
    }
    ```
    
*   **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
    }
    ```
    
*   **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
    }
    ```
    
*   **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
    }
    ```
    
*   **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 Send a message (synchronous)

`POST /sessions/{session-id}/messages`

Operation ID: `sendMessage`.

Send a synchronous message to the agent on an active session. The endpoint contains the ID of the active session, which was returned in the response of the Start Session call.

#### Parameters

*   `session-id` (path, string, required) The ID of the active session, which is the `sessionId` value returned from the Start Session call.
*   `Authorization` (header, string, required) Authorization information that contains the JWT.  
    Example: `Bearer •••••`.

#### Request body (required)

Request payload to continue the chat.

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

#### Responses

*   **200** Batched Response (Headless)
    
    Media type: `application/json`. Schema: `SendMessagesSyncResponseMessage`.
    
*   **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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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`.
    

### POST Send a message (streaming)

`POST /sessions/{session-id}/messages/stream`

Operation ID: `sendMessageStream`.

Send a streaming message to the agent on an active session. Returns an SSE stream in the response. The endpoint contains the ID of the active session, which was returned in the response of the Start Session call.

#### Parameters

*   `session-id` (path, string, required) The ID of the active session, which is the `sessionId` value returned from the Start Session call.
*   `Authorization` (header, string, required) Authorization information that contains the JWT.  
    Example: `Bearer •••••`.
*   `Accept` (header, string, required) Indicates which content type the sender is able to understand. For this endpoint, specify `text/event-stream`.  
    Example: `text/event-stream`.

#### Request body (required)

Request payload to continue the chat.

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

#### Responses

*   **200** OK
    
    Media type: `text/event-stream`. Schema: `ServerSentEvent`.
    
*   **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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /sessions/{session-id}`

Operation ID: `endSession`.

Send a message to the agent to end a session. The endpoint contains the ID of the active session, which was returned in the response of the Start Session call.

#### Parameters

*   `session-id` (path, string, required) The ID of the active session, which is the `sessionId` value returned from the Start Session call.
*   `Authorization` (header, string, required) Authorization information that contains the JWT.  
    Example: `Bearer •••••`.
*   `x-session-end-reason` (header, EndSessionReason, required) The reason the session ended.
    
    _Example_
    
    ```
    UserRequest
    ```
    

#### Responses

*   **200** Batched Response (Headless)
    
    Media type: `application/json`. Schema: `SendMessagesSyncResponseMessage`.
    
*   **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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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`.
    

### POST Submit feedback

`POST /sessions/{session-id}/feedback`

Operation ID: `submitFeedback`.

Submit feedback for a message. Feedback data is stored in Data 360.

#### Parameters

*   `session-id` (path, string, required) The ID of the session, which is the `sessionId` value returned from the Start Session call.
*   `Authorization` (header, string, required) Authorization information that contains the JWT.  
    Example: `Bearer •••••`.

#### Request body (required)

The feedback payload.

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

#### Responses

*   **202** Feedback successfully accepted.
*   **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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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 /agents/{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

### StartSessionRequest

*   `externalSessionKey` (_ExternalSessionKey_, required)
*   `instanceConfig` (_InstanceConfig_, required)
*   `tz` (_string_) Client timezone where the customer starts the chat. Uses the tz database timezone format. Can be null.  
    Example: `America/Los_Angeles`.
*   `variables` (_Variables_)
*   `featureSupport` (_SessionFeature_)
*   `streamingCapabilities` (_StreamingCapability_)
*   `bypassUser` (_boolean_) Indicates whether to use the agent-assigned user instead of the logged in user. If set to `true`, the API uses the user associated with the agent. If set to `false`, the API uses the user associated with the token. Set this value to `true` when using the client credentials flow. Defaults to `false`.  
    Example: `true`.

### StartSessionSyncResponseMessage

*   `sessionId` (_ResponseSessionId_, required)
*   `_links` (_SyncLinks_, required)
*   `messages` (_array of AbstractResponseMessage_, required) Array of initial messages. Each message can be one of the following response message types: [Inform](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInformMessage), [TextChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATextChunkMessage), [ValidationFailureChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AValidationFailureChunkMessage), [ProgressIndicator](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AProgressIndicatorMessage), [Inquire](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInquireMessage), [Confirm](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AConfirmMessage), [Failure](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AFailureMessage), [Escalate](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEscalateMessage), [SessionEnded](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ASessionEndedMessage), [EndOfTurn](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEndOfTurnMessage), [Error](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AErrorMessage).  
    Minimum: 0.

### 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` (_number_, required) Unix timestamp.

_Example_

```
{
  "status": 500,
  "path": "/agents/00DRM00000067To/messages",
  "requestId": "19c056ab-d909-49df-b976-65e56b6ab214",
  "error": "InactiveConfigException",
  "message": "Config is not active",
  "timestamp": 1531245973799
}
```

### SendMessageRequest

Represents a send message request.

*   `message` (_AbstractRequestMessage_, required)
*   `variables` (_Variables_)

### SendMessagesSyncResponseMessage

*   `messages` (_array of AbstractResponseMessage_, required) Array of response messages. Each message can be one of the following response message types: [Inform](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInformMessage), [TextChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATextChunkMessage), [ValidationFailureChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AValidationFailureChunkMessage), [ProgressIndicator](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AProgressIndicatorMessage), [Inquire](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInquireMessage), [Confirm](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AConfirmMessage), [Failure](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AFailureMessage), [Escalate](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEscalateMessage), [SessionEnded](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ASessionEndedMessage), [EndOfTurn](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEndOfTurnMessage), [Error](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AErrorMessage).  
    Minimum: 0.
*   `_links` (_SyncLinks_, required)

### ServerSentEvent

Server sent event (SSE) contents.

*   `id` (_string_) Event ID.  
    Example: `1692632086370-0`.
*   `event` (_EventType_, required)
*   `retry` (_number_) Reserved for future use.
*   `data` (_CopilotEvent | ErrorEvent_, required) Data associated with this event.
    
    One of: `CopilotEvent`, `ErrorEvent`.
    

### EndSessionReason

Type: `string`.

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

### FeedbackMessage

*   `feedbackId` (_FeedbackId_, required)
*   `feedback` (_FeedbackRating_, required)
*   `text` (_string_) Textual representation of user feedback.  
    Example: `Email looks great.`.
*   `details` (_object_) Additional details to provide as key value pairs.  
    Maximum properties: 10.
    
    _Example_
    
    ```
    {
      "userId": "uid"
    }
    ```
    

### ExternalSessionKey

UUID that you provide for the conversation. You can use this parameter to trace the conversation in your agent's event logs.

Type: `string`.

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

### InstanceConfig

API configuration parameters.

*   `endpoint` (_string_, required) My Domain URL for your Salesforce org. From Setup, search for My Domain. Copy the value shown in the Current My Domain URL field. See [Get Started with Agent API](/docs/ai/agentforce/guide/agent-api-get-started.html).  
    Example: `https://d5e000009s7bceah-dev-ed.my.salesforce.com/`.

### Variables

Array of custom and context agent variables passed to the agent during a session. See [Agent Variables](https://help.salesforce.com/s/articleView?id=ai.agent_variables.htm). Many variables are read-only and can only be set during the start session call. By default, context variables (which have the `$Context` prefix) aren't editable after the session has started, except for the `$Context.EndUserLanguage` variable. You can only modify editable variables during a send message call. When specifying variables that are derived from custom fields, omit the `__c` suffix. For instance, `Conversation_Key__c` becomes `$Context.Conversation_Key`. This array can be null.

Array of `Variable`.

### SessionFeature

Defines how the session supports message processing.

Type: `string`.

Allowed values: `Sync`, `Streaming`. Example: `Sync`.

### StreamingCapability

Describes the streaming capabilities.

*   `chunkTypes` (_array of ChunkType_) Array of chunk types.  
    Minimum: 0.

### ResponseSessionId

Agent session ID. Use this value for the session ID when sending messages or ending a session.

Type: `string`.

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

### SyncLinks

List of Agentforce endpoints for HATEOS compliance.

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

### AbstractResponseMessage

Response message. Message can be one of the following response message types: [Inform](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInformMessage), [TextChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATextChunkMessage), [ValidationFailureChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AValidationFailureChunkMessage), [ProgressIndicator](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AProgressIndicatorMessage), [Inquire](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInquireMessage), [Confirm](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AConfirmMessage), [Failure](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AFailureMessage), [Escalate](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEscalateMessage), [SessionEnded](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ASessionEndedMessage), [EndOfTurn](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEndOfTurnMessage), [Error](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AErrorMessage).

*   `id` (_MessageId_, required)
*   `type` (_string_, required) Indicates the type of message. Can be one of the following strings: [Inform](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInformMessage), [TextChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATextChunkMessage), [ValidationFailureChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AValidationFailureChunkMessage), [ProgressIndicator](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AProgressIndicatorMessage), [Inquire](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInquireMessage), [Confirm](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AConfirmMessage), [Failure](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AFailureMessage), [Escalate](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEscalateMessage), [SessionEnded](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ASessionEndedMessage), [EndOfTurn](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEndOfTurnMessage), [Error](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AErrorMessage).  
    Example: `Inform`.

### AbstractRequestMessage

Represents the message to be sent. Can be one of the following request message types: [Text](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATextMessage), [Reply](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AReplyMessage), [Cancel](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ACancelMessage), [TransferFailed](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATransferFailedMessage), [TransferSucceeded](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATransferSucceededMessage), [PlanTemplate](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3APlanTemplateMessage).

*   `type` (_string_, required) Request message type. Can be one of the following types: [Text](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATextMessage), [Reply](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AReplyMessage), [Cancel](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ACancelMessage), [TransferFailed](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATransferFailedMessage), [TransferSucceeded](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATransferSucceededMessage), [PlanTemplate](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3APlanTemplateMessage).  
    Allowed values: `Text`, `Reply`, `Cancel`, `TransferFailed`, `TransferSucceeded`, `PlanTemplate`.
*   `sequenceId` (_SequenceId_, required)

_Example_

```
{
  "type": "Text",
  "sequenceId": 1,
  "text": "Can you provide a summary of my orders?"
}
```

### EventType

Type of streaming event. See [Inform](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInformMessage), [TextChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATextChunkMessage), [ValidationFailureChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AValidationFailureChunkMessage), [ProgressIndicator](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AProgressIndicatorMessage), [Inquire](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInquireMessage), [Confirm](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AConfirmMessage), [Failure](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AFailureMessage), [Escalate](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEscalateMessage), [SessionEnded](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ASessionEndedMessage), [EndOfTurn](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEndOfTurnMessage), [Error](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AErrorMessage).

Type: `string`.

Allowed values: `UNKNOWN`, `END_OF_TURN`, `PROGRESS_INDICATOR`, `INFORM`, `INQUIRE`, `CONFIRM`, `FAILURE`, `SESSION_ENDED`, `ERROR`, `ESCALATE`, `TEXT_CHUNK`.

### CopilotEvent

Event wrapper.

*   `timestamp` (_number_) Event timestamp.  
    Example: `1716299066`.
*   `originEventId` (_EventId_)
*   `traceId` (_string_) Event trace ID.  
    Example: `69feac6d79e075633486f4f722fd97c3`.
*   `offset` (_number_) Event offset.
*   `message` (_AbstractResponseMessage_) Response message. Message can be one of the following response message types: [Inform](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInformMessage), [TextChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ATextChunkMessage), [ValidationFailureChunk](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AValidationFailureChunkMessage), [ProgressIndicator](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AProgressIndicatorMessage), [Inquire](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AInquireMessage), [Confirm](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AConfirmMessage), [Failure](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AFailureMessage), [Escalate](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEscalateMessage), [SessionEnded](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3ASessionEndedMessage), [EndOfTurn](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AEndOfTurnMessage), [Error](https://developer.salesforce.com/docs/ai/agentforce/references/agent-api?meta=type%3AErrorMessage).

### ErrorEvent

### FeedbackId

Unique ID to identify the generation. Used to submit feedback.

Type: `string`.

Example: `9247bbd8-5ed9-11ee-8c99-0242ac120002`.

### FeedbackRating

Feedback rating, suggesting a thumbs up or thumbs down.

Type: `string`.

Allowed values: `GOOD`, `BAD`.

### Variable

Custom or context variable passed to the agent during a session. See [Agent Variables](https://help.salesforce.com/s/articleView?id=ai.agent_variables.htm). Many variables are read-only and can only be set during the start session call. By default, context variables (which have the `$Context` prefix) aren't editable after the session has started, except for the `$Context.EndUserLanguage` variable. You can only modify editable variables during a send message call. When specifying variables that are derived from custom fields, omit the `__c` suffix. For instance, `Conversation_Key__c` becomes `$Context.Conversation_Key`.

*   `name` (_string_, required) API name for the agent variable.  
    Example: `$Context.EndUserLanguage`.
*   `type` (_string_, required) Variable type.  
    Allowed values: `Object`, `Json`, `Boolean`, `Date`, `DateTime`, `Money`, `Number`, `Text`, `Ref`, `List`. Example: `Text`.
*   `value` (_string_, required) Variable value.  
    Example: `en_US`.

### ChunkType

Defines the types of stream chunks you'd like to receive when streaming.

Type: `string`.

Allowed values: `Text`.

### HyperLink

Hyperlink object included in the links schema.

*   `href` (_string_) Link to the endpoint.  
    Example: `https://api.salesforce.com/sessions`.

### MessageId

UUID that references this message.

Type: `string`.

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

### SequenceId

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

Type: `number`.

Example: `1`.

### EventId

Unique ID to identify the event.

Type: `string`.

Example: `auMZc8ZRv37sIW2iJKq3M9MFx1YvV11A2x`.

### CancelMessage

Represents a cancel message request.

Includes all fields of `AbstractRequestMessage`.

*   `inReplyToMessageId` (_InReplyToMessageId_)

### ReplyMessage

Used when answering a question with a choice of multiple records.

Includes all fields of `AbstractRequestMessage`.

*   `inReplyToMessageId` (_InReplyToMessageId_)
*   `reply` (_array of TargetTypeMessage_, required)  
    Minimum items: 1.

### EndOfTurnMessage

Represents the end of the turn.

Includes all fields of `AbstractResponseMessage`.

### ProgressIndicatorMessage

Represents a progress indicator.

Includes all fields of `AbstractResponseMessage`.

*   `indicatorType` (_ProgressIndicatorType_, required)
*   `message` (_string_, required) Status message sent to the user.  
    Example: `Looking up your order`.

### ProgressIndicatorType

Indicates the type of progress indicator.

Type: `string`.

Allowed values: `ACTION`. Example: `ACTION`.

### PlanTemplateMessage

Represents a plan template message.

Represents the type of message to be sent by client when it wants to execute an existing plan.

Includes all fields of `AbstractRequestMessage`.

*   `inReplyToMessageId` (_InReplyToMessageId_)
*   `details` (_object_, required) Represents details of plan to be executed. Plan templates are metadata and available to planner service.
    *   `planId` (_string_) ID of the plan template.
    *   `intent` (_string_) A string representing the user intent behind this plan.
    *   `userUtterance` (_string_) User utterance that should be used in conversation history as a result of executing this plan.
    *   `variables` (_object_) Contains name value pairs capturing the variable substitutions in the plan.

### TextChunkMessage

Represents a chunk of the text response.

Includes all fields of `AbstractResponseMessage`.

*   `offset` (_number_, required) Offset value.
*   `message` (_string_, required) Text chunk message.
*   `formatType` (_TextFormatType_, required)

### TextFormatType

The text format type.

Type: `string`.

Allowed values: `Unknown`, `Text`.

### ValidationFailureChunkMessage

Indicates that there was a failure validating the agent's response. If you receive a validation failure chunk, remove all previously rendered chunks and display only the new streamed content.

Includes all fields of `AbstractResponseMessage`.

*   `offset` (_number_, required) Token offset value.
*   `reason` (_string_) Reason for validation failure.  
    Example: `UNGROUNDED`.

### InformMessage

Informs caller of response.

Includes all fields of `AbstractResponseMessage`.

*   `feedbackId` (_FeedbackId_, required)
*   `planId` (_PlanId_)
*   `isContentSafe` (_ContentSafety_, required)
*   `message` (_string_, required)  
    Example: `Great, the annual revenue for the specified account has been updated to $1,000,000`.
*   `result` (_array of SourceTypeMessage_) Array of results.  
    Minimum items: 1.
*   `citedReferences` (_array of CitedReference_) Array of citations.  
    Minimum items: 0.

### InquireMessage

Indicates that more information is required.

Includes all fields of `AbstractResponseMessage`.

*   `feedbackId` (_FeedbackId_, required)
*   `planId` (_PlanId_)
*   `isContentSafe` (_ContentSafety_)
*   `message` (_string_) The message string.
*   `collect` (_array of InquireCollectMessage_, required) List of data to be collected.  
    Minimum items: 0.

### InquireCollectMessage

Inquire type

*   `targetType` (_TargetTypeId_, required)
*   `targetProperty` (_TargetPropertyId_)
*   `data` (_SourceTypeMessage_)

### ConfirmMessage

Indicates that the agent is asking the user to verify that an action should be taken.

Includes all fields of `AbstractResponseMessage`.

*   `feedbackId` (_FeedbackId_, required)
*   `planId` (_PlanId_)
*   `isContentSafe` (_ContentSafety_)
*   `message` (_string_)
*   `confirm` (_array of TargetTypeMessage_, required) List of data to be collected.  
    Minimum items: 1.

### ErrorMessage

Indicates there was an error in the response.

Includes all fields of `AbstractResponseMessage`.

*   `feedbackId` (_FeedbackId_, required)
*   `httpStatus` (_integer (int32)_, required) Error HTTP status code.  
    Example: `500`.
*   `traceId` (_string_) Error trace ID.  
    Example: `69feac6d79e075633486f4f722fd97c3`.
*   `error` (_string_, required) Error class name.  
    Example: `NullPointerException`.
*   `message` (_string_, required) Error message.  
    Example: `Something went wrong.`.
*   `timestamp` (_number_) Error UNIX timestamp.  
    Example: `1531245973799`.
*   `expected` (_boolean_, required) Indicates whether the error was expected.  
    Example: `true`.

### RichContentCapability

*   `messageTypes` (_array of MessageTypeCapability_, required)  
    Minimum: 1.

### MessageTypeCapability

*   `messageType` (_MessageType_, required)
*   `formatTypes` (_array of FormatTypeCapability_, required)  
    Minimum: 1.

### FormatTypeCapability

*   `formatType` (_FormatType_, required)

### MessageType

Message type that supports rich content output formats.

*   `ChoicesMessage`: Represents multiple choice content.

Type: `string`.

Allowed values: `ChoicesMessage`. Example: `ChoicesMessage`.

### FormatType

The rendering format of a message. Describes how the message looks.

Type: `string`.

Allowed values: `MessageDefinition`, `Text`. Example: `MessageDefinition`.

### PlanId

Unique ID to identify the plan.

Type: `string`.

Example: `9247bbd8-5ed9-11ee-8c99-0242ac120002`.

### ContentSafety

Indicates whether the content is deemed as safe. A false value doesn't necessarily mean that the content isn't toxic.

Type: `boolean`.

Example: `true`.

### CitedReference

*   `type` (_string_, required) Type of citation. This value can be either a CRM record (`record`) or an external link (`link`).  
    Allowed values: `record`, `link`.
*   `value` (_string_, required) External link address.
*   `recordId` (_string_) Salesforce org record ID.
*   `label` (_string_) UI label for citation.
*   `inlineMetadata` (_array of InlineReferenceMetadata_) Inline metadata information used for inline citations.

### InlineReferenceMetadata

*   `claim` (_string_, required) Text from the agent response relevant to this reference.
*   `location` (_integer_, required) Index location for where this citation should be placed.

### SourceTypeMessage

Bundle for a source type.

*   `type` (_SourceTypeId_, required)
*   `property` (_SourcePropertyId_)
*   `value` (_TypeValue_, required)

### SourceTypeId

The action type ID. See [Agent Actions](https://help.salesforce.com/s/articleView?id=ai.copilot_actions.htm).

Type: `string`.

Example: `copilotActionOutput/EmployeeCopilot__UpdateRecordFields`.

### SourcePropertyId

The action property ID. See [Agent Actions](https://help.salesforce.com/s/articleView?id=ai.copilot_actions.htm).

Type: `string`.

Example: `result`.

### TargetTypeId

The action type ID. See [Agent Actions](https://help.salesforce.com/s/articleView?id=ai.copilot_actions.htm).

Type: `string`.

Example: `@aiFunctionInput/BookFlight`.

### TargetTypeMessage

Bundle for a target type.

*   `type` (_TargetTypeId_, required)
*   `property` (_TargetPropertyId_)
*   `value` (_TypeValue_, required)

### TargetPropertyId

The action property ID. See [Agent Actions](https://help.salesforce.com/s/articleView?id=ai.copilot_actions.htm).

Type: `string`.

Example: `flightInfo`.

### TypeValue

A type value.

Type: `any`.

Example: `a free form string or an object or an array`.

### InReplyToMessageId

Message ID of the previous response you are replying to.

Type: `string`.

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

### BooleanVariable

Includes all fields of `Variable`.

*   `value` (_boolean_, required, nullable) Boolean value.  
    Example: `true`.

### DateVariable

Includes all fields of `Variable`.

*   `value` (_string_, required, nullable) Date in the ISO\_LOCAL\_DATE format, 'YYYY-MM-DD'.  
    Example: `2021-09-21`.

### DateTimeVariable

Includes all fields of `Variable`.

*   `value` (_string_, required, nullable) Datetime in the ISO\_LOCAL\_DATE\_TIME format, 'YYYY-MM-DDTHH:MM:SS'.  
    Example: `2018-09-21T14:30:00`.

### MoneyVariable

Includes all fields of `Variable`.

*   `value` (_string_, required, nullable) Money in the format, '3\_LETTER\_CURRENCY\_CODE AMOUNT'.  
    Example: `USD 10.40`.

### NumberVariable

Includes all fields of `Variable`.

*   `value` (_number_, required, nullable) Variable value in number format.  
    Example: `10`.

### TextVariable

Includes all fields of `Variable`.

*   `value` (_string_, required, nullable) Variable value in text format.  
    Example: `Thanks for your order!`.

### ObjectVariable

Includes all fields of `Variable`.

*   `value` (_array of Variable_, required) Variable value as an object.
    
    _Example_
    
    ```
    [
      {
        "name": "fullName",
        "type": "text",
        "value": "Matt Smith"
      }
    ]
    ```
    

### RefVariable

Includes all fields of `Variable`.

*   `value` (_string_, required, nullable) Variable value in reference ID format.  
    Example: `1M5xx000000000BCAQ`.

### ListVariable

Includes all fields of `Variable`.

*   `value` (_array of object_, required, nullable) Array of objects.
    
    _Example_
    
    ```
    [
      {
        "type": "ref",
        "value": "1M5xx000000000BCAQ"
      }
    ]
    ```
    

### JsonVariable

Includes all fields of `Variable`.

*   `value` (_object_, required) Variable value in JSON format.

### 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`.

### TransferFailedMessage

Represents a transfer failed message.

Includes all fields of `AbstractRequestMessage`.

*   `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.

### TransferSucceededMessage

Represents a transfer succeeded message.

Includes all fields of `AbstractRequestMessage`.

*   `inReplyToMessageId` (_InReplyToMessageId_)

### TextMessage

Represents a text request.

Includes all fields of `AbstractRequestMessage`.

*   `inReplyToMessageId` (_InReplyToMessageId_)
*   `text` (_string_, required) Text reply to the agent.

### SessionEndedMessage

Indicates the session has ended.

Includes all fields of `AbstractResponseMessage`.

*   `reason` (_string_, required) Reason the session ended.  
    Allowed values: `ClientRequest`, `TransferFailedNotConfigured`, `Action`, `Error`, `InfiniteLoopDetected`. Example: `ClientRequest`.
*   `feedbackId` (_FeedbackId_)

### FailureMessage

Indicates that something didn't execute properly.

Includes all fields of `AbstractResponseMessage`.

*   `feedbackId` (_FeedbackId_, required)
*   `message` (_string_)
*   `planId` (_PlanId_)
*   `isContentSafe` (_ContentSafety_)
*   `code` (_string_, required)  
    Allowed values: `ACTION_FAILED`, `ESCALATE`.
*   `errors` (_array of string_) Failure information.

### EscalateMessage

Indicates that a human rep should handle this request. The escalation message is automatically translated based on the end user's language setting. If the language isn't supported, the original message is returned without translation.

Includes all fields of `AbstractResponseMessage`.

*   `feedbackId` (_FeedbackId_, required)
*   `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.

### Status

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