POST /api/rest/2.0/ai/agent/analysts/create
Creates a Spotter Analyst with a name, description, data sources, and optional instructions, MCP connectors, and starter prompts.
Available on ThoughtSpot Cloud instances from 26.10.0.cl onwards.
Spotter Analyst API
ThoughtSpot Spotter Analysts are governed AI agents, each configured with a name, description, one or more data sources, and optional instructions, Model Context Protocol (MCP) connectors, and starter prompts. Users converse with an Analyst directly in the Spotter interface.
Supported endpoints๐
Use the following endpoints to create, search, update, share, or delete Analysts programmatically:
|
|
|
|
Analyst object๐
Each AI Analyst object in ThoughtSpot has the following properties:
-
id
String. Server-assigned unique identifier. -
name
String. Display name of the Analyst. -
description
String. Description of the Analyst. Maximum 200 characters. -
instructions
String. Optional natural-language behavior guidelines for the agent. -
sources
Array of strings. Data sources the Analyst can query. Each source includes anid,type, and displayname. Supported types:MODEL,ANSWER,LIVEBOARD,CONVERSATION. -
mcp_connectors
Array of strings. Linked MCP connectors. Each connector includesid,name, andicon_url. -
starter_prompts
Array of strings. Up to 4 suggested prompts shown on the Analyst landing page. Each entry includeslabel,text,order, andis_ai_generated. -
icon_id
String. Analyst icon identifier. Analysts created via the API use the default icon until one is set in the UI. -
updated_time_in_millis
Integer. Epoch timestamp in milliseconds of the last update. -
last_accessed_time_in_millis
Integer. Epoch timestamp in milliseconds of the last access. -
created_by
User who created the Analyst. Includesid,name, anddisplay_name. -
updated_by
User who last updated the Analyst. Includesid,name, anddisplay_name.
Create an analyst๐
To create a Spotter Analyst programmatically, send a POST request to the /api/rest/2.0/ai/agent/analysts/create endpoint with the Analyst definition in the request body. The definition includes a name, a description, and at least one data source, and can optionally include instructions, MCP connectors, and starter prompts.
Use this endpoint to provision governed Analysts as part of an automated deployment workflow, or to create Analysts programmatically across environments.
|
Note
|
Analysts created via the API use the default icon until one is set in the ThoughtSpot UI. |
Required privileges๐
Requires at least one of the following privileges:
-
ADMINISTRATION -
CAN_MANAGE_SPOTTER -
CAN_USE_SPOTTER
The user must also have at least view access to the data sources specified in the API request.
Request parameters๐
| Parameter | Description |
|---|---|
| String. Display name of the Analyst. |
| String. Description of the Analyst. Maximum 200 characters. |
| Array of objects. Data sources the Analyst can query. At least one source is required. The caller must have view access to every referenced source. For each source object, specify the following attributes:
|
| String. Optional. Natural-language instructions that guide the agentโs behavior. Instructions that conflict with system guardrails are rejected with a |
| Array of strings. Optional. Identifiers of MCP connectors to link to the Analyst. |
| Array of strings. Optional. Up to 4 plain-text prompts, each between 10 and 250 characters. Display order follows list position. |
Request example๐
curl -X POST \
--url 'https://{cluster}/api/rest/2.0/ai/agent/analysts/create' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
--data-raw '{
"name": "Revenue Analyst",
"description": "Answers revenue questions using the Sales data model.",
"sources": [
{
"identifier": "{model-guid}",
"type": "MODEL"
}
],
"instructions": "Focus on year-over-year comparisons. Do not surface raw transaction data.",
"starter_prompts": [
"What was total revenue last quarter?",
"Compare revenue by region for the past 12 months."
]
}'
API Response๐
Returns 200 OK and the created Analyst object, including the server-assigned id.
Search analysts๐
To retrieve the Spotter Analysts visible to the authenticated user, send a POST request to the /api/rest/2.0/ai/agent/analysts/search endpoint. Use this endpoint to fetch a specific Analyst by its identifier, or to render an Analyst catalog or picker in your app.
This endpoint operates in two modes:
- Fetch mode
-
Provide
analyst_identifierin the request body to retrieve a single Analyst. All other filters are ignored andtotal_sizeis1. - List mode
-
Omit
analyst_identifierto get a paginated list of Analysts, ordered by most recently accessed.
Required privileges๐
Requires at least one of the following privileges:
-
ADMINISTRATION -
CAN_MANAGE_SPOTTER -
CAN_USE_SPOTTER
Request parameters๐
| Parameter | Description |
|---|---|
| String. Optional. When provided, returns exactly this Analyst. All other filters are ignored. |
| Integer. Optional. Number of records per page. The default value is |
| Integer. Optional. Zero-based index of the first record. The default value is |
| String. Optional. Case-insensitive substring match on Analyst name. |
| String. Optional. Ownership filter. Valid values are |
Request examples๐
- List all Analysts
curl -X POST \
--url 'https://{cluster}/api/rest/2.0/ai/agent/analysts/search' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
--data-raw '{
"record_size": 50,
"record_offset": 0,
"type": "ALL"
}'
- Fetch a single Analyst
curl -X POST \
--url 'https://{cluster}/api/rest/2.0/ai/agent/analysts/search' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
--data-raw '{
"analyst_identifier": "{analyst-guid}"
}'
API Response๐
Returns 200 OK and an AnalystSearchResponse object with:
-
analysts: the current page of matchingAnalystobjects. -
total_size: total count of matching Analysts before pagination.
Update an analyst๐
To modify an existing Spotter Analyst, send a POST request to the /api/rest/2.0/ai/agent/analysts/{analyst_identifier}/update endpoint. The Analyst to update is identified by the analyst_identifier URL path parameter, and the new definition is passed in the request body.
The update is a full replace: the Analyst is rewritten from the request body, and any optional field omitted from the request is cleared. Include all fields you want to retain.
When new sources are added, they are automatically shared with users the Analyst was previously shared with. Those users retain access to a working Analyst.
Required privileges๐
Requires at least one of the following privileges:
-
ADMINISTRATION -
CAN_MANAGE_SPOTTER
The API endpoint doesnโt allow users to edit the Analyst objects that are shared with them by another user.
Request parameters๐
| Parameter | Type | Description |
|---|---|---|
| Path parameter | String. Unique identifier of the Analyst to update, as returned by the Create an analyst or Search analysts endpoint. |
| Form parameter | String. Display name of the Analyst. |
| Form parameter | String. Description of the Analyst. Maximum 200 characters. |
| Form parameter | Array of objects. Data sources the Analyst can query. Replaces the existing list in full. When new sources are added, they are automatically shared with users the Analyst was previously shared with, so those users keep a working Analyst. |
| Form parameter | String. Optional. Natural-language instructions that guide the agentโs behavior. Instructions that conflict with system guardrails are rejected with a |
| Form parameter | Array of strings. Optional. Identifiers of MCP connectors to link to the Analyst. Replaces the existing list in full. To remove the existing connectors, pass an empty array. |
| Form parameter | Array of strings. Optional. Up to 4 plain-text prompts, each between 10 and 250 characters. Replaces the existing list in full. To remove the existing starter prompts, pass an empty array. |
Request examples๐
curl -X POST \
--url 'https://{cluster}/api/rest/2.0/ai/agent/analysts/{analyst_identifier}/update' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
--data-raw '{
"name": "Revenue Analyst v2",
"description": "Updated to include APAC data model.",
"sources": [
{
"identifier": "{model-guid}",
"type": "MODEL"
},
{
"identifier": "{apac-model-guid}",
"type": "MODEL"
}
],
"starter_prompts": [
"What was total revenue last quarter?",
"Compare revenue by region for the past 12 months.",
"Show top 10 products by APAC revenue."
]
}'
|
Note
|
The update operation replaces existing properties of the Analyst object. Ensure that you include every parameter that you want to keep. |
API Response๐
Returns 200 OK and the updated Analyst object, including the refreshed updated_time_in_millis and updated_by fields.
Share an analyst Beta๐
To share a Spotter Analyst with other ThoughtSpot users and groups, or to change or revoke their access, send a POST request to the /api/rest/2.0/ai/agent/analysts/{analyst_identifier}/share endpoint. The Analyst to share is identified by the analyst_identifier URL path parameter, and the permission assignments are passed in the request body, one entry per principal.
Use READ_ONLY or MODIFY to grant or change a principalโs access, and NO_ACCESS to revoke it. When access is granted, the Analystโs data sources are automatically shared with the principal, so the Analyst keeps working for them.
Users the Analyst is shared with can use it but cannot edit it. To allow editing, set share_mode to MODIFY.
Required privileges๐
Requires at least one of the following privileges:
-
ADMINISTRATION -
CAN_MANAGE_SPOTTER
Use a Bearer token for the Org in which the Analyst exists.
Request parameters๐
Specify the analyst_identifier as a path parameter.
The request body contains a permissions array with one entry per principal. A principal may appear at most once per request.
| Parameter | Type | Description |
|---|---|---|
| Path parameter | String. Unique identifier of the Analyst to share, as returned by the Create an analyst or Search analysts endpoint. |
| Form parameter | Array of objects. Permission assignments, one entry per principal. A principal may appear at most once per request. For each entry, specify the following attributes:
|
Request examples๐
- Share with a user and a group
curl -X POST \
--url 'https://{cluster}/api/rest/2.0/ai/agent/analysts/{analyst_identifier}/share' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
--data-raw '{
"permissions": [
{
"principal": {
"identifier": "{user-guid}",
"type": "USER"
},
"share_mode": "READ_ONLY"
},
{
"principal": {
"identifier": "{group-guid}",
"type": "USER_GROUP"
},
"share_mode": "MODIFY"
}
]
}'
- Revoke access
curl -X POST \
--url 'https://{cluster}/api/rest/2.0/ai/agent/analysts/{analyst_identifier}/share' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {token}' \
--data-raw '{
"permissions": [
{
"principal": {
"identifier": "{user-guid}",
"type": "USER"
},
"share_mode": "NO_ACCESS"
}
]
}'
API Response๐
Returns an empty 204 No Content response on success.
Delete an analyst๐
To permanently delete a Spotter Analyst, send a POST request to the /api/rest/2.0/ai/agent/analysts/{analyst_identifier}/delete endpoint with the Analystโs unique identifier as the URL path parameter. No request body is required.
|
Warning
|
This operation is irreversible. Deleted Analysts cannot be recovered. |
Required privileges๐
The owners of the Analyst object specified in the API request can delete the object. Other users require at least one of the following privileges:
-
ADMINISTRATION -
CAN_MANAGE_SPOTTER
The API endpoint doesnโt allow users to delete the Analyst objects that are shared with them by another user.
Request parameter๐
Specify the ID of the Analyst to delete in the analyst_identifier path parameter.
Request example๐
curl -X POST \
--url 'https://{cluster}/api/rest/2.0/ai/agent/analysts/{analyst_identifier}/delete' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {token}'
API Response๐
Returns 200 OK and an AnalystDeleteResponse object containing the id of the deleted Analyst.