Start typing to search.

API Reference

Stream a full export of an explorer widget

View Markdown

Streams every row matching the explorer widget's merged query (author base query + viewer filters/sort/columns) as a CSV/JSON/NDJSON file download — no pagination and no server-…

POST /api/dashboards/{id}/widgets/{widgetId}/export

Streams every row matching the explorer widget's merged query (author base_query + viewer filters/sort/columns) as a CSV/JSON/NDJSON file download — no pagination and no server-side buffering. Fails for non-explorer widgets and widgets whose features list omits export. Cancel by aborting the request.

Operation ID: exportDashboardWidget

Authentication

Option 1

  • BearerAuth (http bearer) API key token. Create via POST /api/api-keys. Format: envoy_<hex>

Option 2

  • CookieAuth (apiKey) Session cookie set after login + TOTP verification

Path parameters

  • idinteger, required Resource ID
  • widgetIdstring, required

Request body

application/json

  • Type: object
  • Properties:
    • explorer_params (ExplorerViewerParams) — Viewer-supplied refinements for an explorer widget. Merged into the author's base_query — base filter keys always win, and when the widget declares columns they act as an allowlist for filters/sort/columns.
      • Reference: ExplorerViewerParams
        • Description: Viewer-supplied refinements for an explorer widget. Merged into the author's base_query — base filter keys always win, and when the widget declares columns they act as an allowlist for filters/sort/columns.
        • Properties:
          • filters (array<object>)
            • Items:
              • Type: object
              • Properties:
                • field (string, required)
                • operator (string, required)
                  • Allowed values: eq, neq, gt, gte, lt, lte, in, nin, contains, exists
                • value (unknown)
          • sort (array<object>)
            • Items:
              • Type: object
              • Properties:
                • column (string)
                • direction (string)
                  • Allowed values: asc, desc
          • page (integer)
          • limit (integer)
          • columns (array<string>)
            • Items:
              • Type: string
          • cursor (string)
    • format (string)
      • Allowed values: csv, ndjson
      • Default: csv
    • filename (string)

Success responses

200

Streamed file download. Gzip when Accept-Encoding includes gzip.

Content type: text/csv

Content type: application/x-ndjson

Error responses

400

Validation error

Content type: application/json

  • Reference: Error
    • Type: object
    • Properties:
      • error (string)
        • Example: NOT_FOUND
      • message (string)
        • Example: Resource not found

Example:

{
  "error": "VALIDATION_ERROR",
  "message": "Invalid input"
}

404

Resource not found

Content type: application/json

  • Reference: Error
    • Type: object
    • Properties:
      • error (string)
        • Example: NOT_FOUND
      • message (string)
        • Example: Resource not found

Example:

{
  "error": "NOT_FOUND",
  "message": "Resource not found"
}

Examples

cURL

curl --request POST \
  --url 'https://your-envoy.example.com/api/dashboards/YOUR_ID/widgets/YOUR_WIDGET_ID/export' \
  --header 'Authorization: Bearer $API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "explorer_params": {
    "filters": [
      {
        "field": "string",
        "operator": "eq"
      }
    ],
    "sort": [
      {
        "column": "string",
        "direction": "asc"
      }
    ],
    "page": 0,
    "limit": 0,
    "columns": [
      "string"
    ]
  },
  "format": "csv",
  "filename": "string"
}'

JavaScript (fetch)

const response = await fetch('https://your-envoy.example.com/api/dashboards/YOUR_ID/widgets/YOUR_WIDGET_ID/export', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "explorer_params": {
      "filters": [
        {
          "field": "string",
          "operator": "eq"
        }
      ],
      "sort": [
        {
          "column": "string",
          "direction": "asc"
        }
      ],
      "page": 0,
      "limit": 0,
      "columns": [
        "string"
      ]
    },
    "format": "csv",
    "filename": "string"
  }),
});
 
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = response.status === 204 ? null : await response.json();
console.log(data);