Embeds
Create an Empty Dashboard Embed
Create a new empty dashboard for multi-tenant scenarios where each client gets their own blank canvas.
POST
Create a new empty dashboard in your data app. This endpoint is designed for multi-tenant scenarios where each client needs their own dashboard instance to build upon. Use
Use this endpoint for all new integrations. This is the recommended endpoint format.
templateDashboardId to clone filters and settings from an existing dashboard.
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
Bearer token for API authentication. Use your API key from the data app.
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
Unique identifier for the new dashboard. Must be unique within the data app.
The name of the workspace where the dashboard will be created.
Client ID for the dashboard owner. Used for multi-tenant isolation and row-level security.
Dashboard ID to clone filters, grid margins, and layout settings from (optional).
Custom metadata for the dashboard (optional).
Allow users to create private metrics visible only to them (optional).
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.Description for the embed configuration (optional).
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.Access control settings for the dashboard.
The datamart name used in the embedded environment.
Allow AI Pilot features (optional).
Allow sending email reports.
Allow managing metrics.
Allow metric creation.
Allow metric deletion.
Allow layout changes to metrics.
Allow updating metrics.
Allow viewing of underlying data.
Allow creating dashboard views.
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)
Legacy join strategy flag. Prefer using
accessSettings.joinModel instead.Mode of metric creation (drag and drop or chat).
List of allowed tables and client columns for table tenancy (optional). When provided, each item must include
name and clientColumn.Table name. Required when the parent
tableTenancySettings array is provided.Client-level column for table tenancy. Required when the parent
tableTenancySettings array is provided.Response
The ID of the created dashboard embed configuration.
Error object if the request failed, otherwise
null.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
| Status Code | Description |
|---|---|
200 | OK - Dashboard created successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing API key |
500 | Internal Server Error - Server error occurred |
Possible Errors
| Code | Message | HTTP Status |
|---|---|---|
INVALID_REQUEST_BODY | Request body validation failed | 400 |
WORKSPACE_ID_ERROR | Invalid workspace name | 400 |
INVALID_DATA_APP_API_KEY | Invalid Data App API key | 401 |
CLIENT_ID_ERROR | Invalid client id | 400 |
INVALID_DASHBOARD_ID | Dashboard already exists | 400 |
TEMPLATE_DASHBOARD_ERROR | Invalid template dashboard id | 400 |
INVALID_DASHBOARD_DATA | Uploaded JSON missing data | 400 |
DASHBOARD_CREATE_ERROR | Failed to create client dashboard | 400 or 500 |
INTERNAL_SERVER_ERROR | Internal server error | 500 |
Quick Start Guide
Get your API token
For detailed instructions, see the API Token guide.
(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: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.
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

