Skip to main content

Run Ad-Hoc Report

POST 

/api/v2/report-builder/run

Run a report definition without saving it — for previewing results before you create a 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 — base_entity (required), columns (required, min 1; each needs id, kind, entity, field), filters, sorts, limit (1-5000). See Create Custom Report for every column, filter and sort option.
  • limit (integer, optional, 1-5000): row cap; overrides definition.limit. Default 500.

Response: columns (one entry per definition column with id, kind, entity, field, label, alias, aggregation, formula, format, decimals), rows (objects keyed by each column's alias, which is entity__field), row_count, sql (the generated query with ? placeholders), raw_sql (the same query with its values inlined, ready to use as the starting point of an SQL report) and took_ms.

Returns 422 when the definition references an unknown entity, column or filter field.

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

Request​

Responses​

OK

Response Headers
    Content-Type