PricingBlogEnterpriseAPI
Log inStart free
Log inStart free

08 / Endpoints

Dashboard

Ticket usage and consumption record (ledger)

API key required
GET/api/enterprise/v1/organizations/{orgId}/tickets/ledger

Returns 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

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc

Query parameters

FieldTypeRequiredDescription
workspaceIdstringOptionalFilter to one workspaceExample: ws_cuid456def
typeenum[]OptionalEvent type filter (repeatable)
featureIdstringOptionalConsumed-feature slug filterExample: VIDEO_SHORT
fromstringOptionalStart (ISO 8601, inclusive)Example: 2026-08-01T00:00:00.000Z
tostringOptionalEnd (ISO 8601, exclusive)Example: 2026-09-01T00:00:00.000Z
cursorstringOptionalnextCursor from the previous responseExample: evt_000100
limitintegerOptionalPage size (default 50, max 200)Example: 50

Request body

This endpoint takes no request body.

Responses

StatusMeaning
200RetrievedTicketLedgerResponse
400Bad request (validation failed)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200TicketLedgerResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
data[]TicketLedgerEntry[]Required
idstringRequiredExample: evt_000123
organizationIdstringRequiredExample: org_cuid123abc
workspaceIdstring | nullRequirednull for an organisation-level eventExample: ws_cuid456def
workspaceNamestring | nullRequiredExample: Marketing team
userIdstring | nullRequiredUser who triggered the eventExample: usr_abc
userEmailstring | nullRequiredExample: a@b.com
typeenumRequiredTicket 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
featureIdstring | nullRequiredSlug of the feature consumed (for example VIDEO_SHORT, TTS). null for top-ups and adjustmentsExample: VIDEO_SHORT
featureLabelstring | nullRequiredExample: Shorts generation
amountintegerRequiredEvent amount (signed; consumption and revokes are negative)Example: -10
balanceAfterintegerRequiredWallet balance immediately after the eventExample: 490
jobIdstring | nullRequiredRelated generation job ID, when there is oneExample: job_xyz789
descriptionstring | nullRequiredExample: Generated 3 shorts
createdAtstringRequiredExample: 2026-08-20T09:00:00.000Z
nextCursorstring | nullRequiredCursor for the next page. null on the last page.Example: evt_000050
hasMorebooleanRequiredExample: true
Response example
{
  "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 required
GET/api/enterprise/v1/organizations/{orgId}/tickets/summary

Returns 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

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc

Query parameters

FieldTypeRequiredDescription
fromstringOptionalStart (ISO 8601). Defaults to the last 30 days.Example: 2026-08-01T00:00:00.000Z
tostringOptionalEnd (ISO 8601). Defaults to now.Example: 2026-09-01T00:00:00.000Z
workspaceIdstringOptionalRestrict to one workspaceExample: ws_cuid456def

Request body

This endpoint takes no request body.

Responses

StatusMeaning
200RetrievedTicketSummaryResponse
400Bad request (validation failed)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200TicketSummaryResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
organizationIdstringRequiredExample: org_cuid123abc
periodobjectRequired
fromstringRequiredExample: 2026-08-01T00:00:00.000Z
tostringRequiredExample: 2026-09-01T00:00:00.000Z
grantedobjectRequired
consumedobjectRequired
refundedobjectRequired
revokedobjectRequired
expiredobjectRequired
currentBalanceobjectRequired
jobCountintegerRequiredNumber of generation jobs that consumed tickets in the windowExample: 128
Response example
{
  "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 required
GET/api/enterprise/v1/organizations/{orgId}/tickets/usage/by-workspace

The 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

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc

Query parameters

FieldTypeRequiredDescription
fromstringOptionalExample: 2026-08-01T00:00:00.000Z
tostringOptionalExample: 2026-09-01T00:00:00.000Z

Request body

This endpoint takes no request body.

Responses

StatusMeaning
200RetrievedTicketUsageByWorkspaceResponse
400Bad request (validation failed)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200TicketUsageByWorkspaceResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
periodAggregationPeriodRequired
fromstringRequiredExample: 2026-08-01T00:00:00.000Z
tostringRequiredExample: 2026-09-01T00:00:00.000Z
data[]object[]Required
workspaceIdstringRequiredExample: ws_cuid456def
workspaceNamestringRequiredExample: Marketing team
consumedTicketAmountRequiredTotal amount actually distributed
ticketintegerRequiredTicket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500
displaystringRequiredDisplay string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500
grantedTicketAmountRequiredTotal amount actually distributed
ticketintegerRequiredTicket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500
displaystringRequiredDisplay string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500
quotaWorkspaceTicketQuotaRequired
allocatedintegerRequiredTotal tickets allocated to this workspace. 0 means fully blocked (no generation).Example: 500
usedintegerRequiredTickets already spent. This cannot be undone and sets the floor for revoking.Example: 120
remainingintegerRequiredRemaining tickets = allocated − used (minimum 0). The amount actually available.Example: 380
updatedAtstringRequiredWhen the allocation last changedExample: 2026-08-20T09:00:00.000Z
jobCountintegerRequiredExample: 42
unattributedobjectRequiredTotal 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.
consumedTicketAmountRequiredTotal amount actually distributed
ticketintegerRequiredTicket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500
displaystringRequiredDisplay string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500
grantedTicketAmountRequiredTotal amount actually distributed
ticketintegerRequiredTicket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500
displaystringRequiredDisplay string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500
Response example
{
  "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 required
GET/api/enterprise/v1/organizations/{orgId}/tickets/usage/by-feature

Aggregates 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

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc

Query parameters

FieldTypeRequiredDescription
fromstringOptionalExample: 2026-08-01T00:00:00.000Z
tostringOptionalExample: 2026-09-01T00:00:00.000Z
workspaceIdstringOptionalExample: ws_cuid456def

Request body

This endpoint takes no request body.

Responses

StatusMeaning
200RetrievedTicketUsageByFeatureResponse
400Bad request (validation failed)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200TicketUsageByFeatureResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
periodAggregationPeriodRequired
fromstringRequiredExample: 2026-08-01T00:00:00.000Z
tostringRequiredExample: 2026-09-01T00:00:00.000Z
data[]object[]Required
featureIdstring | nullRequiredFeature identifier. null for older entries that carry no feature information.Example: VIDEO_SHORT
featureLabelstring | nullRequiredFeature name for display. null whenever featureId is null.Example: Shorts generation
consumedTicketAmountRequiredTotal amount actually distributed
ticketintegerRequiredTicket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500
displaystringRequiredDisplay string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500
eventCountintegerRequiredExample: 340
Response example
{
  "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 required
GET/api/enterprise/v1/organizations/{orgId}/tickets/usage/timeseries

Daily, 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

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc

Query parameters

FieldTypeRequiredDescription
intervalenumOptionalAggregation unit (default day)Allowed: day · week · month | Example: day
fromstringOptionalExample: 2026-08-01T00:00:00.000Z
tostringOptionalExample: 2026-09-01T00:00:00.000Z
workspaceIdstringOptionalExample: ws_cuid456def

Request body

This endpoint takes no request body.

Responses

StatusMeaning
200RetrievedTicketUsageTimeseriesResponse
400Bad request (validation failed)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200TicketUsageTimeseriesResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
intervalenumRequiredAllowed: day · week · month | Example: day
periodAggregationPeriodRequired
fromstringRequiredExample: 2026-08-01T00:00:00.000Z
tostringRequiredExample: 2026-09-01T00:00:00.000Z
data[]object[]Required
bucketstringRequiredBucket start (ISO 8601, UTC)Example: 2026-08-20T00:00:00.000Z
consumedTicketAmountRequiredTotal amount actually distributed
ticketintegerRequiredTicket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500
displaystringRequiredDisplay string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500
grantedTicketAmountRequiredTotal amount actually distributed
ticketintegerRequiredTicket count (the same integer as the stored value). This is the reference value for settlement and for requests.Example: 500
displaystringRequiredDisplay string with the organisation's displayDivisor applied. For reference only — do not compute with it.Example: 500
jobCountintegerRequiredExample: 12
Response example
{
  "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
    }
  ]
}