08 / Endpoints
Dashboard
Ticket usage and consumption record (ledger)
API key requiredReturns the organisation's ticket events in reverse chronological order. It feeds the dashboard's history table.
Top-ups, consumption, refunds, admin grants and revokes, and expiries all arrive in one stream, filterable by type. The balance can be reconstructed as the sum of this ledger.
It uses cursor pagination — pass the response's nextCursor as the next request's cursor.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| orgId | string | Required | Organization IDExample: org_cuid123abc |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| workspaceId | string | Optional | Filter to one workspaceExample: ws_cuid456def |
| type | enum[] | Optional | Event type filter (repeatable) |
| featureId | string | Optional | Consumed-feature slug filterExample: VIDEO_SHORT |
| from | string | Optional | Start (ISO 8601, inclusive)Example: 2026-08-01T00:00:00.000Z |
| to | string | Optional | End (ISO 8601, exclusive)Example: 2026-09-01T00:00:00.000Z |
| cursor | string | Optional | nextCursor from the previous responseExample: evt_000100 |
| limit | integer | Optional | Page size (default 50, max 200)Example: 50 |
Request body
This endpoint takes no request body.
Responses
| Status | Meaning |
|---|---|
| 200 | RetrievedTicketLedgerResponse |
| 400 | Bad request (validation failed)PartnerErrorResponse |
| 401 | Authentication failed (API key missing or invalid)PartnerErrorResponse |
| 403 | Forbidden (no access to that organisation)PartnerErrorResponse |
| 404 | Resource not foundPartnerErrorResponse |
| 429 | Rate limit exceededPartnerErrorResponse |
| 503 | Rate limit service temporarily unavailablePartnerErrorResponse |
Responses 200TicketLedgerResponse
| Field | Type | Required | Description |
|---|---|---|---|
| requestId | string | Required | Example: req_abc123 |
| data[] | TicketLedgerEntry[] | Required | |
| id | string | Required | Example: evt_000123 |
| organizationId | string | Required | Example: org_cuid123abc |
| workspaceId | string | null | Required | null for an organisation-level eventExample: ws_cuid456def |
| workspaceName | string | null | Required | Example: Marketing team |
| userId | string | null | Required | User who triggered the eventExample: usr_abc |
| userEmail | string | null | Required | Example: a@b.com |
| type | enum | Required | Ticket event type.
- CHARGE top-up / PAY consumption / REFUND refund
- ADMIN_GRANT admin grant / ADMIN_REVOKE admin revoke
- PROMOTION promotional grant / EXPIRE expiryAllowed: CHARGE · PAY · PROMOTION · REFUND · ADMIN_GRANT · ADMIN_REVOKE · EXPIRE | Example: PAY |
| featureId | string | null | Required | Slug of the feature consumed (for example VIDEO_SHORT, TTS). null for top-ups and adjustmentsExample: VIDEO_SHORT |
| featureLabel | string | null | Required | Example: Shorts generation |
| amount | integer | Required | Event amount (signed; consumption and revokes are negative)Example: -10 |
| balanceAfter | integer | Required | Wallet balance immediately after the eventExample: 490 |
| jobId | string | null | Required | Related generation job ID, when there is oneExample: job_xyz789 |
| description | string | null | Required | Example: Generated 3 shorts |
| createdAt | string | Required | Example: 2026-08-20T09:00:00.000Z |
| nextCursor | string | null | Required | Cursor for the next page. null on the last page.Example: evt_000050 |
| hasMore | boolean | Required | Example: true |
{
"requestId": "req_abc123",
"data": [
{
"id": "evt_000123",
"organizationId": "org_cuid123abc",
"workspaceId": "ws_cuid456def",
"workspaceName": "Marketing team",
"userId": "usr_abc",
"userEmail": "a@b.com",
"type": "PAY",
"featureId": "VIDEO_SHORT",
"featureLabel": "Shorts generation",
"amount": -10,
"balanceAfter": 490,
"jobId": "job_xyz789",
"description": "Generated 3 shorts",
"createdAt": "2026-08-20T09:00:00.000Z"
}
],
"nextCursor": "evt_000050",
"hasMore": true
}Ticket usage summary (dashboard KPIs)
API key requiredReturns the total granted, spent, refunded and expired amounts in the window together with the current balance, in one call. It feeds the cards at the top of the dashboard.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| orgId | string | Required | Organization IDExample: org_cuid123abc |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| from | string | Optional | Start (ISO 8601). Defaults to the last 30 days.Example: 2026-08-01T00:00:00.000Z |
| to | string | Optional | End (ISO 8601). Defaults to now.Example: 2026-09-01T00:00:00.000Z |
| workspaceId | string | Optional | Restrict to one workspaceExample: ws_cuid456def |
Request body
This endpoint takes no request body.
Responses
| Status | Meaning |
|---|---|
| 200 | RetrievedTicketSummaryResponse |
| 400 | Bad request (validation failed)PartnerErrorResponse |
| 401 | Authentication failed (API key missing or invalid)PartnerErrorResponse |
| 403 | Forbidden (no access to that organisation)PartnerErrorResponse |
| 404 | Resource not foundPartnerErrorResponse |
| 429 | Rate limit exceededPartnerErrorResponse |
| 503 | Rate limit service temporarily unavailablePartnerErrorResponse |
Responses 200TicketSummaryResponse
| Field | Type | Required | Description |
|---|---|---|---|
| requestId | string | Required | Example: req_abc123 |
| organizationId | string | Required | Example: org_cuid123abc |
| period | object | Required | |
| from | string | Required | Example: 2026-08-01T00:00:00.000Z |
| to | string | Required | Example: 2026-09-01T00:00:00.000Z |
| granted | object | Required | |
| consumed | object | Required | |
| refunded | object | Required | |
| revoked | object | Required | |
| expired | object | Required | |
| currentBalance | object | Required | |
| jobCount | integer | Required | Number of generation jobs that consumed tickets in the windowExample: 128 |
{
"requestId": "req_abc123",
"organizationId": "org_cuid123abc",
"period": {
"from": "2026-08-01T00:00:00.000Z",
"to": "2026-09-01T00:00:00.000Z"
},
"jobCount": 128
}Ticket usage by workspace
API key requiredThe aggregate behind the dashboard's per-workspace consumption chart.
Workspaces with zero consumption are included in the array too (so they are distinguishable from missing ones).
About unattributed — the ticket ledger carries no workspace, so a consumption event is attributed to a workspace through the generation job it is linked to. An event with no job (shared pool top-ups, admin adjustments and so on) therefore belongs to no workspace and is returned separately under this value. It is normal for the sum of data[].granted to differ from the organisation total; adding unattributed.granted makes them match.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| orgId | string | Required | Organization IDExample: org_cuid123abc |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| from | string | Optional | Example: 2026-08-01T00:00:00.000Z |
| to | string | Optional | Example: 2026-09-01T00:00:00.000Z |
Request body
This endpoint takes no request body.
Responses
| Status | Meaning |
|---|---|
| 200 | RetrievedTicketUsageByWorkspaceResponse |
| 400 | Bad request (validation failed)PartnerErrorResponse |
| 401 | Authentication failed (API key missing or invalid)PartnerErrorResponse |
| 403 | Forbidden (no access to that organisation)PartnerErrorResponse |
| 404 | Resource not foundPartnerErrorResponse |
| 429 | Rate limit exceededPartnerErrorResponse |
| 503 | Rate limit service temporarily unavailablePartnerErrorResponse |
Responses 200TicketUsageByWorkspaceResponse
| Field | Type | Required | Description |
|---|---|---|---|
| requestId | string | Required | Example: req_abc123 |
| period | AggregationPeriod | Required | |
| from | string | Required | Example: 2026-08-01T00:00:00.000Z |
| to | string | Required | Example: 2026-09-01T00:00:00.000Z |
| data[] | object[] | Required | |
| workspaceId | string | Required | Example: ws_cuid456def |
| workspaceName | string | Required | Example: Marketing team |
| consumed | TicketAmount | Required | Total amount actually distributed |
| ticket | integer | Required | Ticket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500 |
| display | string | Required | Display string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500 |
| granted | TicketAmount | Required | Total amount actually distributed |
| ticket | integer | Required | Ticket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500 |
| display | string | Required | Display string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500 |
| quota | WorkspaceTicketQuota | Required | |
| allocated | integer | Required | Total tickets allocated to this workspace. 0 means fully blocked (no generation).Example: 500 |
| used | integer | Required | Tickets already spent. This cannot be undone and sets the floor for revoking.Example: 120 |
| remaining | integer | Required | Remaining tickets = allocated − used (minimum 0). The amount actually available.Example: 380 |
| updatedAt | string | Required | When the allocation last changedExample: 2026-08-20T09:00:00.000Z |
| jobCount | integer | Required | Example: 42 |
| unattributed | object | Required | Total of organisation-level events (top-ups, admin adjustments and the like) that are not tied to a generation job and therefore belong to no single workspace. |
| consumed | TicketAmount | Required | Total amount actually distributed |
| ticket | integer | Required | Ticket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500 |
| display | string | Required | Display string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500 |
| granted | TicketAmount | Required | Total amount actually distributed |
| ticket | integer | Required | Ticket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500 |
| display | string | Required | Display string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500 |
{
"requestId": "req_abc123",
"period": {
"from": "2026-08-01T00:00:00.000Z",
"to": "2026-09-01T00:00:00.000Z"
},
"data": [
{
"workspaceId": "ws_cuid456def",
"workspaceName": "Marketing team",
"consumed": {
"ticket": 500,
"display": "500"
},
"granted": {
"ticket": 500,
"display": "500"
},
"quota": {
"allocated": 500,
"used": 120,
"remaining": 380,
"updatedAt": "2026-08-20T09:00:00.000Z"
},
"jobCount": 42
}
],
"unattributed": {
"consumed": {
"ticket": 500,
"display": "500"
},
"granted": {
"ticket": 500,
"display": "500"
}
}
}Ticket usage by feature
API key requiredAggregates which feature (shorts generation, TTS, thumbnails and so on) the tickets went to. It feeds the dashboard's donut chart.
Only consumption is aggregated — top-ups and admin adjustments carry no feature. Sorted by consumption, descending.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| orgId | string | Required | Organization IDExample: org_cuid123abc |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| from | string | Optional | Example: 2026-08-01T00:00:00.000Z |
| to | string | Optional | Example: 2026-09-01T00:00:00.000Z |
| workspaceId | string | Optional | Example: ws_cuid456def |
Request body
This endpoint takes no request body.
Responses
| Status | Meaning |
|---|---|
| 200 | RetrievedTicketUsageByFeatureResponse |
| 400 | Bad request (validation failed)PartnerErrorResponse |
| 401 | Authentication failed (API key missing or invalid)PartnerErrorResponse |
| 403 | Forbidden (no access to that organisation)PartnerErrorResponse |
| 404 | Resource not foundPartnerErrorResponse |
| 429 | Rate limit exceededPartnerErrorResponse |
| 503 | Rate limit service temporarily unavailablePartnerErrorResponse |
Responses 200TicketUsageByFeatureResponse
| Field | Type | Required | Description |
|---|---|---|---|
| requestId | string | Required | Example: req_abc123 |
| period | AggregationPeriod | Required | |
| from | string | Required | Example: 2026-08-01T00:00:00.000Z |
| to | string | Required | Example: 2026-09-01T00:00:00.000Z |
| data[] | object[] | Required | |
| featureId | string | null | Required | Feature identifier. null for older entries that carry no feature information.Example: VIDEO_SHORT |
| featureLabel | string | null | Required | Feature name for display. null whenever featureId is null.Example: Shorts generation |
| consumed | TicketAmount | Required | Total amount actually distributed |
| ticket | integer | Required | Ticket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500 |
| display | string | Required | Display string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500 |
| eventCount | integer | Required | Example: 340 |
{
"requestId": "req_abc123",
"period": {
"from": "2026-08-01T00:00:00.000Z",
"to": "2026-09-01T00:00:00.000Z"
},
"data": [
{
"featureId": "VIDEO_SHORT",
"featureLabel": "Shorts generation",
"consumed": {
"ticket": 500,
"display": "500"
},
"eventCount": 340
}
]
}Ticket usage time series
API key requiredDaily, weekly or monthly consumption and grant trend. It feeds the dashboard's line chart, and buckets are truncated in UTC.
Intervals with no events come back filled with 0, so a gap never skips ahead and distorts the trend.
Period ceiling — if the requested window exceeds 1,000 buckets at that interval, it is rejected with 400 PERIOD_TOO_LARGE. That is there so the response is never silently truncated into a graph that quietly draws the wrong numbers. Narrow the window or use a larger interval. (Three years cannot be read by day, but can by month.)
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
| orgId | string | Required | Organization IDExample: org_cuid123abc |
Query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| interval | enum | Optional | Aggregation unit (default day)Allowed: day · week · month | Example: day |
| from | string | Optional | Example: 2026-08-01T00:00:00.000Z |
| to | string | Optional | Example: 2026-09-01T00:00:00.000Z |
| workspaceId | string | Optional | Example: ws_cuid456def |
Request body
This endpoint takes no request body.
Responses
| Status | Meaning |
|---|---|
| 200 | RetrievedTicketUsageTimeseriesResponse |
| 400 | Bad request (validation failed)PartnerErrorResponse |
| 401 | Authentication failed (API key missing or invalid)PartnerErrorResponse |
| 403 | Forbidden (no access to that organisation)PartnerErrorResponse |
| 404 | Resource not foundPartnerErrorResponse |
| 429 | Rate limit exceededPartnerErrorResponse |
| 503 | Rate limit service temporarily unavailablePartnerErrorResponse |
Responses 200TicketUsageTimeseriesResponse
| Field | Type | Required | Description |
|---|---|---|---|
| requestId | string | Required | Example: req_abc123 |
| interval | enum | Required | Allowed: day · week · month | Example: day |
| period | AggregationPeriod | Required | |
| from | string | Required | Example: 2026-08-01T00:00:00.000Z |
| to | string | Required | Example: 2026-09-01T00:00:00.000Z |
| data[] | object[] | Required | |
| bucket | string | Required | Bucket start (ISO 8601, UTC)Example: 2026-08-20T00:00:00.000Z |
| consumed | TicketAmount | Required | Total amount actually distributed |
| ticket | integer | Required | Ticket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500 |
| display | string | Required | Display string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500 |
| granted | TicketAmount | Required | Total amount actually distributed |
| ticket | integer | Required | Ticket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500 |
| display | string | Required | Display string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500 |
| jobCount | integer | Required | Example: 12 |
{
"requestId": "req_abc123",
"interval": "day",
"period": {
"from": "2026-08-01T00:00:00.000Z",
"to": "2026-09-01T00:00:00.000Z"
},
"data": [
{
"bucket": "2026-08-20T00:00:00.000Z",
"consumed": {
"ticket": 500,
"display": "500"
},
"granted": {
"ticket": 500,
"display": "500"
},
"jobCount": 12
}
]
}


