To obtain a guest token from DataBrain, utilize our REST API from your backend system. Each request will generate a unique guest token, ensuring security and flexibility. Once you acquire the guest token, you can seamlessly pass it to your frontend application, where it can be integrated with the web component.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.
Create API key from Databrain's dashboard that should be passed in the headers in these requests.Guest tokens are designed for frontend embedding. Never expose your API key in frontend code — always generate tokens from your backend.
Quick start (simple use case):
When you need a guest token that you want to use across dashboards and metrics, all you have to do is passclientId, dataAppName. If expiryTime is not passed, the token will not expire.
Cloud Databrain Endpoint:
Self-hosted Databrain Endpoint:
Headers
| Name | Type | Description |
|---|---|---|
| Authorization* | String | Bearer API TOKEN |
| Content-Type* | String | Must be set to application/json for all requests |
Request Body
| Name | Type | Description |
|---|---|---|
| dataAppName* | String | Your Data App Name |
| clientId* | String | Client ID for whom this guest token is generated. ("clientId": "None" if no tenancy selected) |
| params | Object | Additional Params: allowedEmbeds, dashboardAppFilters, appFilters, hideDashboardFilters, userIdentifier, timezone |
| expiryTime | Number | In milliseconds. Common values: 3600000 (1 hour), 86400000 (24 hours), 604800000 (7 days) |
| datasourceName | String | Datasource name from Data Studio (important in case of multi-datasource embed setup) |
Request Body Examples:
Simple Request Body:
Request Body with App Level Metric Filter:
App filter
A metric level filter designed specifically for controlling access to individual metrics. Unlike general RLS settings, it restricts access without requiring end user input or control.
Request.json
Dashboard App Filters:
Request Body with Dashboard filters:
"name", "country", "timePeriod", and "price" are Dashboard App filters.When you disable the
isShowOnUrl, the filter will not be visible to end users as search params on URL.
Datasource [Multi Datasource connection]:
datasourceName is available in app data studio tab.
Hide Dashboard Filters:
To hide dashboard filters in an embedded dashboard:Allowed Embeds (optional)
To restrict where a guest token can be used, pass an allowlist of embed IDs inparams.allowedEmbeds.
When set, the token will only be able to load embedded dashboards whose dashboardId is included in that list.
Dashboard Permissions
To enable or disable few dashboard permissions from backend:User Identifier for Private & Publish Metrics
UseuserIdentifier inside the params object to uniquely identify the end-user in your embedded dashboard.This enables features such as creating private metrics and publishing metrics directly from the embed view.
isAllowPrivateMetricsByDefault should be enabled while creating the dashboard.
Timezone
Usetimezone inside the params object to specify an IANA timezone string for timezone-aware queries and date/time formatting. When provided, SQL queries will be executed with this timezone setting, ensuring consistent date/time handling across different timezones.
Supported Datasources: Clickhouse, Trino, Redshift, CockroachDB, Postgres, MSSQL
Common timezone values: "UTC", "America/New_York", "America/Los_Angeles", "Europe/London", "Asia/Kolkata", "Australia/Sydney"
Code Examples
HTTP Status Codes
| Status Code | Description |
|---|---|
200 | OK - Request succeeded |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - Access denied to resource |
404 | Not Found - Resource not found |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error occurred |
Error Codes:
| Error Code | HTTP Status | Description |
|---|---|---|
AUTHENTICATION_ERROR | 401 | Invalid or missing API key |
INVALID_REQUEST_BODY | 400 | Missing or invalid parameters |
CLIENT_ID_ERROR | 400 | Invalid clientId format or value |
DATA_APP_ID_ERROR | 404 | Data app not found |
WORKSPACE_ID_ERROR | 404 | Workspace not found or inaccessible |
DASHBOARD_PARAM_ERROR | 400 | Invalid dashboard filter parameters |
APP_FILTER_PARAM_ERROR | 400 | Invalid app filter configuration |
RLS_SETTINGS_PARAM_ERROR | 400 | Invalid RLS settings |
RATE_LIMIT_EXCEEDED | 429 | Too many requests |
INTERNAL_SERVER_ERROR | 500 | Server error |
INVALID_PERMISSIONS | 403 | Invalid permission settings |
EXPIRED_TOKEN | 401 | Token has expired |

