Guest tokens are designed for frontend embedding. Never expose your API key in frontend code - always generate tokens from your backend.
Simple Usage: Only
clientId
and dataAppName
are required. All other parameters (params
, permissions
, expiryTime
) are optional for advanced use cases.Authentication
All API requests must include your API key in the Authorization header. Get your API token when creating a data app - see our data app creation guide for details. Finding your API token: For detailed instructions, see the API Token guide.Headers
Bearer token for API authentication. Use your API key from the data app.
Must be set to
application/json
for all requests.Request Body
Unique identifier for the end user. This should be your user’s ID from your system. Used for row-level security and access control.
The name of your data application. Must match an existing data app in your workspace and be alphanumeric.
Additional parameters for token customization and filtering.
Dashboard-level filters that apply to all metrics on a dashboard.
The dashboard ID to apply filters to. Required if dashboardAppFilters is provided.
Filter values to apply to the dashboard. Required if dashboardAppFilters is provided.
Whether to show these filters in the URL parameters.
Array of filter names to hide from the dashboard interface.
Example
Permission settings for the embedded interface.
Allow archiving metrics.
Allow managing metrics (view, edit, organize).
Allow creating custom dashboard views.
Allow updating metric configurations.
Allow customizing dashboard layout.
Allow viewing underlying data behind charts.
Allow downloading metric data.
Show the sidebar navigation.
Show the dashboard name in the interface.
Token expiration time in milliseconds from now. If not provided, token never expires.
Response
UUID token for authentication. Pass this to your frontend component for embedding.
Error object if the request failed, otherwise
null
for successful requests.Error Codes
Invalid API key - Check your API key in dashboard settings
Missing or invalid parameters - Verify all required fields are provided with correct types
Invalid data app - The specified dataAppName doesn’t exist or you don’t have access
Server error - Contact support if error persists
HTTP Status Code Summary
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 |
Possible Errors
Error Code | HTTP Status | Description | Solution |
---|---|---|---|
AUTHENTICATION_ERROR | 401 | Invalid or missing API key | Verify your API key is correct and included in Authorization header |
INVALID_REQUEST_BODY | 400 | Missing or invalid parameters | Check all required fields are provided with correct data types |
DATA_APP_ID_ERROR | 404 | Data app not found | Verify the dataAppName exists and you have access |
RATE_LIMIT_EXCEEDED | 429 | Too many requests | Implement exponential backoff and retry logic |
INTERNAL_SERVER_ERROR | 500 | Server error | Contact support if error persists |
INVALID_CLIENT_ID | 400 | Invalid clientId format | Use alphanumeric characters for clientId |
EXPIRED_TOKEN | 401 | Token has expired | Generate a new token |
INVALID_PERMISSIONS | 403 | Invalid permission settings | Check permission object structure |
Quick Start Guide
1
Get your API token
For detailed instructions, see the API Token guide.
2
Create a guest token
Make a POST request to generate a token for your user:
3
Use the token in your frontend
Pass the returned token to your DataBrain component:
Rate Limiting: API requests are limited to prevent abuse. Implement exponential backoff for rate limited requests (429 status).