Skip to main content

Export Ad-Hoc Report

POST 

/api/v2/report-builder/export

Export an unsaved report definition as an XLSX or PDF file (up to 10,000 rows). To export a saved report, use Export Custom Report.

Required scope: reports:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body:

  • definition (object, required): a builder definition (same rules as Run Ad-Hoc Report)
  • format (string, required): xlsx or pdf
  • name (string, optional, max 255): used as the file name prefix and PDF title (default Report)
  • pivot_grid (object, optional, XLSX only): a pre-computed pivot layout to write instead of the flat rows — header and body are arrays of rows, grandTotal an optional row; each cell is {v, merge, role, numberFormat, decimals} where merge spans columns, role marks labels and totals (row-label, row-total, col-total, grand-label, grand-total) and numberFormat is currency, percentage, decimal or number

Response: JSON with filename, base64-encoded content and mime_type. Returns 422 for an invalid definition.

Authentication: Bearer token (Personal Access Token). Personal access tokens need the reports:write scope.

Request​

Responses​

OK

Response Headers
    Content-Type