> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usedatabrain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Export Embedded Dashboard

> Export the dashboard and configuration behind a data app embed using a data app API token.

Export the dashboard and its configuration (layout, metrics, filters) associated with a specific embed configuration. This endpoint is useful when you want to:

* Clone an embedded dashboard into another workspace or client
* Back up the configuration behind an embed
* Feed the exported configuration into the **Create Empty Dashboard Embed** API via `importDashboardData`

<Warning>
  **Endpoint Migration Notice:** We're transitioning to kebab-case endpoints. The new endpoint is `/api/v2/data-app/embeds/export`. The old endpoint `/api/v2/dataApp/embeds/export` will be deprecated soon. Please update your integrations to use the new endpoint format.
</Warning>

## Authentication

All API requests must include your **data app API token** in the `Authorization` header. This is the same token you use for other data app embedding APIs.

**Finding your API token:** For detailed instructions, see the [API Token guide](/developer-docs/helpers/api-token).

<Panel>
  <RequestExample>
    ```bash Authentication theme={"dark"}
    curl --request GET \
      --url "https://api.usedatabrain.com/api/v2/data-app/embeds/export?embedId=embed_abc123" \
      --header 'Authorization: Bearer dbn_live_abc123...'
    ```
  </RequestExample>
</Panel>

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for API authentication. Use your **data app API token**.

  ```
  Authorization: Bearer dbn_live_abc123...
  ```
</ParamField>

## Query Parameters

<ParamField query="embedId" type="string" required>
  The embed configuration ID to export. This identifies which embedded dashboard's configuration should be exported.

  <Expandable title="Finding embed IDs">
    * Created when you configure an embed via the [Create Embed API](/developer-docs/helpers/api-reference/create-embed) or [Create Empty Dashboard Embed](/developer-docs/helpers/api-reference/create-dashboard-embed)
    * Retrieved via the [List Embeds API](/developer-docs/helpers/api-reference/list-embed)
    * Available in your DataBrain dashboard embed settings
  </Expandable>
</ParamField>

## Response

On success, the API returns **200** with:

* **Content-Type:** `application/json`
* **Content-Disposition:** `attachment; filename="dashboard-{embedId}.json"`

The response body is a JSON object with this structure:

<ResponseField name="_meta" type="object">
  Metadata about the export and the embed configuration.

  <ResponseField name="_meta.exportedAt" type="string">
    ISO 8601 timestamp when the export was performed.
  </ResponseField>

  <ResponseField name="_meta.embedId" type="string">
    The embed ID that was exported.
  </ResponseField>

  <ResponseField name="_meta.name" type="string">
    Human-readable name of the embed configuration.
  </ResponseField>

  <ResponseField name="_meta.embedType" type="string">
    Type of embed configuration: typically `"dashboard"` or `"metric"`.
  </ResponseField>

  <ResponseField name="_meta.dashboardId" type="string">
    External dashboard ID associated with this embed. This is the dashboard that the export is based on.
  </ResponseField>

  <ResponseField name="_meta.embedDataAppAccessSetting" type="object">
    Access settings associated with the embed, including flags like `isAllowEmailReports`, `isAllowManageMetrics`, and other permissions.
  </ResponseField>
</ResponseField>

<ResponseField name="data" type="object">
  The dashboard configuration and content (layout, metrics, filters, etc.). Structure matches what the Import Dashboard API expects as `importDashboardData`, and what the **Create Empty Dashboard Embed** API expects when you pass `importDashboardData` in the request body.
</ResponseField>

On error, the API returns a JSON error object with `error.code`, `error.message`, and `error.status`. Possible errors include:

* `INVALID_REQUEST_BODY` – Request validation failed (for example, missing or invalid `embedId`)
* `INVALID_DATA_APP_API_KEY` – Invalid or missing data app API token
* `EMBED_PARAM_ERROR` – Invalid or unknown embed ID for the current data app
* `INVALID_EMBED_ID` – Embed not found
* `INTERNAL_SERVER_ERROR` – Unexpected server error

## Examples

<Panel>
  <RequestExample>
    ```bash cURL theme={"dark"}
    curl --request GET \
      --url 'https://api.usedatabrain.com/api/v2/data-app/embeds/export?embedId=embed_abc123' \
      --header 'Authorization: Bearer dbn_live_abc123...' \
      --output dashboard-embed_abc123.json
    ```

    ```javascript Node.js icon="fa-brands fa-node-js" theme={"dark"}
    const params = new URLSearchParams({ embedId: 'embed_abc123' });

    const response = await fetch(`https://api.usedatabrain.com/api/v2/data-app/embeds/export?${params}`, {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer dbn_live_abc123...',
      },
    });

    if (!response.ok) {
      const err = await response.json();
      throw new Error(err.error?.message || 'Export failed');
    }

    const text = await response.text();
    const exported = JSON.parse(text);

    console.log('Exported at:', exported._meta?.exportedAt);
    console.log('Embed dashboard id:', exported._meta?.dashboardId);
    ```

    ```python Python icon="fa-brands fa-python" theme={"dark"}
    import requests

    url = "https://api.usedatabrain.com/api/v2/data-app/embeds/export"
    headers = {
        "Authorization": "Bearer dbn_live_abc123..."
    }
    params = {
        "embedId": "embed_abc123"
    }

    response = requests.get(url, headers=headers, params=params)

    if not response.ok:
        err = response.json().get("error", {})
        raise Exception(err.get("message", "Export failed"))

    exported = response.json()

    print("Exported at:", exported["_meta"]["exportedAt"])
    print("Dashboard ID:", exported["_meta"]["dashboardId"])
    ```
  </RequestExample>

  <ResponseExample>
    ```json Success (truncated) theme={"dark"}
    {
      "_meta": {
        "exportedAt": "2026-03-11T10:00:00.000Z",
        "embedId": "embed_abc123",
        "name": "Customer Analytics Embed",
        "embedType": "dashboard",
        "dashboardId": "sales-dashboard-1",
        "embedDataAppAccessSetting": {
          "isAllowEmailReports": true,
          "isAllowManageMetrics": true,
          "isAllowCreateDashboardView": true,
          "isAllowMetricCreation": true,
          "isAllowMetricDeletion": false,
          "isAllowMetricLayoutChange": true,
          "isAllowMetricUpdate": true,
          "isAllowUnderlyingData": false,
          "metricCreationMode": "DRAG_DROP",
          "isIncrementalJoin": true
        }
      },
      "data": {
        "layout": [...],
        "filters": [...],
        "metrics": [...],
        "...": "additional dashboard configuration"
      }
    }
    ```

    ```json Error Response (400 - invalid embedId) theme={"dark"}
    {
      "error": {
        "code": "EMBED_PARAM_ERROR",
        "message": "Invalid default embed id",
        "status": 400
      }
    }
    ```

    ```json Error Response (401 - invalid data app token) theme={"dark"}
    {
      "error": {
        "code": "INVALID_DATA_APP_API_KEY",
        "message": "Invalid Data App API Key",
        "status": 401
      }
    }
    ```
  </ResponseExample>
</Panel>

## Common Workflow: Clone an Embed Dashboard

1. **Export the embed dashboard configuration**

   Use this endpoint to export the configuration for an existing embed:

   ```bash theme={"dark"}
   curl --request GET \
     --url 'https://api.usedatabrain.com/api/v2/data-app/embeds/export?embedId=embed_abc123' \
     --header 'Authorization: Bearer dbn_live_abc123...'
   ```

2. **Create a new client dashboard using `importDashboardData`**

   Pass the exported `data` payload into the [Create Empty Dashboard Embed](/developer-docs/helpers/api-reference/create-dashboard-embed) API:

   ```json theme={"dark"}
   {
     "dashboardId": "client-acme-analytics",
     "clientId": "acme-corp-123",
     "workspaceName": "analytics-workspace",
     "name": "ACME Analytics Dashboard",
     "isRenameDashboard": true,
     "importDashboardData": exported.data,
     "accessSettings": {
       "datamartName": "customer-analytics",
       "isAllowEmailReports": false,
       "isAllowManageMetrics": true,
       "isAllowCreateDashboardView": true,
       "isAllowMetricCreation": true,
       "isAllowMetricDeletion": false,
       "isAllowMetricLayoutChange": true,
       "isAllowMetricUpdate": true,
       "isAllowUnderlyingData": false,
       "metricCreationMode": "DRAG_DROP"
     }
   }
   ```

This flow lets you reuse an existing embedded dashboard as a starting point for new client dashboards while keeping the configuration in sync.
