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"
}
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 for multi-tenant scenarios where each client gets their own blank canvas.
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"
}
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"
}
templateDashboardId to clone filters and settings from an existing dashboard.
/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.POST https://api.usedatabrain.com/api/v2/data-app/dashboard-embeds
POST https://api.usedatabrain.com/api/v2/dataApp/dashboard-embeds
Authorization: Bearer dbn_live_abc123...
application/json for pure JSON payloadsmultipart/form-data when uploading a dashboard export JSON file via importDashboardDataFileContent-Type: application/json
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.isRenameDashboard is true, this value is also used as the underlying dashboard’s display name.true and templateDashboardId is provided, metrics from the template dashboard are imported into the new dashboard (optional).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.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.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.isImportMetrics is true and templateDashboardId is provided, controls how metrics are imported: GALLERY or METRIC (optional).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.joinModel instead.name and clientColumn.tableTenancySettings array is provided.tableTenancySettings array is provided.null.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.| 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 |
| 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 |
Get your API token
Create a new dashboard for your client
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"
}
}'
(Optional) Use a template
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": { ... }
}
Generate a guest token
templateDashboardId to clone filters and settings from a master template.isRenameDashboard: true with name to give each client dashboard a human-readable display name instead of {dashboardId}_{clientId}.clientId and row-level security settings.