Owner: changes plan, interval or self-serve add-ons; a downgrade needs the impact token.
const url = 'https://api.contentsurface.io/v1/admin/billing/subscription?confirm=Xq3vJm9KpL2wRt7YbN4cHd8sFg1eUa6o';const options = { method: 'PUT', headers: { 'If-Match': '"1"', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"plan":"scale","billingInterval":null,"addOns":[{"kind":"nodePack","variant":null,"quantity":2},{"kind":"dedicatedDatabaseServer","variant":null,"quantity":1}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url 'https://api.contentsurface.io/v1/admin/billing/subscription?confirm=Xq3vJm9KpL2wRt7YbN4cHd8sFg1eUa6o' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'If-Match: "1"' \ --data '{ "plan": "scale", "billingInterval": null, "addOns": [ { "kind": "nodePack", "variant": null, "quantity": 2 }, { "kind": "dedicatedDatabaseServer", "variant": null, "quantity": 1 } ] }'Changes the plan, interval or add-ons of a paid subscription; a field left out keeps the value the subscription renews with. Adding an add-on, more node packs, a higher plan or monthly → yearly applies at once and is invoiced at once for the rest of the period. Removing an add-on, fewer node packs, a lower plan or yearly → monthly applies at the renewal (atRenewal in the answer), with no credit; asking again for what the licence has now undoes it. Node packs need the dedicated database server (409 dedicated-server-required: list it in the same change), at most 9 (409 node-pack-limit); the server stays while node packs, Multi-AZ or another region remain. A change that lowers a limit answers 409 confirmation-required with the impact — such as more nodes than the new plan allows; repeat with ?confirm={impactToken}. A payment that fails answers 402 payment-failed: nothing is added until the invoice is paid, within 23 hours. The owner only (403 owner-only).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The impactToken of the 409 answer, confirming its impact.
Example
Xq3vJm9KpL2wRt7YbN4cHd8sFg1eUa6oHeader Parameters
Section titled “Header Parameters”The ETag of the version being changed. Required when the operation changes or deletes an administrative object; relation changes (PATCH …/members, …/labels, …/clients, …/agents) do not need it.
Example
"1"Request Body
Section titled “Request Body”A change of the subscription: the licence wanted from now on; a field left out keeps the value it renews with.
object
The plan: a higher one applies now, a lower one at the renewal.
The add-ons the owner buys, with their quantities, replacing the current ones: more apply now, fewer at the renewal.
An add-on and how many.
object
nodePack, dedicatedDatabaseServer or privateEmbedding.
Its variant; omitted, standard.
How many: up to 9 node packs, 1 of the others; 0 removes it at the renewal.
Example
{ "plan": "scale", "billingInterval": null, "addOns": [ { "kind": "nodePack", "variant": null, "quantity": 2 }, { "kind": "dedicatedDatabaseServer", "variant": null, "quantity": 1 } ]}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": null, "dedicatedServerMovePending": false}The request is not valid: a malformed ID, body, filter or parameter.
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:validation-failed", "title": "The request is not valid.", "status": 400, "detail": "Only node packs and private embedding are bought here; the other add-ons are sold by ContentSurface.", "code": "validation-failed", "field": "addOns"}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"}The payment for the change failed.
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:payment-failed", "title": "The payment for the change failed.", "status": 402, "detail": "Nothing was added. Pay the open invoice in the payment portal within 23 hours and the change applies; otherwise it lapses.", "code": "payment-failed"}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:node-pack-limit", "title": "The request conflicts with the current state.", "status": 409, "detail": "At most 9 node packs (10 million nodes more than the plan).", "code": "node-pack-limit"}If-Match does not match the current version.
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:version-mismatch", "title": "The resource has changed.", "status": 412, "detail": "If-Match does not match the current version; read it again and retry.", "code": "version-mismatch"}If-Match is missing.
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:if-match-required", "title": "If-Match is required.", "status": 428, "detail": "Send the ETag of the version you are changing in If-Match.", "code": "if-match-required"}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}