Skip to main content
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/data-app/dashboard-embeds \
  --header 'Authorization: Bearer dbn_live_abc123...' \
  --header 'Content-Type: application/json' \
  --data '{
    "dashboardId": "client-acme-dashboard",
    "workspaceName": "analytics-workspace",
    "clientId": "acme-corp-123",
    "templateDashboardId": "template-dashboard-001",
    "metadata": {
      "clientName": "Acme Corporation",
      "region": "North America"
    },
    "isAllowPrivateMetricsByDefault": false,
    "name": "ACME Analytics Dashboard",
    "embedDescription": "Analytics dashboard for ACME Corp",
    "isImportMetrics": true,
    "isRenameDashboard": true,
    "metricImportMode": "GALLERY",
    "importDashboardData": {
      "...": "dashboard configuration exported from the Export Dashboard or Export Embed Dashboard API"
    },
    "accessSettings": {
      "datamartName": "customer-analytics",
      "isAllowEmailReports": false,
      "isAllowManageMetrics": true,
      "isAllowMetricCreation": true,
      "isAllowMetricDeletion": false,
      "isAllowMetricLayoutChange": true,
      "isAllowMetricUpdate": true,
      "isAllowUnderlyingData": false,
      "isAllowCreateDashboardView": true,
      "joinModel": "multi",
      "metricCreationMode": "DRAG_DROP",
      "tableTenancySettings": [
        {
          "name": "sales_data",
          "clientColumn": "customer_id"
        }
      ]
    }
  }'
{
  "id": "client-acme-dashboard",
  "error": null,
  "name": "ACME Analytics Dashboard"
}
POST
/
api
/
v2
/
data-app
/
dashboard-embeds
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/data-app/dashboard-embeds \
  --header 'Authorization: Bearer dbn_live_abc123...' \
  --header 'Content-Type: application/json' \
  --data '{
    "dashboardId": "client-acme-dashboard",
    "workspaceName": "analytics-workspace",
    "clientId": "acme-corp-123",
    "templateDashboardId": "template-dashboard-001",
    "metadata": {
      "clientName": "Acme Corporation",
      "region": "North America"
    },
    "isAllowPrivateMetricsByDefault": false,
    "name": "ACME Analytics Dashboard",
    "embedDescription": "Analytics dashboard for ACME Corp",
    "isImportMetrics": true,
    "isRenameDashboard": true,
    "metricImportMode": "GALLERY",
    "importDashboardData": {
      "...": "dashboard configuration exported from the Export Dashboard or Export Embed Dashboard API"
    },
    "accessSettings": {
      "datamartName": "customer-analytics",
      "isAllowEmailReports": false,
      "isAllowManageMetrics": true,
      "isAllowMetricCreation": true,
      "isAllowMetricDeletion": false,
      "isAllowMetricLayoutChange": true,
      "isAllowMetricUpdate": true,
      "isAllowUnderlyingData": false,
      "isAllowCreateDashboardView": true,
      "joinModel": "multi",
      "metricCreationMode": "DRAG_DROP",
      "tableTenancySettings": [
        {
          "name": "sales_data",
          "clientColumn": "customer_id"
        }
      ]
    }
  }'
{
  "id": "client-acme-dashboard",
  "error": null,
  "name": "ACME Analytics Dashboard"
}
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 templateDashboardId to clone filters and settings from an existing dashboard.
Endpoint Migration Notice: We’re transitioning to kebab-case endpoints. The new endpoint is /api/v2/data-app/dashboard-embeds. The old endpoint /api/v2/dataApp/dashboard-embeds will be deprecated soon. Please update your integrations to use the new endpoint format.
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

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

Authorization
string
required
Bearer token for API authentication. Use your API key from the data app.
Authorization: Bearer dbn_live_abc123...
Content-Type
string
required
Supported values:
  • application/json for pure JSON payloads
  • multipart/form-data when uploading a dashboard export JSON file via importDashboardDataFile
Content-Type: application/json
When using multipart/form-data, object/boolean fields (for example accessSettings, metadata, isImportMetrics, isRenameDashboard) 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

dashboardId
string
required
Unique identifier for the new dashboard. Must be unique within the data app.
workspaceName
string
required
The name of the workspace where the dashboard will be created.
clientId
string
required
Client ID for the dashboard owner. Used for multi-tenant isolation and row-level security.
templateDashboardId
string
Dashboard ID to clone filters, grid margins, and layout settings from (optional).
metadata
object
Custom metadata for the dashboard (optional).
isAllowPrivateMetricsByDefault
boolean
Allow users to create private metrics visible only to them (optional).
name
string
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.
embedDescription
string
Description for the embed configuration (optional).
isImportMetrics
boolean
When true and templateDashboardId is provided, metrics from the template dashboard are imported into the new dashboard (optional).
importDashboardData
object
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.
importDashboardDataFile
file (.json)
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.
isRenameDashboard
boolean
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.
metricImportMode
'GALLERY' | 'METRIC'
When isImportMetrics is true and templateDashboardId is provided, controls how metrics are imported: GALLERY or METRIC (optional).
accessSettings
object
required
Access control settings for the dashboard.
accessSettings.datamartName
string
required
The datamart name used in the embedded environment.
accessSettings.isAllowAiPilot
boolean
Allow AI Pilot features (optional).
accessSettings.isAllowEmailReports
boolean
required
Allow sending email reports.
accessSettings.isAllowManageMetrics
boolean
required
Allow managing metrics.
accessSettings.isAllowMetricCreation
boolean
required
Allow metric creation.
accessSettings.isAllowMetricDeletion
boolean
required
Allow metric deletion.
accessSettings.isAllowMetricLayoutChange
boolean
required
Allow layout changes to metrics.
accessSettings.isAllowMetricUpdate
boolean
required
Allow updating metrics.
accessSettings.isAllowUnderlyingData
boolean
required
Allow viewing of underlying data.
accessSettings.isAllowCreateDashboardView
boolean
required
Allow creating dashboard views.
accessSettings.joinModel
'single' | 'multi'
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)
accessSettings.isIncrementalJoin
boolean
Legacy join strategy flag. Prefer using accessSettings.joinModel instead.
accessSettings.metricCreationMode
'DRAG_DROP' | 'CHAT'
required
Mode of metric creation (drag and drop or chat).
accessSettings.tableTenancySettings
array
List of allowed tables and client columns for table tenancy (optional). When provided, each item must include name and clientColumn.
accessSettings.tableTenancySettings[].name
string
Table name. Required when the parent tableTenancySettings array is provided.
accessSettings.tableTenancySettings[].clientColumn
string
Client-level column for table tenancy. Required when the parent tableTenancySettings array is provided.

Response

id
string
The ID of the created dashboard embed configuration.
error
null | object
Error object if the request failed, otherwise null.
name
string
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 CodeDescription
200OK - Dashboard created successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing API key
500Internal Server Error - Server error occurred

Possible Errors

CodeMessageHTTP Status
INVALID_REQUEST_BODYRequest body validation failed400
WORKSPACE_ID_ERRORInvalid workspace name400
INVALID_DATA_APP_API_KEYInvalid Data App API key401
CLIENT_ID_ERRORInvalid client id400
INVALID_DASHBOARD_IDDashboard already exists400
TEMPLATE_DASHBOARD_ERRORInvalid template dashboard id400
INVALID_DASHBOARD_DATAUploaded JSON missing data400
DASHBOARD_CREATE_ERRORFailed to create client dashboard400 or 500
INTERNAL_SERVER_ERRORInternal server error500

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:
curl --request POST \
  --url https://api.usedatabrain.com/api/v2/data-app/dashboard-embeds \
  --header 'Authorization: Bearer dbn_live_abc123...' \
  --header 'Content-Type: application/json' \
  --data '{
    "dashboardId": "client-acme-analytics",
    "clientId": "acme-corp-123",
    "workspaceName": "my-workspace",
    "accessSettings": {
      "datamartName": "my-datamart",
      "isAllowEmailReports": false,
      "isAllowManageMetrics": true,
      "isAllowCreateDashboardView": true,
      "isAllowMetricCreation": true,
      "isAllowMetricDeletion": false,
      "isAllowMetricLayoutChange": true,
      "isAllowMetricUpdate": true,
      "isAllowUnderlyingData": false,
      "joinModel": "multi",
      "metricCreationMode": "DRAG_DROP"
    }
  }'
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:
{
  "dashboardId": "client-acme-analytics",
  "clientId": "acme-corp-123",
  "templateDashboardId": "template-dashboard-001",
  "name": "ACME Analytics Dashboard",
  "isRenameDashboard": true,
  "isImportMetrics": true,
  "metricImportMode": "GALLERY",
  "accessSettings": { ... }
}
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:
<dbn-dashboard 
  token="guest-token-here" 
  dashboard-id="client-acme-analytics" 
/>

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