Data connection APIs

ThoughtSpot supports connecting to external data warehouses and using these as data sources for analytics and visualizations. ThoughtSpot users can run a live query of the data directly from the following external data sources to generate the information they need:

  • Snowflake

  • Amazon Redshift

  • Google BigQuery

  • Azure Synapse

  • Oracle ADW

  • Starburst

  • Databricks

  • Teradata

  • SAP HANA

The connection API endpoints allow you to create, edit, delete, export, and query data connections on a ThoughtSpot cluster.

Connection metadata

To create or modify data connections through REST APIs, you need to provide a map of JSON attributes as metadata. The metadata JSON includes configuration attributes and a map of the database schema with tables. To create a new data connection, the metadata JSON map should include at least one table object.

Here is an example of the metadata JSON file:

Connection metadata

Configuration attributes in connection metadata

The configuration attributes in the connection vary based on the type of connection.

Snowflake connection
  • accountName

    String. The account name associated with the Snowflake connection.

  • user

    String. The Snowflake account username.

  • password

    String. The password of your Snowflake account.

  • role

    String. The role assigned to your user account. For example, sysadmin.

    Make sure the role you specify for this attribute has privileges to access the database, schema, and tables that you want to use for the live query service.

  • warehouse

    String. The warehouse associated with the connection.

Amazon Redshift connection
  • host

    String. The hostname of the database connection.

  • port

    Integer. Enter the port number associated with the database. The default port is 5439.

  • user

    String. The username of your Redshift account.

  • password

    String. Password of your Redshift account.

  • database

    String. Specify the name of the database that you want to use for live query.

Google BigQuery connection
  • project_id

    String. ID of the project associated with your BigQuery account.

  • oauth_pvt_key

    String. The secret key obtained for your BigQuery service account. To obtain the secret key, you must create a custom role in BigQuery and set up your service account. For more information, see BigQuery prerequisites.

Azure Synapse connection
  • host

    String. The hostname of the database connection.

  • port

    Integer. Enter the port number associated with the database.

  • user

    String. The username of your Azure Synapse account.

  • password

    String. Password of your Azure Synapse account.

  • database

    String. Specify the database associated with the account.

Teradata connection
  • host

    String. The hostname of the database connection.

  • user

    String. The username of your Teradata account.

  • password

    String. Password of your Teradata account.

  • database

    String. The database associated with the account.

Oracle ADW connection
  • user

    String. The username of your Oracle ADW account.

  • password

    String. Password of your Oracle ADW account.

  • net_service_name

    String. The Net Service Name of your Oracle ADW account.

  • tns_admin

    String. The ID of the directory specified by the TNS_ADMIN environment variable.

  • schema

    String. The schema of the database.

Starburst connection
  • host

    String. The hostname of the database connection.

  • user

    String. The username of your Starburst account.

  • password

    String. Password of your Starburst account.

  • database

    String. The database associated with the account.

Databricks connection
  • host

    String. The hostname of the database connection. For example, dbs.example.cloud.databricks.com.

  • http_path

    String. The HTTP path of your Databricks connection host.

  • user

    String. The username of your Databricks account.

  • password

    String. Password of your Databricks account.

SAP HANA connection
  • host

    String. The hostname of the SAP HANA database connection. For example, if your host is 192.168.1.1, and your port is 8080, specify 192.168.1.1:8080.

  • user

    String. The username of your SAP HANA database account.

  • password

    String. Password of your SAP HANA database account.

  • database

    String. The database associated with the account.

Supported operations

POST /tspublic/v1/connection/create
Creates a data connection.

POST /tspublic/v1/connection/update
Modifies a data connection.

GET /tspublic/v1/connection/types
Gets a list of data connections that are currently operational on the ThoughtSpot cluster.

GET /tspublic/v1/connection/list
Gets a list of data connections set up for a live query service on the ThoughtSpot cluster.

GET /tspublic/v1/connection/export
Exports a data connection map.

POST /tspublic/v1/connection/delete
Deletes the specified data connections.

Add a data connection for live query service

ThoughtSpot supports connecting to external data warehouses and using these as data sources for analytics and visualizations. To create a connection to an external data source and set up a live query service, use the /tspublic/v1/connection/create API.

Creating a new connection requires defining at least one table in the metadata JSON map.

Resource URL

POST /tspublic/v1/connection/create

Request parameters

Form parameter Description

name

String. Name of the connection.

description

String A short description of data connection.

type

String. Type of the data connection. For example, RDBMS_SNOWFLAKE, RDBMS_REDSHIFT.

Valid values for type map to the name property in the API response returned by the /tspublic/v1/connection/types API endpoint.

metadata

String. A JSON map of the connection metadata. The metadata must include configuration attributes, database, schema, and table objects. Make sure the database object includes at least one table.

state

Integer. The GUID of the OAuth redirect URI. This attribute is automatically populated and cannot be set by users.

Example request

cURL
curl -X POST \
--header 'Content-Type: application/x-www-form-urlencoded'  \
--header 'Accept: application/json'  \
--header 'X-Requested-By: ThoughtSpot' \
-d 'name=Snowflake&description=Snowflake_connection&type=RDBMS_SNOWFLAKE&metadata=<metadata-JSON-map>' \ 'https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/create'
Request URL
https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/create

Example JSON map for metadata creation

The following example shows the metadata JSON map for creating a Snowflake data connection. Note that the example shows the configuration attributes required to authenticate to the data source, and the object metadata (database, schema, and tables) to add to the connection.

{
   "configuration":{
      "accountName":"thoughtspot_partner",
      "user":"tsadmin",
      "password":"TestConn123",
      "role":"sysadmin",
      "warehouse":"MEDIUM_WH"
   },
   "externalDatabases":[
      {
         "name":"AllDatatypes",
         "isAutoCreated":false,
         "schemas":[
            {
               "name":"alldatatypes",
               "tables":[
                  {
                     "name":"allDatatypes",
                     "type":"TABLE",
                     "description":"",
                     "selected":true,
                     "linked":true,
                     "columns":[
                        {
                           "name":"CNUMBER",
                           "type":"INT64",
                           "canImport":true,
                           "selected":true,
                           "isLinkedActive":true,
                           "isImported":false,
                           "tableName":"allDatatypes",
                           "schemaName":"alldatatypes",
                           "dbName":"AllDatatypes"
                        },
                        {
                           "name":"CDECIMAL",
                           "type":"INT64",
                           "canImport":true,
                           "selected":true,
                           "isLinkedActive":true,
                           "isImported":false,
                           "tableName":"allDatatypes",
                           "schemaName":"alldatatypes",
                           "dbName":"AllDatatypes"
                        }
                     ]
                  }
               ]
            }
         ]
      }
   ]
}

Example response

If the connection creation is successful, the API returns a response body with the connection metadata header:

{
  "header": {
    "id": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
    "indexVersion": 0,
    "generationNum": 0,
    "name": "TEST_conn_1",
    "description": "TEST_conn_private_1",
    "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
    "created": 1632118531177,
    "modified": 1632118531177,
    "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
    "owner": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
    "tags": [],
    "isExternal": false,
    "isDeprecated": false
  },
  "type": "RDBMS_SNOWFLAKE",
  "authenticationType": "SERVICE_ACCOUNT",
  "logicalTableList": [
    {
      "columns": [
        {
          "physicalColumnGUID": "61d10324-ac22-43e2-8623-fa96f503bab5",
          "position": 0,
          "header": {
            "id": "fd718c83-5e9c-45ae-a4cd-1cb13b03db2f",
            "indexVersion": 381,
            "generationNum": 384,
            "name": "CNUMBER",
            "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
            "created": 1632118531988,
            "modified": 1632118532985,
            "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
            "owner": "b0248372-5e68-4815-8682-67715456efb2",
            "isDeleted": false,
            "isHidden": false,
            "schemaStripe": "AllDatatypes_alldatatypes_dMSAHvi",
            "databaseStripe": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
            "tags": [],
            "isExternal": false,
            "isDeprecated": false
          },
          "complete": true,
          "incompleteDetail": [],
          "isDerived": false,
          "dataType": "INT64",
          "type": "MEASURE",
          "defaultAggrType": "SUM",
          "physicalColumnName": "CNUMBER",
          "ownerName": "allDatatypes",
          "ownerType": "ONE_TO_ONE_LOGICAL",
          "entityCategory": "DEFAULT",
          "columnMappingInfo": {
            "columnName": "CNUMBER"
          },
          "spotiqPreference": "DEFAULT",
          "isAdditive": true,
          "indexType": "DONT_INDEX",
          "indexPriority": 1,
          "sources": [],
          "synonyms": [],
          "customActionTags": [],
          "injectedInlineValues": [],
          "precision": -1,
          "scale": 0,
          "schemaVersion": "4",
          "isPrimaryKey": false,
          "isAttributionDimension": true
        },
        {
          "physicalColumnGUID": "86c34243-9637-4737-993f-6ed30d3e682c",
          "position": 1,
          "header": {
            "id": "6eed0b58-d195-4236-a376-f135f9b24204",
            "indexVersion": 381,
            "generationNum": 384,
            "name": "CDECIMAL",
            "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
            "created": 1632118531988,
            "modified": 1632118532985,
            "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
            "owner": "b0248372-5e68-4815-8682-67715456efb2",
            "isDeleted": false,
            "isHidden": false,
            "schemaStripe": "AllDatatypes_alldatatypes_dMSAHvi",
            "databaseStripe": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
            "tags": [],
            "isExternal": false,
            "isDeprecated": false
          },
          "complete": true,
          "incompleteDetail": [],
          "isDerived": false,
          "dataType": "INT64",
          "type": "MEASURE",
          "defaultAggrType": "SUM",
          "physicalColumnName": "CDECIMAL",
          "ownerName": "allDatatypes",
          "ownerType": "ONE_TO_ONE_LOGICAL",
          "entityCategory": "DEFAULT",
          "columnMappingInfo": {
            "columnName": "CDECIMAL"
          },
          "spotiqPreference": "DEFAULT",
          "isAdditive": true,
          "indexType": "DONT_INDEX",
          "indexPriority": 1,
          "sources": [],
          "synonyms": [],
          "customActionTags": [],
          "injectedInlineValues": [],
          "precision": -1,
          "scale": 0,
          "schemaVersion": "4",
          "isPrimaryKey": false,
          "isAttributionDimension": true
        }
      ],
      "tableFilters": [],
      "physicalTableVersion": 0,
      "logicalTableContent": {
        "joinType": "INNER",
        "joinOverrides": {},
        "physicalTableName": "allDatatypes",
        "worksheetType": "VIEW",
        "isAggregatedWorksheet": false,
        "bypassRLS": false,
        "shardingInfo": {
          "primaryKeyColumns": [],
          "shardingKeyColumns": [],
          "numberOfShards": 0
        },
        "tableMappingInfo": {
          "databaseName": "AllDatatypes",
          "schemaName": "alldatatypes",
          "tableName": "allDatatypes",
          "tableType": "TABLE",
          "cachingInfo": {
            "isCached": false,
            "lastLoadTime": 0,
            "type": "UNKNOWN"
          }
        },
        "isOptimized": false,
        "schemaVersion": "4"
      },
      "type": "ONE_TO_ONE_LOGICAL",
      "generationType": "DEFAULT",
      "physicalTableGUID": "14b7589b-8a98-4786-a0c5-0396e05b91ba",
      "relationships": [],
      "dataSourceId": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
      "dataSourceTypeEnum": "DEFAULT",
      "header": {
        "id": "b0248372-5e68-4815-8682-67715456efb2",
        "indexVersion": 381,
        "generationNum": 382,
        "name": "allDatatypes",
        "description": "",
        "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
        "authorName": "su",
        "authorDisplayName": "Administrator Super-User",
        "created": 1632118531988,
        "modified": 1632118532985,
        "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
        "owner": "b0248372-5e68-4815-8682-67715456efb2",
        "isDeleted": false,
        "isHidden": false,
        "schemaStripe": "AllDatatypes_alldatatypes_dMSAHvi",
        "databaseStripe": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
        "tags": [],
        "type": "ONE_TO_ONE_LOGICAL",
        "isExternal": true,
        "isDeprecated": false
      },
      "complete": true,
      "incompleteDetail": [],
      "destinationRelationships": [],
      "relationshipsWithin": "",
      "isCached": false
    }
  ],
  "dataSourceContent": {
    "statistics": {},
    "dataLoadInfo": {
      "tableToTaskIdMap": {}
    },
    "schemaVersion": "4",
    "configuration": {
      "password": "",
      "role": "DEVELOPER",
      "warehouse": "MEDIUM_WH",
      "accountName": "thoughtspot_partner",
      "user": "tsadmin"
    }
  }
}

Response codes

HTTP status code Description

200

Successful creation of the connection object

401

Unauthorized or wrong credentials

500

The connection could not be created

Edit an existing data connection

To update or modify the connection attributes of a data connection, use the /tspublic/v1/connection/update API.

Resource URL

POST /tspublic/v1/connection/update

Request parameters

Form parameter Description

name

String. Name of the connection.

description

String. The description of the data connection.

type

String. Type of the data connection. For example, RDBMS_SNOWFLAKE, RDBMS_REDSHIFT. Valid values for type map to the name attribute from the in the response to the /tspublic/v1/connection/types API endpoint.

id

String. The GUID of the data connection that you want to modify.

metadata

String. A JSON map of the connection attributes.

state

Integer. The GUID of the OAuth redirect URI. This attribute is automatically populated and cannot be set by users.

Example request

cURL
curl -X POST \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'X-Requested-By: ThoughtSpot' \
-d 'name=Snow_TEST&description=Test_connection&type=RDBMS_SNOWFLAKE&id=9114f105-fc9e-48c9-a8f1-57f2fda4f056&metadata=<metadata-JSON-map>' \ 'https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/update'
Request URL
https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/update

Example JSON map for metadata update

The following example shows the metadata JSON map for modifying a Snowflake data connection. Note that the example shows the configuration attributes to authenticate to the data source, tables, and column data for connection modification.

{
   "configuration":{
      "accountName":"thoughtspot_partner",
      "user":"tsadmin",
      "password":"Embrace123",
      "role":"sysadmin",
      "warehouse":"MEDIUM_WH"
   },
   "externalDatabases":[
      {
         "name":"AllDatatypes",
         "isAutoCreated":false,
         "schemas":[
            {
               "name":"alldatatypes",
               "tables":[
                  {
                     "name":"allDatatypes",
                     "type":"TABLE",
                     "description":"",
                     "selected":true,
                     "linked":true,
                     "columns":[
                        {
                           "name":"CDECIMAL",
                           "type":"INT64",
                           "canImport":false,
                           "selected":true,
                           "isLinkedActive":true,
                           "isImported":false,
                           "tableName":"allDatatypes",
                           "schemaName":"alldatatypes",
                           "dbName":"AllDatatypes"
                        },
                        {
                           "name":"CBIGINT",
                           "type":"INT64",
                           "canImport":false,
                           "selected":false,
                           "isLinkedActive":true,
                           "isImported":false,
                           "tableName":"allDatatypes",
                           "schemaName":"alldatatypes",
                           "dbName":"AllDatatypes"
                        }
                     ]
                  }
               ]
            }
         ]
      }
   ]
}

Example response

If the connection modification is successful, the API returns a response body with the updated details:

{
  "dataSource": {
    "header": {
      "id": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
      "indexVersion": 385,
      "generationNum": 385,
      "name": "TEST_conn_1",
      "description": "TEST_conn_private_1",
      "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
      "authorName": "tsadmin",
      "authorDisplayName": "Administrator",
      "created": 1632118531177,
      "modified": 1632118751633,
      "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
      "owner": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
      "isDeleted": false,
      "isHidden": false,
      "isAutoCreated": false,
      "statistics": {
        "dataLoadStatistics": {
          "scheduled": false,
          "connectionType": "",
          "connectionDisplayName": "",
          "dataLoadStatusList": [],
          "header": {
            "id": "a2352b8c-e85e-4d58-8f6a-ac42c0252f2d",
            "indexVersion": 385,
            "generationNum": 385,
            "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
            "owner": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
            "isDeleted": false,
            "isHidden": false,
            "tags": [],
            "isExternal": false,
            "isDeprecated": false
          },
          "complete": true,
          "incompleteDetail": []
        }
      },
      "tags": [],
      "isExternal": false,
      "isDeprecated": false
    },
    "type": "RDBMS_SNOWFLAKE",
    "authenticationType": "SERVICE_ACCOUNT",
    "logicalTableList": [
      {
        "columns": [
          {
            "physicalColumnGUID": "86c34243-9637-4737-993f-6ed30d3e682c",
            "position": 1,
            "header": {
              "id": "6eed0b58-d195-4236-a376-f135f9b24204",
              "indexVersion": 382,
              "generationNum": 382,
              "name": "CDECIMAL",
              "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
              "created": 1632118531988,
              "modified": 1632118532985,
              "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
              "owner": "b0248372-5e68-4815-8682-67715456efb2",
              "isDeleted": false,
              "isHidden": false,
              "schemaStripe": "AllDatatypes_alldatatypes_dMSAHvi",
              "databaseStripe": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
              "tags": [],
              "isExternal": false,
              "isDeprecated": false
            },
            "complete": true,
            "incompleteDetail": [],
            "isDerived": false,
            "dataType": "INT64",
            "type": "MEASURE",
            "defaultAggrType": "SUM",
            "physicalColumnName": "CDECIMAL",
            "ownerName": "allDatatypes",
            "ownerType": "ONE_TO_ONE_LOGICAL",
            "entityCategory": "DEFAULT",
            "columnMappingInfo": {
              "columnName": "CDECIMAL"
            },
            "spotiqPreference": "DEFAULT",
            "isAdditive": true,
            "indexType": "DONT_INDEX",
            "indexPriority": 1,
            "sources": [],
            "synonyms": [],
            "customActionTags": [],
            "injectedInlineValues": [],
            "precision": -1,
            "scale": 0,
            "isPrimaryKey": false,
            "isAttributionDimension": true
          }
        ],
        "tableFilters": [],
        "physicalTableVersion": 0,
        "logicalTableContent": {
          "joinType": "INNER",
          "joinOverrides": {},
          "physicalTableName": "allDatatypes",
          "worksheetType": "VIEW",
          "isAggregatedWorksheet": false,
          "bypassRLS": false,
          "shardingInfo": {
            "primaryKeyColumns": [],
            "shardingKeyColumns": [],
            "numberOfShards": 0
          },
          "tableMappingInfo": {
            "databaseName": "AllDatatypes",
            "schemaName": "alldatatypes",
            "tableName": "allDatatypes",
            "tableType": "TABLE",
            "cachingInfo": {
              "isCached": false,
              "lastLoadTime": 0,
              "type": "UNKNOWN"
            }
          },
          "isOptimized": false
        },
        "type": "ONE_TO_ONE_LOGICAL",
        "generationType": "DEFAULT",
        "physicalTableGUID": "14b7589b-8a98-4786-a0c5-0396e05b91ba",
        "relationships": [],
        "dataSourceId": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
        "dataSourceTypeEnum": "RDBMS_SNOWFLAKE",
        "header": {
          "id": "b0248372-5e68-4815-8682-67715456efb2",
          "indexVersion": 384,
          "generationNum": 384,
          "name": "allDatatypes",
          "description": "",
          "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
          "authorName": "tsadmin",
          "authorDisplayName": "Administrator",
          "created": 1632118531988,
          "modified": 1632118532985,
          "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
          "owner": "b0248372-5e68-4815-8682-67715456efb2",
          "isDeleted": false,
          "isHidden": false,
          "schemaStripe": "AllDatatypes_alldatatypes_dMSAHvi",
          "databaseStripe": "d19bec78-4e10-446a-b531-2a0e69c5e62f",
          "tags": [],
          "type": "ONE_TO_ONE_LOGICAL",
          "isExternal": true,
          "isDeprecated": false
        },
        "complete": true,
        "incompleteDetail": [],
        "destinationRelationships": [],
        "relationshipsWithin": "",
        "isCached": false
      }
    ],
    "dataSourceContent": {
      "statistics": {},
      "dataLoadInfo": {
        "tableToTaskIdMap": {}
      },
      "configuration": {
        "password": "",
        "role": "DEVELOPER",
        "warehouse": "MEDIUM_WH",
        "accountName": "thoughtspot_partner",
        "user": "tsadmin"
      }
    }
  },
  "deletedObjects": {
    "deleteStatus": "SUCCESS",
    "deleteFailTables": [],
    "deleteFailColumns": {}
  }
}

Response codes

HTTP status code Description

200

Successful update operation

401

Unauthorized or wrong credentials

500

Invalid parameters

Get a list of data connections

To get a list of data connections and their associated attributes, send a GET request to the /tspublic/v1/connection/types API endpoint.

Resource URL

GET /tspublic/v1/connection/types

Request parameters

None

Example request

cURL
curl -X GET \
--header 'Accept: application/json' \
--header 'X-Requested-By: ThoughtSpot' \
'https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/types'
Request URL
https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/types

Example response

[
  {
    "name": "RDBMS_SNOWFLAKE",
    "displayName": "Snowflake",
    "description": "",
    "mode": "PRODUCTION",
    "beta": false,
    "enabled": true
  },
  {
    "name": "RDBMS_REDSHIFT",
    "displayName": "Amazon Redshift",
    "description": "",
    "mode": "PRODUCTION",
    "beta": false,
    "enabled": true
  },
  {
    "name": "RDBMS_GCP_BIGQUERY",
    "displayName": "Google BigQuery",
    "description": "",
    "mode": "PRODUCTION",
    "beta": false,
    "enabled": true
  },
  {
    "name": "RDBMS_AZURE_SQL_DATAWAREHOUSE",
    "displayName": "Azure Synapse",
    "description": "",
    "mode": "PRODUCTION",
    "beta": false,
    "enabled": true
  },
  {
    "name": "RDBMS_PRESTO",
    "displayName": "Starburst",
    "description": "",
    "mode": "PRODUCTION",
    "beta": false,
    "enabled": true
  },
  {
    "name": "RDBMS_ORACLE_ADW",
    "displayName": "Oracle ADW",
    "description": "",
    "mode": "PRODUCTION",
    "beta": false,
    "enabled": true
  },
  {
    "name": "RDBMS_DATABRICKS",
    "displayName": "Databricks",
    "description": "",
    "mode": "PRODUCTION",
    "beta": false,
    "enabled": true
  }
]

Response codes

HTTP status code Description

200

Successful retrieval of connection types

401

Unauthorized or wrong credentials

500

No data connections set up on the cluster

Get a list of live query connections

To get a list of data connections that are set up as data sources for live query, send a GET request to the GET /tspublic/v1/connection/list API endpoint.

Resource URL

GET /tspublic/v1/connection/list

Request parameters

Query parameter Description

category Optional

String. Type of the live query object. Valid values are:

  • ALL

    Gets all live query objects set up on the cluster

  • MY

    Gets a list of live query objects that are set up on your cluster.

sort Optional

String. Sort order for the headers. Valid values are:

  • DEFAULT to use the default sort order in the response.

  • NAME to sort headers by the connection name.

  • DISPLAY_NAME to sort headers by the display name of the connections.

  • AUTHOR to sort the headers by the author who set up the live query connection.

  • CREATED to sort headers by the timestamp at which live query connections were set up.

  • MODIFIED to sort headers by the timestamp at which the live query connections were modified.

sortascending

Boolean. A flag to specify the sort order. A null value defines the default order.

  • To set an ascending order, specify true.

  • To set a descending order, specify false.

offset Optional

Integer. Batch offset to value to fetch page headers. The default value is -1, which implies first page.

batchsize Optional

Integer. Number of batches in which you want to fetch page headers in a single query. The default value is -1, which implies no pagination.

tagname Optional

Array of strings. A JSON array of tag names to filter response headers by tags. A tag is a label applied to a ThoughtSpot object.

pattern Optional

String. A pattern to match the name of the object. This parameter supports matching case-insensitive strings. For a wildcard match, use %.

Example request

cURL
curl -X GET \
--header 'Accept: application/json' \
--header 'X-Requested-By: ThoughtSpot' \
'https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/list'
Request URL
https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/list

Example response

{
  "headers": [
    {
      "id": "c1f17251-b2b1-4230-b10b-c81254d5189f",
      "indexVersion": 149,
      "generationNum": 149,
      "name": "test",
      "description": "",
      "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
      "authorName": "tsadmin",
      "authorDisplayName": "Administrator",
      "created": 1625126133409,
      "modified": 1625126133410,
      "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
      "owner": "c1f17251-b2b1-4230-b10b-c81254d5189f",
      "isDeleted": false,
      "isHidden": false,
      "statistics": {
        "dataLoadStatistics": {
          "scheduled": false,
          "connectionType": "",
          "connectionDisplayName": "",
          "dataLoadStatusList": [],
          "header": {
            "id": "c4831f2f-c0a2-498b-9ac5-98b8bd222058",
            "indexVersion": 149,
            "generationNum": 149,
            "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
            "owner": "c1f17251-b2b1-4230-b10b-c81254d5189f",
            "isDeleted": false,
            "isHidden": false,
            "tags": [],
            "isExternal": false,
            "isDeprecated": false
          },
          "complete": true,
          "incompleteDetail": []
        }
      },
      "tags": [],
      "type": "RDBMS_SNOWFLAKE",
      "isExternal": false,
      "isDeprecated": false
    },
    {
      "id": "55bf4728-bea1-4e89-ae29-822413660daf",
      "indexVersion": 328,
      "generationNum": 328,
      "name": "testsnow",
      "description": "",
      "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
      "authorName": "tsadmin",
      "authorDisplayName": "Administrator",
      "created": 1625139996582,
      "modified": 1625139996583,
      "modifiedBy": "59481331-ee53-42be-a548-bd87be6ddd4a",
      "owner": "55bf4728-bea1-4e89-ae29-822413660daf",
      "isDeleted": false,
      "isHidden": false,
      "statistics": {
        "dataLoadStatistics": {
          "scheduled": false,
          "connectionType": "",
          "connectionDisplayName": "",
          "dataLoadStatusList": [],
          "header": {
            "id": "179697ab-5212-4da8-9508-e0550b7b2327",
            "indexVersion": 328,
            "generationNum": 328,
            "author": "59481331-ee53-42be-a548-bd87be6ddd4a",
            "owner": "55bf4728-bea1-4e89-ae29-822413660daf",
            "isDeleted": false,
            "isHidden": false,
            "tags": [],
            "isExternal": false,
            "isDeprecated": false
          },
          "complete": true,
          "incompleteDetail": []
        }
      },
      "tags": [],
      "type": "RDBMS_SNOWFLAKE",
      "isExternal": false,
      "isDeprecated": false
    }
  ],
  "isLastBatch": true,
  "debugInfo": {}
}

Response codes

HTTP status code Description

200

Successful retrieval of live query connections list

401

Unauthorized or wrong credentials

500

No live query connections on the cluster

Export a connection map

To export the metadata of an active connection map, send a GET request to the /tspublic/v1/connection/export API.

Resource URL

GET /tspublic/v1/connection/export

Request parameters

Query parameter Description

id

String. The GUID of the data connection you want to export.

Example request

cURL
curl -X GET \
--header 'Accept: text/yaml' \
--header 'X-Requested-By: ThoughtSpot' 'https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/export?id=627c35cb-768d-45c7-b41d-346a2220cd82'
Request URL
https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/export?id=627c35cb-768d-45c7-b41d-346a2220cd82

Example response

If the specified GUID is valid and points to an existing data connection on your cluster, the API returns a YAML file containing the connection mapping data.

Click the link in the Response body to download the YAML file.

Response codes

HTTP status code Description

200

Successful export of the connection object

401

Unauthorized request or wrong credentials

500

Invalid connection ID

Delete a data connection

To delete a data connection, send a POST request to the /tspublic/v1/connection/delete API.

A connection can be used in multiple data sources or visualizations. If a data connection has dependent objects, make sure you remove its associations before running the delete operation.

Resource URL

POST /tspublic/v1/connection/delete

Request parameters

Form parameter Description

ids

Array of Strings. A JSON array of data connection GUIDs to delete.

Example request

cURL
curl -X POST \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'X-Requested-By: ThoughtSpot' \
-d 'ids=%5B%229114f105-fc9e-48c9-a8f1-57f2fda4f056%22%5D' \
'https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/delete'
Request URL
https://<ThoughtSpot-host>/callosum/v1/tspublic/v1/connection/delete

Example response

If the connection deletion is successful, the following response code is returned:

Response Code
204

Response codes

HTTP status code Description

204

Successful deletion of the connection object

401

Unauthorized or wrong credentials

500

The connection could not be deleted due to table dependencies