LLMs.txt: Complete documentation index for AI agents
Spotter agent conversation APIs

Spotter agent conversation APIs

ThoughtSpot’s Spotter agent conversation APIs allow you to create a conversation session with the Spotter agent, send natural language queries to it, and stop an in-progress response.

For an overview of all Spotter agent APIs and related pages, see Spotter agent APIs.

Spotter experience versionπŸ”—

From 26.12.0.cl, the conversation APIs accept an optional spotter_experience_version parameter that sets the Spotter experience a conversation runs on. This parameter can be passed in the request body to the /api/rest/2.0/ai/agent/conversation/create, /api/rest/2.0/ai/agent/conversation/{conversation_identifier}/send, POST /api/rest/2.0/ai/agent/conversation/{conversation_identifier}/send/stream, and /api/rest/2.0/ai/agent/conversation/{conversation_identifier}/stop-response API endpoints.

You must set it as query parameter when sending API requests the GET /api/rest/2.0/ai/agent/conversations and DELETE /api/rest/2.0/ai/agent/conversations/{conversation_identifier}/delete endpoints. The list endpoint returns only the conversations created on the version you specify.

ValueDescription

V2

The new Spotter experience. New Spotter capabilities ship on this version. This version accepts additional_instructions. This experience is available only if the Spotter 3 Liveboard experience is enabled on your instance.

V1 (default)

The default Spotter conversation experience available. This version uses conversation_settings.

Important

A conversation belongs to the version that created it. Pass the same spotter_experience_version value in every later request for that conversation. A request with a different value returns a not found error.

Create a conversation session with Spotter AgentπŸ”—

The /api/rest/2.0/ai/agent/conversation/create API endpoint creates a new conversation session with Spotter Agent for a specific or multi-data context and returns a conversation ID.

Request parametersπŸ”—

The request body must include the conversation context with exactly one of the following parameters:

  • metadata_context to set the data context directly.

  • analyst_identifier to start the conversation from a Spotter Analyst.

Passing both, or neither, is rejected with a 422 error.

REST API clients must have at least view access to the data source objects specified in the API request to create a conversation session and use it for subsequent queries.

Form parameterDescription

metadata_context

Defines the data context for the conversation.

  • type
    Metadata context type. The context type is mandatory. Select one of the following values:

    • AUTO_MODE to allow Spotter Agent to automatically discover and select the most relevant datasets for users' queries.

    • DATA_SOURCE to set a specific data source as the data context. You must specify data_source_context and data source IDs.
      To set a specific data source object, use data_source_identifier.
      To set multi-data context, use data_source_identifiers.

    • data_source Deprecated
      This option is deprecated in 26.5.0.cl. ThoughtSpot recommends using the DATA_SOURCE with data_source_context and data source IDs instead.

analyst_identifier

String. Optional. Unique identifier of a Spotter Analyst to start the conversation from. The conversation uses the Analyst’s configuration, including its data sources, agent instructions, and connectors, so metadata_context must be omitted. For information about Analyst management endpoints, see Spotter Analyst API.

spotter_experience_version

String. Optional. Spotter experience that the conversation runs on, V1 (default) or V2. See Spotter experience version.

additional_instructions

String. Optional. Applies to V2 Spotter experience only. Guidance that ThoughtSpot appends to the agent instructions for every message in the conversation, for example a persona, an output format, or domain rules. You cannot change the instructions after you create the conversation, and you cannot use this parameter with analyst_identifier.

conversation_settings

Optional. Applies to V1 Spotter experience only. Defines additional parameters for the conversation context. You can set any of the following attributes as needed:

  • enable_contextual_change_analysis
    Boolean. When enabled, Spotter analyzes how context changes over time, that is, comparing results from different queries. Enabled by default in 26.2.0.cl and later versions.

  • enable_natural_language_answer_generation
    Boolean. Allows sending natural language queries to the conversation session. Enabled by default in 26.2.0.cl and later versions.

  • enable_reasoning
    Boolean. Allows Spotter to use reasoning for deep analysis and precise responses. Enabled by default in 26.2.0.cl and later versions.

  • enable_save_chat
    When set to true, adds the conversation to chat history.

Example requestπŸ”—

With AUTO_MODE for metadata context
curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/create'  \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
  "metadata_context": {
    "type": "AUTO_MODE"
  },
  "conversation_settings": {
    "enable_save_chat": true
  }
}'
For a single data source as the data context
curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/create'  \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
  "metadata_context": {
    "type": "DATA_SOURCE",
    "data_source_context": {
      "data_source_identifier": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
  },
  "conversation_settings": {}
}'
Start a conversation from a Spotter Analyst
curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/create'  \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
  "analyst_identifier": "{analyst-guid}",
  "conversation_settings": {
    "enable_save_chat": true
  }
}'
With the new Spotter experience (V2)
curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/create'  \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
  "metadata_context": {
    "type": "DATA_SOURCE",
    "data_source_context": {
      "data_source_identifier": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
    }
  },
  "spotter_experience_version": "V2",
  "additional_instructions": "Answer in a concise, executive-summary style."
}'
For multi-data source context
curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/create'  \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
  "metadata_context": {
    "type": "DATA_SOURCE",
    "data_source_context": {
      "data_source_identifiers": [
        "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        "b2c3d4e5-f6a7-8901-bcde-f12345678901"
      ]
    }
  },
  "conversation_settings": {
    "enable_save_chat": true
  }
}'

API responseπŸ”—

If the API request is successful, the API returns the conversation ID and identifier in the response body.

{
  "conversation_id": "wwHQ5j8O8dQC",
  "conversation_identifier": "wwHQ5j8O8dQC",
  "analyst_id": "9f8e7d6c-5b4a-3210-fedc-ba9876543210"
}
  • conversation_identifier
    Use this for all subsequent message calls.

  • conversation_id Deprecated
    Returns the same value as conversation_identifier.

  • analyst_id
    If the conversation context uses a Spotter Analyst agent, the API endpoint returns the analyst_id in response. The value is null otherwise.

Send queries to a conversation sessionπŸ”—

To send queries to an ongoing conversation session with the Spotter agent and receive a response synchronously, use the /api/rest/2.0/ai/agent/conversation/{conversation_identifier}/send API endpoint.

This API operation requires the conversation ID obtained from the conversation creation API endpoint (/api/rest/2.0/ai/agent/conversation/create). The user making the API request must have the CAN_USE_SPOTTER privilege, access to the metadata object associated with the conversation, and access to the conversation session. The API request body must include at least one message in natural language format.

Request parametersπŸ”—

ParameterTypeDescription

conversation_identifier

Path parameter

String. Required. Specify the conversation ID received from the POST /api/rest/2.0/ai/agent/conversation/create API call.

messages

Form parameter

Array of strings. Required. Specify at least one query in natural language. For example, total sales of jackets last month.

spotter_experience_version

Form parameter

String. Optional. V1 (default) or V2 to specify the Spotter experience version. Pass the value that the conversation was created with.

Request and response examplesπŸ”—

The following example sends a data comparison query to a conversation session. The conversation ID is specified in the request URL as a path parameter.

curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/{conversation_identifier}/send' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}'  \
  --data-raw '{
  "messages": [
    "Sales in 2025 vs 2024"
  ]
}'

The API response depends on the Spotter experience version of the conversation. For API requests with the V2 as the Spotter experience, the API returns the conversation_identifier and an events array. The array contains the events that the streaming endpoint publishes for the turn, collected into one response.

For API requests with V1 as the Spotter experience, the API returns the messages as shown in the following example.

[
  {
    "type": "text",
    "text": "\n\nI'll compare sales between 2025 and 2024. First, let me get the dataset context.",
    "metadata": {},
    "internal": {},
    "agent_context": ""
  },
  {
    "type": "text",
    "text": "```json\n{\"dataset_name\":\"(Sample) Retail - Apparel\",\"columns\":[{\"name\":\"sales\",\"type\":\"MEASURE\"},{\"name\":\"date\",\"type\":\"ATTRIBUTE\"}]}\n```",
    "metadata": {},
    "internal": {},
    "agent_context": ""
  },
  {
    "type": "answer",
    "title": "Compare total sales for 2025 vs 2024",
    "description": "",
    "session_id": "842bb67a-e08e-4861-97e8-8db9538db51d",
    "gen_no": 2,
    "sage_query": "[sales] [date] = '2025' vs [date] = '2024'",
    "tml_tokens": ["[sales]", "[date] = '2025' vs [date] = '2024'"],
    "formulas": [],
    "parameters": [],
    "subqueries": [],
    "viz_suggestion": "CAEQIBomEiQ2NjE5NzI0Yy1kMjVlLTU4MDItOWNjOC1jNDA3MWY3OWY5MzAoATIA",
    "metadata": {
      "output": "<base64-encoded-protobuf-output>",
      "worksheet_id": "cd252e5c-b552-49a8-821d-3eadaa049cca",
      "chart_type": "KPI",
      "interrupted": false,
      "data_awareness_enabled": true
    },
    "internal": {}
  },
  {
    "type": "text",
    "text": "\n\nThe visualization shows year-over-year comparison. You can identify growth or decline trends.",
    "metadata": {},
    "internal": {},
    "agent_context": ""
  }
]

The following example sends a follow-up question to the same conversation session.

curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/{conversation_identifier}/send' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}'  \
  --data-raw '{
  "messages": [
    "Now break that down by product category"
  ]
}'

If the request is successful, the agent returns the response for the follow-up question:

[{
    "type": "text",
    "text": "I'll add product category to the comparison.",
    "metadata": {},
    "internal": {},
    "agent_context": ""
  },
  {
    "type": "answer",
    "title": "Sales by Product Category: 2025 vs 2024",
    "session_id": "9abc1234-0000-0000-0000-000000000005",
    "gen_no": 3,
    "sage_query": "[sales] [product category] [date] = '2025' vs [date] = '2024'",
    "tml_tokens": ["[sales]", "[product category]", "[date] = '2025' vs [date] = '2024'"],
    "formulas": [],
    "parameters": [],
    "subqueries": [],
    "viz_suggestion": "",
    "metadata": {
      "chart_type": "BAR",
      "worksheet_id": "cd252e5c-b552-49a8-821d-3eadaa049cca"
    },
    "internal": {}
  }]

In each response, the agent returns the following information:

  • type
    Type of the message, such as text, answer, or error.

  • text
    Response message generated for the query.

  • metadata
    Additional information based on the message type. For example, answer metadata, chart type, or the data source ID.

  • tml_tokens
    Query string broken down as TML tokens.

In case of errors, the response returns the error details:

[{
    "type": "error",
    "message": "The conversation session has expired. Please create a new conversation.",
    "code": "SESSION_EXPIRED"
}]

Stop an in-progress agent responseπŸ”—

The /api/rest/2.0/ai/agent/conversation/{conversation_identifier}/stop-response API endpoint stops a Spotter agent response that is currently in progress for a given conversation session.

Use this endpoint when you want to cancel a long-running Spotter response before it completes. The conversation session remains active after you stop a response, so you can send a new query to the same session immediately.

Request parametersπŸ”—

ParameterTypeDescription

conversation_identifier

Path parameter

String. Required. The identifier of the active conversation session. Use the value returned by the create conversation API endpoint.

spotter_experience_version

Form parameter

String. Optional. V1 (default) or V2 to specify the Spotter experience. Pass the value that the conversation was created with.

The request body is optional. For a V2 conversation, include spotter_experience_version in the request body.

Example requestπŸ”—

curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/{conversation_identifier}/stop-response' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}'

To stop a response to a conversation session in V2 Spotter experience:

curl -X POST \
  --url 'https://{ThoughtSpot-Host}/api/rest/2.0/ai/agent/conversation/{conversation_identifier}/stop-response' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {AUTH_TOKEN}' \
  --data-raw '{
  "spotter_experience_version": "V2"
}'

Example responseπŸ”—

If the API request is successful, ThoughtSpot stops the in-progress response and returns a 204 response code.

If the conversation session is not found or has expired, the API returns an error:

{
  "error_code": "CONVERSATION_NOT_FOUND",
  "message": "The specified conversation session does not exist or has expired."
}
Β© 2026 ThoughtSpot Inc. All Rights Reserved.