> For the complete documentation index, see [llms.txt](https://docs.getdot.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getdot.ai/developers/api/commonly-used-endpoints.md).

# Commonly used Endpoints

## Automatically Sync Dot

To keep Dot in sync with your production environment, it is recommended to trigger the following API endpoint

## POST /api/sync/{connection\_type}/{connection\_id}

> Sync connection with an API token.

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]},{"QueryTokenAuth":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}},"QueryTokenAuth":{"type":"apiKey","in":"query","name":"user_id+api_token"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/sync/{connection_type}/{connection_id}":{"post":{"tags":["Connections"],"summary":"Sync connection with an API token.","operationId":"sync_connection_api_sync__connection_type___connection_id__post","parameters":[{"name":"connection_type","in":"path","required":true,"schema":{"type":"string","title":"Connection Type"}},{"name":"connection_id","in":"path","required":true,"schema":{"type":"string","title":"Connection Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

```javascript
// URL endpoint
https://{region}.getdot.ai/api/sync/{connection_type}/{connection_id}?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)](https://www.urlencoder.io/)
* **API Token**: can get created (and overwritten) by clicking `Copy API Token` in Settings/Users/Actions/···

\
**Trigger with curl (CLI)**

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

{% embed url="<https://docs.getdbt.com/docs/deploy/webhooks#create-a-webhook-subscription>" %}
Documentation how to setup a dbt webhooks
{% endembed %}

## Import External Assets

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.

## POST /api/import\_and\_overwrite\_external\_asset

> Import and overwrite an external asset with an API token.

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]},{"QueryTokenAuth":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}},"QueryTokenAuth":{"type":"apiKey","in":"query","name":"user_id+api_token"}},"schemas":{"Body_import_external_asset_api_import_and_overwrite_external_asset_post":{"properties":{"external_asset":{"$ref":"#/components/schemas/ExternalAsset"}},"type":"object","required":["external_asset"],"title":"Body_import_external_asset_api_import_and_overwrite_external_asset_post"},"ExternalAsset":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for the external asset."},"subtype":{"type":"string","title":"Subtype","description":"Subtype of the external asset, such as 'looker_dashboard'."},"folder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder","description":"Folder path where the external asset is stored."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"The name of the external asset."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description of the external asset."},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Full URL of the external asset."},"active":{"type":"boolean","title":"Active","description":"Indicates if the external asset is active.","default":true},"view_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"View Count","description":"Number of times the external asset has been viewed.","default":0},"last_accessed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Accessed At","description":"Timestamp of the last access to the external asset."},"dot_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dot Description","description":"Formatted text description of the external asset, can e.g. include a markdown representation of all charts in a dashboard."}},"type":"object","required":["id","subtype"],"title":"ExternalAsset"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/import_and_overwrite_external_asset":{"post":{"tags":["Assets"],"summary":"Import and overwrite an external asset with an API token.","operationId":"import_external_asset_api_import_and_overwrite_external_asset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_import_external_asset_api_import_and_overwrite_external_asset_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Export Conversation History

Export all conversations together with relevant meta data fields such as number of messages or author.

## GET /api/export\_history

> Get all historical chat messages.

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]},{"QueryTokenAuth":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}},"QueryTokenAuth":{"type":"apiKey","in":"query","name":"user_id+api_token"}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/export_history":{"get":{"tags":["Admin"],"summary":"Get all historical chat messages.","operationId":"export_history_api_export_history_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"type":"string","description":"by default two weeks ago, format YYYY-MM-DD","title":"Start Date"},"description":"by default two weeks ago, format YYYY-MM-DD"},{"name":"end_date","in":"query","required":false,"schema":{"type":"string","description":"by default tomorrow, format YYYY-MM-DD","title":"End Date"},"description":"by default tomorrow, format YYYY-MM-DD"},{"name":"include_all_workspaces","in":"query","required":false,"schema":{"type":"boolean","description":"Include history from all workspaces (main workspace only)","default":false,"title":"Include All Workspaces"},"description":"Include history from all workspaces (main workspace only)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Ask Dot Automatically

`/api/agentic` is how you ask Dot anything. It is the same engine behind the app, Slack and Teams: Dot reads your model, writes and runs SQL, builds charts, and keeps going until it can answer. A one-line lookup and a multi-step investigation use this one endpoint — Dot decides how far to go.

Send a question with a `chat_id` you generate. The call returns the conversation once Dot has finished.

## POST /api/agentic

> Agentic

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}},"schemas":{"Body_agentic_api_agentic_post":{"properties":{"messages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Messages"},"chat_id":{"type":"string","title":"Chat Id"},"skip_check":{"type":"boolean","title":"Skip Check","default":false},"extra":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extra"}},"type":"object","required":["messages","chat_id"],"title":"Body_agentic_api_agentic_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/agentic":{"post":{"tags":["Chat"],"summary":"Agentic","operationId":"agentic_api_agentic_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_agentic_api_agentic_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

Follow up by posting to `/api/agentic_with_history` with the same `chat_id`, so Dot keeps the context of everything already asked.

Both take an optional `mode` — `economy`, `balanced` or `frontier` — the same dial as the [energy mode](/using-dot/analyze.md#energy-modes) selector in the app. Left out, your workspace default applies.

To ask against an [environment](/train-dot/environments.md) instead of production, send its id in the `X-Dot-Environment` header. That works on every endpoint on this page, not just these two.

The answer sits in the last message carrying a `formatted_result`: a list of parts, of which the `text` ones joined together are what a person reads. A long investigation can outlast the request, so fetch it later with `GET /api/c2/{chat_id}` using the same `chat_id`. There is a [worked example](/developers/api/use-cases-and-scripts.md) of both.

## User Administration

## GET /api/get\_users

> Get All Users

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}}},"paths":{"/api/get_users":{"get":{"tags":["Admin"],"summary":"Get All Users","operationId":"get_all_users_api_get_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}}}
```

## POST /api/send\_invitations

> Sendinvitations

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}},"schemas":{"Body_sendInvitations_api_send_invitations_post":{"properties":{"emails":{"items":{"type":"string"},"type":"array","title":"Emails"}},"type":"object","required":["emails"],"title":"Body_sendInvitations_api_send_invitations_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/send_invitations":{"post":{"tags":["Admin"],"summary":"Sendinvitations","operationId":"sendInvitations_api_send_invitations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_sendInvitations_api_send_invitations_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## POST /api/delete\_user

> Delete User Route

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}},"schemas":{"Body_delete_user_route_api_delete_user_post":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"Body_delete_user_route_api_delete_user_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/delete_user":{"post":{"tags":["Admin"],"summary":"Delete User Route","operationId":"delete_user_route_api_delete_user_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_delete_user_route_api_delete_user_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## POST /api/change\_user\_role

> Change User Role

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}},"schemas":{"Body_change_user_role_api_change_user_role_post":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"}},"type":"object","required":["email","role"],"title":"Body_change_user_role_api_change_user_role_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/change_user_role":{"post":{"tags":["Admin"],"summary":"Change User Role","operationId":"change_user_role_api_change_user_role_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_change_user_role_api_change_user_role_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## POST /api/add\_user\_to\_group

> Add User To Group

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}},"schemas":{"Body_add_user_to_group_api_add_user_to_group_post":{"properties":{"email":{"type":"string","title":"Email"},"group":{"type":"string","title":"Group"}},"type":"object","required":["email","group"],"title":"Body_add_user_to_group_api_add_user_to_group_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/add_user_to_group":{"post":{"tags":["Admin"],"summary":"Add User To Group","operationId":"add_user_to_group_api_add_user_to_group_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_add_user_to_group_api_add_user_to_group_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## POST /api/remove\_user\_from\_group

> Remove User From Group

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}},"schemas":{"Body_remove_user_from_group_api_remove_user_from_group_post":{"properties":{"email":{"type":"string","title":"Email"},"group":{"type":"string","title":"Group"}},"type":"object","required":["email","group"],"title":"Body_remove_user_from_group_api_remove_user_from_group_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/remove_user_from_group":{"post":{"tags":["Admin"],"summary":"Remove User From Group","operationId":"remove_user_from_group_api_remove_user_from_group_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_remove_user_from_group_api_remove_user_from_group_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## POST /api/create\_user

> Create User Route

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}},"schemas":{"Body_create_user_route_api_create_user_post":{"properties":{"email":{"type":"string","title":"Email"},"password":{"type":"string","title":"Password"},"realname":{"type":"string","title":"Realname"}},"type":"object","required":["email","password","realname"],"title":"Body_create_user_route_api_create_user_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/create_user":{"post":{"tags":["Admin"],"summary":"Create User Route","operationId":"create_user_route_api_create_user_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_create_user_route_api_create_user_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Automatically Authenticate Embedded Users

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](/developers/embed.md) 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/auth/embedded\_user\_login

> Get Embedded User Login Token

```json
{"openapi":"3.1.0","info":{"title":"Dot API","version":"1.0.0"},"security":[{"APIKeyHeader":[]},{"APIKeyHeader":[]},{"APIKeyCookie":[]},{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-KEY"},"APIKeyCookie":{"type":"apiKey","in":"cookie","name":"Authorization"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/auth/token"}}}},"schemas":{"Body_get_embedded_user_login_token_api_auth_embedded_user_login_post":{"properties":{"user_id":{"type":"string","title":"User Id"},"create_if_not_exists":{"type":"boolean","title":"Create If Not Exists","default":false},"groups":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Groups"}},"type":"object","required":["user_id"],"title":"Body_get_embedded_user_login_token_api_auth_embedded_user_login_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/api/auth/embedded_user_login":{"post":{"tags":["Authentication"],"summary":"Get Embedded User Login Token","operationId":"get_embedded_user_login_token_api_auth_embedded_user_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_get_embedded_user_login_token_api_auth_embedded_user_login_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```
