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.
reports:writeGrant 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 needsid,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; overridesdefinition.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
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.