The licence: plan, interval, status, trial end or period end, add-ons, cancellation pending.
const url = 'https://api.contentsurface.io/v1/admin/billing';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.contentsurface.io/v1/admin/billing \ --header 'Authorization: Bearer <token>'The licence: plan, interval, status, trial or period end, add-ons, a pending cancellation, and this month’s bandwidth packs. Tenant admins read it; only the owner changes billing. Also reachable while the tenant is suspended. Tenant admins.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”OK
The tenant’s licence and billing state.
object
The plan: basic, pro or scale.
Its display name.
The version of the plan’s limits the licence is on.
monthly or annual.
trialing, active, pastDue (a payment failed; Stripe retries) or canceled.
When the trial ends; null after it.
The end of the paid period, or of the trial.
True when the subscription ends at validUntil.
True while the tenant is suspended: only the owner may use the Portal, to pay.
The licence’s add-ons.
An add-on on the licence.
object
nodePack, dedicatedDatabaseServer, multiAz, privateEmbedding or otherRegion.
How many.
True when the caller is the owner, who alone changes billing.
This month’s bandwidth packs.
object
The current UTC month, YYYY-MM; packs bought now count in it and end with it.
Packs bought this month.
Their retrieval allowance, in bytes.
One pack’s allowance: 50 GB.
The most packs in one purchase.
When packs bought now end: the end of the UTC month.
The licence is paid: a trial or an ended licence cannot buy packs.
What changes at the renewal: add-ons removed or fewer, a lower plan, yearly → monthly. Null when the subscription renews as it is. Until then the licence keeps what it has.
object
When it applies: validUntil, the end of the current period.
The plan from then: basic, pro or scale.
Its display name.
monthly or annual from then.
Every add-on from then; one not listed is removed.
An add-on on the licence.
object
nodePack, dedicatedDatabaseServer, multiAz, privateEmbedding or otherRegion.
How many.
True while the dedicated database server is bought but the repository not yet moved onto it: ContentSurface schedules the move and announces it by email; until then it runs on a shared server.
Example
{ "plan": "scale", "planName": "Scale", "planVersion": 3, "billingInterval": "annual", "status": "active", "trialEndsAt": null, "validUntil": "2027-09-14T00:00:00+00:00", "cancelAtPeriodEnd": false, "suspended": false, "addOns": [ { "kind": "nodePack", "quantity": 2 }, { "kind": "dedicatedDatabaseServer", "quantity": 1 } ], "callerIsOwner": true, "bandwidthPacks": { "month": "2026-11", "packs": 1, "bytes": 50000000000, "bytesPerPack": 50000000000, "maxPerPurchase": 10, "price": { "unitAmount": 1000, "currency": "eur" }, "validUntil": "2026-12-01T00:00:00+00:00", "canBuy": true }, "atRenewal": { "at": "2027-09-14T00:00:00+00:00", "plan": "scale", "planName": "Scale", "billingInterval": "annual", "addOns": [ { "kind": "nodePack", "quantity": 1 }, { "kind": "dedicatedDatabaseServer", "quantity": 1 } ] }, "dedicatedServerMovePending": false}No valid access token, or it no longer holds for the user (suspended, signed out, relation removed).
RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.
object
urn:contentsurface:problem:{code}.
A short summary for people; may change.
The HTTP status code.
What happened in this case, for people; may change.
The stable, machine-readable reason, such as version-mismatch; branch on this.
For validation-failed: the request field that is not valid.
For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.
For confirmation-required: what the change would affect, such as the users or folders losing access.
Example
{ "type": "urn:contentsurface:problem:unauthorized", "title": "Not authenticated.", "status": 401, "detail": "A valid access token is required.", "code": "unauthorized"}Authenticated but not allowed: a missing scope or role, an impersonated token on an admin endpoint, or an inactive tenant.
RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.
object
urn:contentsurface:problem:{code}.
A short summary for people; may change.
The HTTP status code.
What happened in this case, for people; may change.
The stable, machine-readable reason, such as version-mismatch; branch on this.
For validation-failed: the request field that is not valid.
For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.
For confirmation-required: what the change would affect, such as the users or folders losing access.
Example
{ "type": "urn:contentsurface:problem:role-required", "title": "Not allowed.", "status": 403, "detail": "This endpoint requires one of the roles: tenantAdmin.", "code": "role-required"}Absent: not existing, in another tenant, or not readable by the caller — never distinguished.
RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.
object
urn:contentsurface:problem:{code}.
A short summary for people; may change.
The HTTP status code.
What happened in this case, for people; may change.
The stable, machine-readable reason, such as version-mismatch; branch on this.
For validation-failed: the request field that is not valid.
For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.
For confirmation-required: what the change would affect, such as the users or folders losing access.
Example
{ "type": "urn:contentsurface:problem:not-found", "title": "Not found.", "status": 404, "detail": "The resource does not exist.", "code": "not-found"}Load protection: the tenant is making too many calls, or running too many searches or content streams, at once. Transient and never a quota; retry after Retry-After seconds.
RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.
object
urn:contentsurface:problem:{code}.
A short summary for people; may change.
The HTTP status code.
What happened in this case, for people; may change.
The stable, machine-readable reason, such as version-mismatch; branch on this.
For validation-failed: the request field that is not valid.
For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.
For confirmation-required: what the change would affect, such as the users or folders losing access.
Example
{ "type": "urn:contentsurface:problem:too-many-requests", "title": "Too many requests.", "status": 429, "detail": "The tenant is making more API calls than one replica serves at once; retry shortly.", "code": "too-many-requests", "retryAfter": 1}