ReportDefinitions
Create ReportDefinition
Create a new ReportDefinition record.
POST
Create ReportDefinition
A saved self-service report: a ReportQuery JSON document plus a visualization. Use report_catalog to discover fields, report_query to test a query before saving it, and report_run to execute a saved report.
Authentication
This endpoint requires OAuth2 authentication. Include a valid bearer token in the
Authorization header.
The authenticated user must be a full unrestricted administrator or have the ReportDefinition-Create role.Request Body
Required Fields
integer
required
ID of the business that owns this report.
string
required
Report name shown in the library.
string
required
ReportQuery JSON document (version 1). Use report_catalog to discover entities and field paths and report_query to test the query before saving..
integer
required
Number of times the report has been run.
Optional Fields
string
Optional description of what the report shows.
string
Folder used to group reports in the library (e.g. Bookings, Billing).
string
VisualizationDocument JSON: { “type”: “table|number|bar|line|area|pie”, “settings”: { … } }.
Visible to every user of the business; when false only the owner sees it.
integer
User who created the report (set automatically).
string
UTC time the report was last run.
Code Examples
Response
200
integer
HTTP status code.
200 on success.string
A human-readable message confirming the creation.
object
Contains the
Id of the newly created record.boolean
true if the reportdefinition was created successfully.array
null on success.Example Response
400
string
A summary of the validation error(s), in the format
PropertyName: error message.any
null on validation failure.object[]
Array of validation errors.
boolean
false when the request fails validation.Example Response