API Tokens
Create API Token for Data App
Generate a new API token for a specific Data App to enable embed operations.
POST
Create a new API token for a Data App. API tokens are used to authenticate requests for embed operations such as creating embeds, generating guest tokens, and querying metrics.Documentation Index
Fetch the complete documentation index at: https://docs.usedatabrain.com/llms.txt
Use this file to discover all available pages before exploring further.
Each Data App can have multiple API tokens. This is useful for:
- Separating tokens by environment (development, staging, production)
- Rotating tokens without service interruption
- Tracking API usage by token
Endpoint Formats
- New Endpoint (Recommended)
- Legacy Endpoint (Deprecated Soon)
Authentication
This endpoint requires a service token in the Authorization header. Service tokens differ from data app API keys and provide organization-level permissions. To access your service token:- In Settings page, navigate to the Service Tokens section.
- Click the “Generate Token” button to create a new service token if you don’t have one already.
Headers
Bearer token for API authentication. Use your service token (not data app API key).
Must be set to
application/json for all requests.Request Body
The name of the Data App to create the API token for. This must exactly match an existing Data App name.
A descriptive name/label for the API token. This helps identify the token’s purpose.
Response
The newly generated API token (UUID format). Store this securely as it will be used for all embed operations.
Error object returned only when the request fails. Not included in successful responses.
Examples
HTTP Status Code Summary
| Status Code | Description |
|---|---|
200 | OK - API token created successfully |
400 | Bad Request - Invalid request parameters |
500 | Internal Server Error - Server error occurred |
Possible Errors
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid dataAppName or name |
DATA_APP_NOT_FOUND | 400 | Data App with given name not found |
AUTHENTICATION_ERROR | 400 | Invalid or missing service token |
INTERNAL_SERVER_ERROR | 500 | Server error |
API Token Scope
When an API token is created, it is automatically assigned the following scope:- Access Metrics - Query and retrieve metric data
- Access Dashboards - Access and embed dashboards
Quick Start Guide
Get your service token
In Settings page, navigate to the Service Tokens section. Click the “Generate Token” button to create a new service token if you don’t have one already.
Verify the Data App exists
Use the List Data Apps API to confirm the Data App exists:
Store the API key securely
The response contains the API key. Store it securely as it won’t be shown again:
Best Practices
Store Keys Securely
Never commit API keys to version control. Use environment variables or secrets managers.
Use Descriptive Names
Name tokens clearly (e.g., “Production API Key”, “Dev Environment Token”)
Rotate Regularly
Rotate API keys periodically for enhanced security using the Rotate API Key endpoint.
Separate by Environment
Create separate tokens for development, staging, and production environments.
Next Steps
List API Tokens
View all API tokens for a Data App
Rotate API Key
Rotate API keys for enhanced security
Create Embed
Use your API token to create embed configurations
Generate Guest Token
Generate guest tokens for your end users

