Embeds
Create a Dashboard Embed
Create a client dashboard embed from a blank dashboard, template, or imported dashboard data.
POST
Create a new client dashboard in your data app. Each client gets their own dashboard instance. Start with an empty dashboard, use
Use this endpoint for all new integrations. This is the recommended endpoint format.
templateDashboardId to clone filters and settings, or provide dashboard export data to import its content.
Supplying
templateDashboardId, importDashboardData, or importDashboardDataFile still creates a client end-user dashboard. To import a dashboard into your own workspace instead, use the Import Dashboard API with a service token.This endpoint creates a new empty dashboard. To embed an existing pre-built dashboard from your workspace, use the Embed a Pre-built Dashboard/Metric endpoint instead.
Endpoint Formats
- New Endpoint (Recommended)
- Legacy Endpoint (Deprecated Soon)
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
Supported values:
application/jsonfor pure JSON payloadsmultipart/form-datawhen uploading a dashboard export JSON file viaimportDashboardDataFile
When using
multipart/form-data, object/boolean/array fields (for example accessSettings, metadata, importDashboardData, isImportMetrics, isRenameDashboard, schemaPairs) can be sent as JSON strings. Databrain parses these before validation.importDashboardDataFile is a multipart file field (not a JSON body field). The uploaded file must be sent with MIME type application/json and contain a top-level data object.Request Body
Client ID for the dashboard owner. Used for multi-tenant isolation and row-level security.
Human-readable name for the embed configuration (optional). If not provided, the dashboard ID is used as the name. When
isRenameDashboard is true, this value is also used as the underlying dashboard’s display name.When
true and templateDashboardId is provided, metrics from the template dashboard are imported into the new dashboard (optional).Full dashboard configuration to import into the newly created client dashboard (optional). This should be the
data object from a dashboard export payload (for example, from the Export Dashboard API or the Export Embed Dashboard API). When importDashboardData is provided, Databrain skips templateDashboardId-based metric import and directly hydrates the new dashboard from this configuration.Optional JSON file upload alternative to
importDashboardData. Upload a dashboard export JSON file (the payload that contains a top-level data object). When provided, Databrain reads data from the file and uses it as importDashboardData.If both importDashboardData and importDashboardDataFile are provided, importDashboardDataFile takes precedence.When
true and name is provided, the created dashboard’s display name is set to name. When false or omitted, the dashboard name is set to {dashboardId}_{clientId} (optional). Defaults to false if omitted.When
isImportMetrics is true and templateDashboardId is provided, controls how metrics are imported: GALLERY or METRIC (optional).Optional. Same shape as Import Dashboard
schemaPairs: an array of objects; each object requires replaceSchema (string) and targetSchema (string). Use this when imported SQL references a schema name that should map to the target datamart schema.Typically used with importDashboardData or importDashboardDataFile. With multipart/form-data, send schemaPairs as a JSON-encoded string (see note above); the server parses it before Joi validation.Controls whether client-created metrics owned by a different client can be imported into this client dashboard (optional).
true: imports eligible metrics from another client and rebinds them to the destinationclientId.falseor omitted : skips metrics owned by another client. Admin-created metrics and metrics already owned by the destination client remain eligible.
Allow end users to update supported metrics. This does not allow them to edit Custom SQL metrics.
Optional. Enables end-user dashboard filter interactions in embedded mode. It does not allow end users to submit dashboard filter definitions containing Custom SQL.
Optional allowlist for dashboard filterable columns. Each item must include
tableName and columns.Optional. Enables end-user metric filter interactions in embedded mode. It does not allow end users to submit metric filter definitions containing Custom SQL.
Optional allowlist for columns that end users can use in metric filters. Each item must include
tableName and columns.Recommended join strategy for table relationships.
single: single worksheet mode (tables are pre-joined into one worksheet)multi: multi-sheet mode (joins are resolved dynamically based on fields used in each chart)
List of allowed tables and client columns for table tenancy (optional). When provided, each item must include
name and clientColumn.Client-level column for table tenancy. Required when the parent
tableTenancySettings array is provided.Dashboard import formats
This endpoint supports two import formats:
For JSON requests, pass the exported dashboard’s
data object as importDashboardData. For multipart requests, upload the complete export JSON file, including its top-level data object, as importDashboardDataFile. If both fields are supplied, the uploaded file takes precedence.
Client scope during import
The destinationclientId determines the client scope of an imported client dashboard.
Dashboard cards, fullscreen data, underlying data, CSV and raw-data downloads, and dashboard downloads all use the same destination-client scope. Imported client dashboards require client-scoped dashboard and metric filter options. Databrain hides automatic system client filters from users while keeping ordinary user-created filters visible and editable when permitted.
Response
The name of the embed configuration. Matches the request body
name if provided, otherwise the dashboardId. Returned by the new endpoint (/api/v2/data-app/dashboard-embeds); the legacy endpoint returns only id and error.HTTP Status Code Summary
Possible Errors
Quick Start Guide
1
Get your API token
For detailed instructions, see the API Token guide.
2
Create a new dashboard for your client
Make a POST request with the required parameters:
3
(Optional) Use a template
To clone settings from an existing dashboard, add
templateDashboardId. To also import metrics from the template, set isImportMetrics: true and optionally metricImportMode to "GALLERY" or "METRIC". To use a custom display name for the dashboard (instead of {dashboardId}_{clientId}), set name and isRenameDashboard: true:4
Generate a guest token
Use the created dashboard ID to generate a guest token for your end users. See the Guest Token API for details.
5
Embed in your application
Use the dashboard ID and guest token in your web component:
Use Cases
Multi-Tenant SaaS
Create isolated dashboards for each customer in your SaaS application.
Template-Based Creation
Use
templateDashboardId to clone filters and settings from a master template.Custom Dashboard Names
Set
isRenameDashboard: true with name to give each client dashboard a human-readable display name instead of {dashboardId}_{clientId}.Dynamic Provisioning
Automatically create dashboards during customer onboarding or upgrades.
Client Isolation
Ensure data isolation with
clientId and row-level security settings.Next Steps
Generate Guest Token
Create secure tokens to access your new dashboard
Embed a Pre-built Dashboard/Metric
Embed existing dashboards that were built in the databrain platform
How to Embed
Integrate dashboards into your application
Multi-Tenant Access Control
Set up row-level security for your dashboards

