API
automate as much as you like
Last updated
automate as much as you like
Last updated
All API endpoints can be accessed via an API token that is tied to the permissions of a user account. You can also let them expire after some time.
Go to Settings / Users
Click Create New Token
Enter a name, description, and expiration period
Copy the token (it's only shown once)
You have two ways. You either pass the token as a header with API-KEY
or you pass it as a url parameter in api_token
. As a header is usually more secure because automated loggers don't store them, but in some places you can't set headers (e.g. dbt webhooks) and then you can use the URL parameter.
Call the user endpoint via command line interface.
# Basic API request with token
curl -H "API-KEY: dot-your_token_here" <https://[app or eu].getdot.ai/api/auth/me>
Call the user endpoint via Python.
import requests
headers = {"API-KEY": "dot-your_token_here"}
response = requests.get("https://[app or eu].getdot.ai/api/auth/me", headers=headers)
For the following endpoints you can also use a URL based authentication:
Sync connection
Import external asserts
Export conversation history
Call the endpoint only via url:
curl "https://{region}.getdot.ai/api/sync/{connection_type}/{connection_type}" \
"?user_id={user}&api_token={api_token}"
To keep Dot in sync with your production environment, it is recommended to trigger the following API endpoint
// URL endpoint
https://{region}.getdot.ai/api/sync/{connection_type}/{connection_type}?user_id={user}&api_token={api_token}
Region: app
(US) or eu
(EU)
Connection Type: postgres
, redshift
, snowflake
, mssql
, bigquery
, databricks
, looker
, dbt
User ID: usually email of the user (url encoded)
API Token: can get created (and overwritten) by clicking Copy API Token
in Settings/Users/Actions/···
Trigger with curl (CLI)
curl -X "POST" "https://eu.getdot.ai/api/sync/bigquery/my-bg-id?user_id=sync_user%40contoso.com&api_token=dot-42673584be9724a21e1550336d6fe509f4a04207461ec9a926ca2a27cbd27fa0
Trigger with dbt webhooks
Call the api endpoint after your dbt run completed.
Inform Dot about key external knowledge assets, such as BI dashboards or custom data apps, so it can recommend them to users and assist with discovery and understanding. Authentication works similarly to the Sync Connection endpoint.
Export all conversations together with relevant meta data fields such as number of messages or author.
Once you created your token, you can use all API endpoints. Here is selection of frequently used endpoints and some examples on how the API got used.
Trigger Deep Analysis
For embedded use cases that require SSO, where your end users have individual permissions you can use this endpoint to obtain an access token for users that is valid for 24h. Here is an example on how you can use it to embed Dot in your application.
Please make sure that you enabled this flag on settings: "Allow admins to authenticate for users to enable SSO in embeds".
POST /api/sync/{connection_type}/{connection_id} HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Accept: */*
No content
by default two weeks ago, format YYYY-MM-DD
by default tomorrow, format YYYY-MM-DD
GET /api/export_history HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Accept: */*
No content
POST /api/import_and_overwrite_external_asset HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 193
{
"external_asset": {
"id": "text",
"subtype": "text",
"folder": "text",
"name": "text",
"description": "text",
"url": "text",
"active": true,
"view_count": 0,
"last_accessed_at": "text",
"dot_description": "text"
}
}
No content
""
POST /api/ask HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 81
{
"messages": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"chat_id": "text",
"scope": ""
}
No content
POST /api/ask_with_history HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 71
{
"new_message": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"chat_id": "text"
}
No content
POST /api/agentic HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 70
{
"messages": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
],
"chat_id": "text"
}
No content
POST /api/send_invitations HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"emails": [
"text"
]
}
No content
POST /api/delete_user HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"email": "text"
}
No content
POST /api/change_user_role HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 30
{
"email": "text",
"role": "text"
}
No content
POST /api/add_user_to_group HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 31
{
"email": "text",
"group": "text"
}
No content
POST /api/remove_user_from_group HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 31
{
"email": "text",
"group": "text"
}
No content
POST /api/create_user HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"email": "text",
"password": "text",
"realname": "text"
}
No content
false
POST /api/auth/embedded_user_login HTTP/1.1
Host:
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 65
{
"user_id": "text",
"create_if_not_exists": false,
"groups": [
"text"
]
}
No content