This page is the guide. For the field-by-field API reference of this endpoint, see the canonical Guest Token API reference — if the two ever disagree, the API reference wins.
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
Request Body
Guest tokens are free. There is no charge, metering, or purchase involved in generating them — mint as many as you need from your backend.
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 which dashboards a guest token can load, pass an allowlist of IDs inparams.allowedEmbeds.
When set, the token can only load an embed whose ID (the value you pass to the component’s dashboard-id/dashboardId attribute — an embed ID or dashboard ID both work) is included in the list. Loading any other ID fails with UNAUTHORIZED.
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
Error Codes:
At embed runtime (after minting), the distinct errors are
INVALID_TOKEN (token not found in this deployment), TOKEN_EXPIRED, UNAUTHORIZED_ORIGIN, UNAUTHORIZED, and INVALID_ID — see the Error Codes Reference.
