API Endpoints

Cloud Databrain Endpoint

POST https://api.usedatabrain.com/api/v2/dataApp/embed/{method_path}

Self-hosted Databrain Endpoint

POST <SELF_HOSTED_URL>/api/v2/dataApp/embed/{method_path}
Authorization
string
required
Bearer token for API authentication. Format: Bearer API TOKEN

API Methods

POST /create

Create an embed configuration for a dashboard or a metric.
Request Body
{
  "dashboardId": "string",
  "embedType": "dashboard" | "metric",
  "metricId": "string (required if embedType is 'metric')",
  "workspaceName": "string",
  "accessSettings": {
    "datamartName": "string",
    "isAllowAiPilot": true,
    "isAllowEmailReports": false,
    "isAllowManageMetrics": true,
    "isAllowMetricCreation": true,
    "isAllowMetricDeletion": true,
    "isAllowMetricLayoutChange": true,
    "isAllowMetricUpdate": true,
    "isAllowUnderlyingData": false,
    "metricCreationMode": "DRAG_DROP" | "CHAT",
    "tableList": [
      {
        "clientColumn": "string",
        "name": "string"
      }
    ]
  }
}
// database tenancy don't require table list

Response

{
  "id": "string",
  "error": null
}

Error Response

Error
{
  "error": {
    "code": "string",
    "message": "string",
    "status": 400
  }
}

Possible Errors

CodeMessageHTTP Status
INVALID_WORKSPACE_NAMEInvalid workspace name400
INVALID_DATA_APP_API_KEYMissing or invalid data app400
INVALID_DASHBOARD_IDDashboard not found400
INVALID_METRIC_IDMetric not found400
INTERNAL_SERVER_ERRORUnexpected failure500
INVALID_DATAMARTInvalid datamart400
DATAMART_TABLE_NOT_FOUNDDatamart table not found (If the datamart uses table-level tenancy but has no configured tables.)400
INVALID_DATAMARTInvalid datamart tenancy level (When the datamart’s tenancy level doesn’t match the workspace’s expected tenancy.)400

Update Embed

POST /update

Update the accessSettings for an existing embed.
Request Body
{
  "embedId": "string",
  "accessSettings": {
    "datamartName": "string",
    "isAllowAiPilot": true,
    "isAllowEmailReports": false,
    "isAllowManageMetrics": true,
    "isAllowMetricCreation": true,
    "isAllowMetricDeletion": true,
    "isAllowMetricLayoutChange": true,
    "isAllowMetricUpdate": true,
    "isAllowUnderlyingData": false,
    "metricCreationMode": "DRAG_DROP" | "CHAT",
    "tableList": [
      {
        "clientColumn": "string",
        "name": "string"
      }
    ]
  }
}
All accessSettings fields are optional; only provided fields will be updated.
{
  "id": "string",
  "error": null
}

Possible Errors

CodeMessageHTTP Status
INVALID_DATA_APP_API_KEYMissing or invalid data app400
INVALID_EMBED_IDEmbed ID not found400
INVALID_REQUEST_BODYAccess settings empty or malformed400
INTERNAL_SERVER_ERRORUnexpected failure500

Delete Embed

POST /delete

Delete an existing embed using its embedId.
Request Body
{
  "embedId": "string"
}
{
  "id": "string",
  "error": null
}

Possible Errors

CodeMessageHTTP Status
INVALID_DATA_APP_API_KEYMissing or invalid data app400
INVALID_REQUEST_BODYEmbed not found or invalid payload400 or 500
INTERNAL_SERVER_ERRORUnexpected failure500

List Embeds

POST /list

Fetch a list of all embeds created by the authenticated data app.
Request Body
{
  "isPagination": "boolean (optional)",
  "pageNumber": "number (optional)" // 10 items per page
}
{
  "data": [
    {
      "embedId": "string",
      "externalDashboard": {
        "externalDashboardId": "string",
        "name": "string"
      },
      "externalMetric": {
        "externalMetricId": "string",
        "name": "string"
      },
      "embedType": "dashboard" | "metric",
      "embedDataAppAccessSetting": {
        "isAllowAiPilot": true,
        "isAllowEmailReports": false,
        "isAllowManageMetrics": true,
        "isAllowMetricCreation": true,
        "isAllowMetricDeletion": true,
        "isAllowMetricLayoutChange": true,
        "isAllowMetricUpdate": true,
        "isAllowUnderlyingData": false,
        "metricCreationMode": "DRAG_DROP" | "CHAT",
        "tableList": [
          {
            "clientColumn": "string",
            "name": "string"
          }
        ]
      }
    }
  ],
  "error": null
}

Possible Errors

CodeMessageHTTP Status
INVALID_DATA_APP_API_KEYMissing or invalid data app400
INTERNAL_SERVER_ERRORUnexpected failure500