Definitions

Base URL: $BUSINESS_API

List utility report definitions

Logs

GET /definitions

Returns the report definitions the tenant can run, one cursor page at a time: its own definitions plus the platform-wide ones. The handler also accepts a category filter. Requires reports:read.

Parameters

limitinteger · query · optional

Maximum resources to return (default 20, maximum 100).

afterstring · query · optional

Opaque cursor returned by the previous page.

Returns

200 Report definitions

Permissions reports:read · Roles: admin, analyst, finance, owner

curl -X GET "$BUSINESS_API/definitions" \
  -H "Authorization: Bearer sk_test_..."
Response 200

Report definitions

Create utility report definition

Logs

POST /definitions

Creates a report definition scoped to the authenticated tenant. key, name and dataset_key are required; description and category are optional. The key must be unique within the tenant, and a duplicate returns 409. Requires reports:write.

Returns

201 Definition created

Permissions reports:write · Roles: admin, analyst, finance, owner

curl -X POST "$BUSINESS_API/definitions" \
  -H "Authorization: Bearer sk_test_..."
Response 201

Definition created

Get a utility report definition

Logs

GET /definitions/{id}

Returns one report definition that the tenant can see, either its own or a platform-wide one. Requires reports:read; a definition belonging to another tenant, or an unknown ID, returns 404.

Parameters

idstring · path · required

Identifier of the report definition.

Returns

200 Report definition

Errors 403 · 404

Permissions reports:read · Roles: admin, analyst, finance, owner

curl -X GET "$BUSINESS_API/definitions/{id}" \
  -H "Authorization: Bearer sk_test_..."
Response 200

Report definition