PricingBlogEnterpriseAPI
Log inStart free
Log inStart free

07 / Endpoints

Tickets

Bulk grant tickets (organisation → several workspaces)

API key required
POST/api/enterprise/v1/organizations/{orgId}/tickets/bulk-grant

Distributes tickets from the organisation's shared pool to several workspaces at once.

Behaviour

  • Each workspace's allocation (allocated) increases cumulatively by the granted amount.
  • A workspace that had no quota gets one at this moment, and from then on it can only spend within its allocation.
  • Listing the same workspaceId twice in one request is a 400 (whether that means summing or overwriting is ambiguous, and we do not guess).
  • Up to 100 items per request.

Atomicity — all or nothing

It runs as a single transaction, so if the pool runs short partway through, the items already processed are rolled back too. Partial success would leave you unable to tell how far it got, and a retry would become a double grant. On failure you get a 400 (request or pool validation), a 404 (workspace missing) or a 409 (idempotency conflict), along with the guarantee that nothing was applied.

Idempotency

Send an Idempotency-Key header and, for 24 hours from the first successful request, a repeat of the same key returns the original response without re-running anything, with an Idempotent-Replay: true header attached. We strongly recommend using it to stop a network retry from granting twice. Failed responses are not stored as idempotency records, so you can fix the cause and retry with the same key. Sending different content under the same key is rejected with a 409.

Path parameters

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc

Request bodyBulkGrantTicketsRequest

FieldTypeRequiredDescription
items[]object[]RequiredGrant items (up to 100)
workspaceIdstringRequiredWorkspace to grant toExample: ws_cuid456def
amountintegerRequiredTickets to grant (positive integer). To take tickets back, use POST .../tickets/revoke.min 1 | Example: 100
maxRemainingintegerOptionalConditional cap on the remaining balance, owned by the caller's own granting policy. If the remaining balance after the grant would exceed this value, the whole request is rejected. FikaClip does not store the policy value.min 0 | Example: 500
descriptionstringRequiredReason for the grant (recorded in the audit trail; required)minLength 1 · maxLength 500 | Example: Scheduled ticket distribution, August 2026
Request example
{
  "items": [
    {
      "workspaceId": "ws_cuid456def",
      "amount": 100,
      "maxRemaining": 500
    }
  ],
  "description": "Scheduled ticket distribution, August 2026"
}

Responses

StatusMeaning
200All succeededBulkGrantTicketsResponse
400Bad request (validation failed)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
409The same Idempotency-Key has already been used for a request with different content. Use a new key.PartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200BulkGrantTicketsResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
bulkRequestIdstringRequiredIdentifier of this bulk operation. It is recorded in each workspace's history so the batch can be traced as a group.Example: 9b18865e-6a1d-4096-b4b1-7cefbb27129e
totalGrantedTicketAmountRequiredTotal 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
results[]object[]Required
workspaceIdstringRequiredExample: ws_cuid456def
grantedobjectRequired
quotaobjectRequiredWorkspace quota state after the grant
allocatedintegerRequiredExample: 600
usedintegerRequiredExample: 120
remainingintegerRequiredExample: 480
Response example
{
  "requestId": "req_abc123",
  "bulkRequestId": "9b18865e-6a1d-4096-b4b1-7cefbb27129e",
  "totalGranted": {
    "ticket": 500,
    "display": "500"
  },
  "results": [
    {
      "workspaceId": "ws_cuid456def",
      "quota": {
        "allocated": 600,
        "used": 120,
        "remaining": 480
      }
    }
  ]
}

Get organisation ticket balance

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

Returns the shared pool balance together with how much is reserved by workspace quotas and how much is still unreserved.

Path parameters

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc

Request body

This endpoint takes no request body.

Responses

StatusMeaning
200RetrievedOrganizationTicketBalanceResponse
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 200OrganizationTicketBalanceResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
organizationIdstringRequiredExample: org_cuid123abc
poolBalanceobjectRequired
reservedByQuotaobjectRequired
unreservedobjectRequired
workspaces[]object[]Required
workspaceIdstringRequiredExample: ws_cuid456def
namestringRequiredExample: Marketing team
statusenumRequiredWorkspace status. ARCHIVED is an inactive workspace where generation is blocked.Allowed: ACTIVE · ARCHIVED | Example: ACTIVE
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
Response example
{
  "requestId": "req_abc123",
  "organizationId": "org_cuid123abc",
  "workspaces": [
    {
      "workspaceId": "ws_cuid456def",
      "name": "Marketing team",
      "status": "ACTIVE",
      "quota": {
        "allocated": 500,
        "used": 120,
        "remaining": 380,
        "updatedAt": "2026-08-20T09:00:00.000Z"
      }
    }
  ]
}

Set workspace ticket quota (absolute)

API key required
PUT/api/enterprise/v1/organizations/{orgId}/workspaces/{workspaceId}/tickets/quota

Overwrites the workspace's total allocation (this is not a delta).

  • allocated: 0 → fully blocked (that workspace cannot generate)
  • allocated: null → quota removed. The organisation's shared pool is used without a limit
  • It cannot be set below what has already been spent (used) (400)
  • The sum of every quota's remaining headroom inside the organisation cannot exceed the shared pool balance (400)

Path parameters

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc
workspaceIdstringRequiredWorkspace IDExample: ws_cuid456def

Request bodySetWorkspaceTicketQuotaRequest

FieldTypeRequiredDescription
allocatedinteger | nullRequiredTotal allocation. null removes the quota (unlimited).min 0 | Example: 500
descriptionstringOptionalReason for the change (audit log)maxLength 500 | Example: Limit raised as the team grew
Request example
{
  "allocated": 500,
  "description": "Limit raised as the team grew"
}

Responses

StatusMeaning
200SetSetWorkspaceTicketQuotaResponse
400The ticket quota cannot be changed (INVALID_REQUEST, QUOTA_BELOW_USED, INSUFFICIENT_POOL_BALANCE)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
409The same Idempotency-Key has already been used for a request with different content. Use a new key.PartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200SetWorkspaceTicketQuotaResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
workspaceIdstringRequiredExample: ws_cuid456def
quotaobjectRequired
poolUnreservedAfterobjectRequired
Response example
{
  "requestId": "req_abc123",
  "workspaceId": "ws_cuid456def"
}

Grant tickets to a workspace

API key required
POST/api/enterprise/v1/organizations/{orgId}/workspaces/{workspaceId}/tickets/grant

Grants tickets from the organisation's shared pool to this one workspace. allocated grows by amount (cumulative).

Calling it on a workspace that had no quota (unlimited) creates one, and from that moment the workspace can only spend within its allocation.

Constraints

  • Exceeding the shared pool's unreserved headroom (unreserved) returns 400 INSUFFICIENT_POOL_BALANCE
  • To grant to several workspaces at once, use POST /organizations/{orgId}/tickets/bulk-grant

Path parameters

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc
workspaceIdstringRequiredWorkspace IDExample: ws_cuid456def

Request bodyGrantWorkspaceTicketsRequest

FieldTypeRequiredDescription
amountintegerRequiredTickets to grant (positive only)min 1 | Example: 100
maxRemainingintegerOptionalConditional cap on the remaining balance, owned by the caller's own granting policy. If the remaining balance after the grant would exceed this value, the whole request is rejected with REMAINING_CAP_EXCEEDED. FikaClip does not store the policy value.min 0 | Example: 500
descriptionstringRequiredReason for the grant (required for the audit log)minLength 1 · maxLength 500 | Example: Extra campaign volume for August
Request example
{
  "amount": 100,
  "maxRemaining": 500,
  "description": "Extra campaign volume for August"
}

Responses

StatusMeaning
200GrantedGrantWorkspaceTicketsResponse
400Tickets cannot be granted (INVALID_REQUEST, INSUFFICIENT_POOL_BALANCE, REMAINING_CAP_EXCEEDED)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
409The same Idempotency-Key has already been used for a request with different content. Use a new key.PartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200GrantWorkspaceTicketsResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
workspaceIdstringRequiredExample: ws_cuid456def
grantedobjectRequired
quotaobjectRequired
poolUnreservedAfterobjectRequired
Response example
{
  "requestId": "req_abc123",
  "workspaceId": "ws_cuid456def"
}

Revoke tickets from a workspace

API key required
POST/api/enterprise/v1/organizations/{orgId}/workspaces/{workspaceId}/tickets/revoke

Reduces this workspace's allocation and returns that amount to the organisation's shared pool.

Constraints

  • Tickets already spent (used) cannot be revoked. The maximum you can take back is remaining.
  • Asking for more returns 400 QUOTA_BELOW_USED and nothing changes.
  • To revoke the whole remaining allocation, pass remaining as amount or use revokeAll: true.

Path parameters

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc
workspaceIdstringRequiredWorkspace IDExample: ws_cuid456def

Request bodyRevokeWorkspaceTicketsRequest

FieldTypeRequiredDescription
amountintegerOptionalTickets to revoke (positive only). Can be omitted when revokeAll: true.min 1 | Example: 50
revokeAllbooleanOptionalWhen true, the whole remaining allocation (remaining) is revoked.Example: false
descriptionstringRequiredReason for the revoke (required for the audit log)minLength 1 · maxLength 500 | Example: Remainder reclaimed after the campaign ended
Request example
{
  "amount": 50,
  "revokeAll": false,
  "description": "Remainder reclaimed after the campaign ended"
}

Responses

StatusMeaning
200RevokedRevokeWorkspaceTicketsResponse
400Tickets cannot be revoked (INVALID_REQUEST, QUOTA_BELOW_USED)PartnerErrorResponse
401Authentication failed (API key missing or invalid)PartnerErrorResponse
403Forbidden (no access to that organisation)PartnerErrorResponse
404Resource not foundPartnerErrorResponse
409The same Idempotency-Key has already been used for a request with different content. Use a new key.PartnerErrorResponse
429Rate limit exceededPartnerErrorResponse
503Rate limit service temporarily unavailablePartnerErrorResponse

Responses 200RevokeWorkspaceTicketsResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
workspaceIdstringRequiredExample: ws_cuid456def
revokedobjectRequired
quotaobjectRequired
poolUnreservedAfterobjectRequired
Response example
{
  "requestId": "req_abc123",
  "workspaceId": "ws_cuid456def"
}

Get workspace ticket status

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

Returns one workspace's allocated, used and remaining tickets along with the maximum that can be revoked. Checking this before a grant or a revoke is how you avoid a 400.

Path parameters

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc
workspaceIdstringRequiredWorkspace IDExample: ws_cuid456def

Request body

This endpoint takes no request body.

Responses

StatusMeaning
200RetrievedWorkspaceTicketStatusResponse
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 200WorkspaceTicketStatusResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
workspaceIdstringRequiredExample: ws_cuid456def
workspaceNamestringRequiredExample: Marketing team
quotaobjectRequired
revocableMaxobjectRequired
Response example
{
  "requestId": "req_abc123",
  "workspaceId": "ws_cuid456def",
  "workspaceName": "Marketing team"
}

Workspace ticket allocation history

API key required
GET/api/enterprise/v1/organizations/{orgId}/workspaces/{workspaceId}/tickets/history

Returns the grant, revoke and quota-setting history of this workspace in reverse chronological order. It answers "who gave how much, when, and why" for auditing.

This is not the consumption record. Consumption lives in GET /organizations/{orgId}/tickets/ledger. Allocation changes do not move the organisation's shared pool balance and so leave no ledger entry, which is why they are kept as a separate history.

Path parameters

FieldTypeRequiredDescription
orgIdstringRequiredOrganization IDExample: org_cuid123abc
workspaceIdstringRequiredWorkspace IDExample: ws_cuid456def

Query parameters

FieldTypeRequiredDescription
fromstringOptionalStart of the window (defaults to the last 30 days)Example: 2026-08-01T00:00:00.000Z
tostringOptionalExample: 2026-09-01T00:00:00.000Z
actionenumOptionalAction filter. It can be repeated (for example ?action=GRANT&action=REVOKE).Allowed: GRANT · REVOKE · SET | Example: GRANT
cursorstringOptionalPass the nextCursor from the previous response unchanged. Its format is <ISO createdAt>|<id>.Example: 2026-08-20T09:00:00.000Z|cmtb28hn6000b0yz4a3nx12v5
limitintegerOptionalPage size (default 50, max 200)Example: 50

Request body

This endpoint takes no request body.

Responses

StatusMeaning
200RetrievedWorkspaceTicketHistoryResponse
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 200WorkspaceTicketHistoryResponse

FieldTypeRequiredDescription
requestIdstringRequiredExample: req_abc123
workspaceIdstringRequiredExample: ws_cuid456def
workspaceNamestringRequiredExample: Marketing team
periodAggregationPeriodRequired
fromstringRequiredExample: 2026-08-01T00:00:00.000Z
tostringRequiredExample: 2026-09-01T00:00:00.000Z
data[]object[]Required
idstringRequiredExample: cmtb28hn6000b0yz4a3nx12v5
actionenumRequiredGRANT adds cumulatively / REVOKE takes back / SET writes an absolute value or removes the quotaAllowed: GRANT · REVOKE · SET | Example: GRANT
amountintegerRequiredAmount of the change. Always positive; the direction lives in action (the same convention as the ledger's amount).Example: 100
previousAllocatedintegerRequiredAllocation immediately before the changeExample: 500
newAllocatedintegerRequiredAllocation immediately after the changeExample: 600
usedAtChangeintegerRequiredAmount spent at the time of the change. This is what the revoke floor is judged against.Example: 120
reasonstring | nullRequiredExample: Extra campaign volume for August
actorobjectRequiredWho made the change
adminIdstring | nullRequiredOperator ID when the change came from the admin screenExample: null
apiKeyIdstring | nullRequiredAPI key ID used when the change came through the Admin APIExample: key_cuid789
bulkRequestIdstring | nullRequiredRequest ID when the entry came from a bulk grant. It groups one batch together.Example: 9b18865e-6a1d-4096-b4b1-7cefbb27129e
createdAtstringRequiredExample: 2026-08-20T09:00:00.000Z
nextCursorstring | nullRequiredCursor for the next page, or null when there is none.Example: 2026-08-20T09:00:00.000Z|cmtb28hn6000b0yz4a3nx12v5
Response example
{
  "requestId": "req_abc123",
  "workspaceId": "ws_cuid456def",
  "workspaceName": "Marketing team",
  "period": {
    "from": "2026-08-01T00:00:00.000Z",
    "to": "2026-09-01T00:00:00.000Z"
  },
  "data": [
    {
      "id": "cmtb28hn6000b0yz4a3nx12v5",
      "action": "GRANT",
      "amount": 100,
      "previousAllocated": 500,
      "newAllocated": 600,
      "usedAtChange": 120,
      "reason": "Extra campaign volume for August",
      "actor": {
        "apiKeyId": "key_cuid789"
      },
      "bulkRequestId": "9b18865e-6a1d-4096-b4b1-7cefbb27129e",
      "createdAt": "2026-08-20T09:00:00.000Z"
    }
  ],
  "nextCursor": "2026-08-20T09:00:00.000Z|cmtb28hn6000b0yz4a3nx12v5"
}