# Spotter Analyst API

> For the complete documentation index, see [llms.txt](https://developers.thoughtspot.com/docs/llms.txt)

Source: https://developers.thoughtspot.com/docs/spotter-analyst-api

# 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:

<table class="tableblock frame-all grid-all stretch"><colgroup><col style="width: 100%;"></colgroup><tbody><tr><td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph"><p><code>POST /api/rest/2.0/ai/agent/analysts/create</code><br><a href="{{navprefix}}/{{spotter-analyst-api}}#create-analyst">Creates a Spotter Analyst</a> with a name, description, data sources, and optional instructions, MCP connectors, and starter prompts.<br><em>Available on ThoughtSpot Cloud instances from 26.10.0.cl onwards.</em></p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph"><p><code>POST /api/rest/2.0/ai/agent/analysts/search</code><br><a href="{{navprefix}}/{{spotter-analyst-api}}#search-analysts">Retrieves Analysts visible to the caller</a>, either a single Analyst by identifier or a paginated list ordered by most recent access.<br><em>Available on ThoughtSpot Cloud instances from 26.10.0.cl onwards.</em></p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph"><p><code>POST /api/rest/2.0/ai/agent/analysts/{analyst_identifier}/update</code><br><a href="{{navprefix}}/{{spotter-analyst-api}}#update-analyst">Updates a Spotter Analyst</a>. The update is a full replace; omitted optional fields are cleared.<br><em>Available on ThoughtSpot Cloud instances from 26.10.0.cl onwards.</em></p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph"><p><code>POST /api/rest/2.0/ai/agent/analysts/{analyst_identifier}/share</code> <sup class="beta betaBackground">Beta</sup><br><a href="{{navprefix}}/{{spotter-analyst-api}}#share-analyst">Updates share permissions on a Spotter Analyst</a> for one or more users or groups. Granting access also shares the Analyst’s data sources with the principal.<br><em>Available on ThoughtSpot Cloud instances from 26.10.0.cl onwards.</em></p></div></div></td></tr><tr><td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph"><p><code>POST /api/rest/2.0/ai/agent/analysts/{analyst_identifier}/delete</code><br><a href="{{navprefix}}/{{spotter-analyst-api}}#delete-analyst">Permanently deletes a Spotter Analyst</a>. This operation is irreversible.<br><em>Available on ThoughtSpot Cloud instances from 26.10.0.cl onwards.</em></p></div></div></td></tr></tbody></table>

## 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 an `id`, `type`, and display `name`. Supported types: `MODEL`, `ANSWER`, `LIVEBOARD`, `CONVERSATION`.
    
-   `mcp_connectors`  
    _Array of strings_. Linked MCP connectors. Each connector includes `id`, `name`, and `icon_url`.
    
-   `starter_prompts`  
    _Array of strings_. Up to 4 suggested prompts shown on the Analyst landing page. Each entry includes `label`, `text`, `order`, and `is_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. Includes `id`, `name`, and `display_name`.
    
-   `updated_by`  
    User who last updated the Analyst. Includes `id`, `name`, and `display_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 |
| --- | --- |
| 
`name`

 | 

_String_. Display name of the Analyst.

 |
| 

`description`

 | 

_String_. Description of the Analyst. Maximum 200 characters.

 |
| 

`sources`

 | 

_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:

-   `identifier`  
    _String_. Unique ID of the data source object.
    
-   `type`  
    _String_. Type of the data source object. Valid values: `MODEL`, `ANSWER`, `LIVEBOARD`, and `CONVERSATION`.
    
-   `name`  
    _String_. Optional. Display name of the data source.
    





 |
| 

`instructions`

 | 

_String_. Optional. Natural-language instructions that guide the agent’s behavior. Instructions that conflict with system guardrails are rejected with a `409` error.

 |
| 

`mcp_connector_identifiers`

 | 

_Array of strings_. Optional. Identifiers of MCP connectors to link to the Analyst.

 |
| 

`starter_prompts`

 | 

_Array of strings_. Optional. Up to 4 plain-text prompts, each between 10 and 250 characters. Display order follows list position.

 |

### Request example

```bash
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_identifier` in the request body to retrieve a single Analyst. All other filters are ignored and `total_size` is `1`.

List mode

Omit `analyst_identifier` to 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 |
| --- | --- |
| 
`analyst_identifier`

 | 

_String_. Optional. When provided, returns exactly this Analyst. All other filters are ignored.

 |
| 

`record_size`

 | 

_Integer_. Optional. Number of records per page. The default value is `50`. The supported range is 1 to 500.

 |
| 

`record_offset`

 | 

_Integer_. Optional. Zero-based index of the first record. The default value is `0`. The maximum value is `10000`.

 |
| 

`query`

 | 

_String_. Optional. Case-insensitive substring match on Analyst name.

 |
| 

`type`

 | 

_String_. Optional. Ownership filter. Valid values are `ALL` (default, returns Analysts created by or shared with the caller), `CREATED_BY_ME`, and `SHARED_TO_ME`.

 |

### Request examples

List all Analysts

```bash
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

```bash
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 matching `Analyst` objects.
    
-   `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 |
| --- | --- | --- |
| 
`analyst_identifier`

 | 

Path parameter

 | 

_String_. Unique identifier of the Analyst to update, as returned by the Create an analyst or Search analysts endpoint.

 |
| 

`name`

 | 

Form parameter

 | 

_String_. Display name of the Analyst.

 |
| 

`description`

 | 

Form parameter

 | 

_String_. Description of the Analyst. Maximum 200 characters.

 |
| 

`sources`

 | 

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.

 |
| 

`instructions`

 | 

Form parameter

 | 

_String_. Optional. Natural-language instructions that guide the agent’s behavior. Instructions that conflict with system guardrails are rejected with a `409` error. If instructions are not specified, any existing instructions on the Analyst are removed.

 |
| 

`mcp_connector_identifiers`

 | 

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.

 |
| 

`starter_prompts`

 | 

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

```bash
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 |
| --- | --- | --- |
| 
`analyst_identifier`

 | 

Path parameter

 | 

_String_. Unique identifier of the Analyst to share, as returned by the Create an analyst or Search analysts endpoint.

 |
| 

`permissions`

 | 

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:

-   `principal`  
    _Object_. The user or group to assign access to. Specify the following attributes:
    
    -   `identifier`  
        _String_. Unique identifier of the user or group.
        
    -   `type`  
        _String_. Type of principal. Valid values: `USER` and `USER_GROUP`.
        
    
-   `share_mode`  
    _String_. Access level to assign. `READ_ONLY` or `MODIFY` grants or changes the principal’s access. `NO_ACCESS` revokes it.
    





 |

### Request examples

Share with a user and a group

```bash
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

```bash
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

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

## Related resources

-   [Embed Spotter Analyst]({{navprefix}}/{{embed-spotter-analyst}})
    
-   [REST API v2 reference]({{navprefix}}/{{rest-api-v2-reference}})
    
-   [Privileges and roles]({{navprefix}}/{{privileges-and-roles}})