Skip to main content
curl --request POST \
  --url 'https://api.usedatabrain.com/api/v2/data-app/import-dashboard' \
  --header 'Authorization: Bearer dbn_live_...' \
  --header 'Content-Type: application/json' \
  --data '{
    "workspaceName": "Target Workspace",
    "importDashboardData": {
      "layout": [],
      "filters": [],
      "gridMargin": {}
    },
    "dashboardId": "sales-dashboard-1-copy",
    "dashboardName": "Sales Dashboard (Copy)",
    "schemaPairs": [
      { "replaceSchema": "source_schema", "targetSchema": "public" }
    ]
  }'
{
  "data": {
    "response": {
      "message": "Imported Dashboard with 10 metrics",
      "dashboardId": "sales-dashboard-1-copy",
      "dashboardName": "Sales Dashboard (Copy)",
      "workspaceName": "Target Workspace"
    }
  }
}
POST
/
api
/
v2
/
data-app
/
import-dashboard
curl --request POST \
  --url 'https://api.usedatabrain.com/api/v2/data-app/import-dashboard' \
  --header 'Authorization: Bearer dbn_live_...' \
  --header 'Content-Type: application/json' \
  --data '{
    "workspaceName": "Target Workspace",
    "importDashboardData": {
      "layout": [],
      "filters": [],
      "gridMargin": {}
    },
    "dashboardId": "sales-dashboard-1-copy",
    "dashboardName": "Sales Dashboard (Copy)",
    "schemaPairs": [
      { "replaceSchema": "source_schema", "targetSchema": "public" }
    ]
  }'
{
  "data": {
    "response": {
      "message": "Imported Dashboard with 10 metrics",
      "dashboardId": "sales-dashboard-1-copy",
      "dashboardName": "Sales Dashboard (Copy)",
      "workspaceName": "Target Workspace"
    }
  }
}
Import a dashboard into a workspace using JSON data from the Export Dashboard API or from a file exported via the Databrain UI. The dashboard layout, metrics, and filters are recreated in the target workspace.
Authentication Requirement: This endpoint requires a service token (company-level), not a data app API key. The workspace must belong to your company.

Authentication

Use your service token in the Authorization header. See Create Service Token for how to obtain a service token.

Headers

Authorization
string
required
Bearer token for API authentication. Use your service token (company-level).
Authorization: Bearer dbn_live_...
Content-Type
string
required
Must be application/json.
Content-Type: application/json

Request Body

Validated with importDashboardSchema: workspaceName (string, required) and importDashboardData (object, required) are required. dashboardId, dashboardName, and schemaPairs are optional. Each schemaPairs item must include replaceSchema and targetSchema (strings).
workspaceName
string
required
The name of the workspace where the dashboard should be imported. Must match an existing workspace name in your company.
importDashboardData
object
required
The dashboard payload to import. Must be a non-null object. Use the data property from an Export Dashboard response, or the equivalent structure from a UI-exported JSON file. Contains layout, filters, metrics configuration, and related dashboard structure.
dashboardId
string
Optional stable identifier for the imported dashboard in the target workspace.
  • If provided, this value is used as the external dashboard ID.
  • If omitted, a new unique ID is generated automatically.
  • If a dashboard with the same ID already exists in the target workspace, the import returns an error message and no new dashboard is created.
dashboardName
string
Optional display name to assign to the imported dashboard in the target workspace.If omitted, the name from the exported payload is used.
schemaPairs
array
Optional. Maps schema names in the exported SQL/dashboard payload to schema names in the target workspace (for example when moving from staging to production).Each array element is an object with:
  • replaceSchema — string (required in each item)
  • targetSchema — string (required in each item)
"schemaPairs": [
  { "replaceSchema": "databrain_dev1", "targetSchema": "databrain_dev2" }
]

Response

data
object
Result of the import operation.On success, data.response contains:
  • message – human-readable summary of the import (including the number of imported metrics)
  • dashboardId – external dashboard ID in the target workspace
  • dashboardName – name of the imported dashboard in the target workspace
  • workspaceName – name of the workspace where the dashboard was imported
On error, the API returns a JSON object with error.code and error.message and HTTP status 400 or 500.

Examples

HTTP Status Code Summary

Status CodeDescription
200OK – Dashboard imported successfully
400Bad Request – Invalid or missing parameters, invalid token, or workspace not found
500Internal Server Error – Server error during import

Possible Errors

CodeMessageHTTP Status
INVALID_REQUEST_BODYJoi validation message (e.g. "workspaceName" is required, invalid schemaPairs item)400
AUTHENTICATION_ERRORInvalid Service Token (e.g. missing/invalid company context on token)400
WORKSPACE_ID_ERRORinvalid workspace name, workspace name not found400
INTERNAL_SERVER_ERRORServer error message500