Skip to main content

Run Custom Report

POST 

/api/v2/custom-reports/:customReport/run

Run a saved report you can see.

Required scope: reports:write

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

Body:

  • limit (integer, optional): row cap, max 5000; defaults to the definition's limit, else 500

Builder reports: 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. When the database estimates the query will scan more than 500,000 rows it runs in the background instead: the response is 202 with queued, tracked_job_log_id and estimated_rows, and the finished file is available from that background job's results.

SQL reports (mode = sql): the response has the SQL result shape — columns (name, type, native_type), rows, row_count, truncated, duration_ms, warnings, sql_executed. Anyone who can see the report may run it; the statement is re-validated on every run and executes under the same read-only safeguards as Run SQL Statement. SQL reports are rate limited per user: by default 30 runs and exports combined per minute; over the limit the endpoint returns 429 with a Retry-After header (seconds).

Returns 404 if the report is not found and 422 if its definition is invalid.

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

Request​

Responses​

OK

Response Headers
    Content-Type