Owner: cancels at the end of the period.
const url = 'https://api.contentsurface.io/v1/admin/billing/cancel';const options = {method: 'POST', 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 POST \ --url https://api.contentsurface.io/v1/admin/billing/cancel \ --header 'Authorization: Bearer <token>'Cancels the subscription at the end of the paid period: the plan works until validUntil, then the licence ends; a change scheduled for the renewal is dropped with it. Only a paid subscription (409 not-subscribed). The owner only (403 owner-only).
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": "pro", "planName": "Pro", "planVersion": 3, "billingInterval": "annual", "status": "active", "trialEndsAt": null, "validUntil": "2027-09-14T00:00:00+00:00", "cancelAtPeriodEnd": true, "suspended": false, "addOns": [], "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": null, "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"}Conflicts with the current state, or needs confirmation (confirmation-required with impactToken).
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-subscribed", "title": "The request conflicts with the current state.", "status": 409, "detail": "Only a paid subscription is cancelled or resumed; a trial simply ends.", "code": "not-subscribed"}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}