Skip to content

Owner: changes plan, interval or self-serve add-ons; a downgrade needs the impact token.

PUT
/v1/admin/billing/subscription
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).

confirm
string

The impactToken of the 409 answer, confirming its impact.

Example

Xq3vJm9KpL2wRt7YbN4cHd8sFg1eUa6o
If-Match
string

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"
Media typeapplication/json
One of:
null

Example

{
"plan": "scale",
"billingInterval": null,
"addOns": [
{
"kind": "nodePack",
"variant": null,
"quantity": 2
},
{
"kind": "dedicatedDatabaseServer",
"variant": null,
"quantity": 1
}
]
}

OK

Media typeapplication/json

The tenant’s licence and billing state.

object
plan
required

The plan: basic, pro or scale.

string
planName
required

Its display name.

string
planVersion
required

The version of the plan’s limits the licence is on.

integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
billingInterval
required

monthly or annual.

Allowed values: monthly annual
status
required

trialing, active, pastDue (a payment failed; Stripe retries) or canceled.

Allowed values: trialing active pastDue canceled
trialEndsAt
required

When the trial ends; null after it.

null | string format: date-time
validUntil
required

The end of the paid period, or of the trial.

string format: date-time
cancelAtPeriodEnd
required

True when the subscription ends at validUntil.

boolean
suspended
required

True while the tenant is suspended: only the owner may use the Portal, to pay.

boolean
addOns
required

The licence’s add-ons.

Array<object>

An add-on on the licence.

object
kind
required

nodePack, dedicatedDatabaseServer, multiAz, privateEmbedding or otherRegion.

Allowed values: nodePack dedicatedDatabaseServer multiAz privateEmbedding otherRegion
quantity
required

How many.

integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
callerIsOwner
required

True when the caller is the owner, who alone changes billing.

boolean
bandwidthPacks
required

This month’s bandwidth packs.

object
month
required

The current UTC month, YYYY-MM; packs bought now count in it and end with it.

string
packs
required

Packs bought this month.

integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
bytes
required

Their retrieval allowance, in bytes.

integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
bytesPerPack
required

One pack’s allowance: 50 GB.

integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
maxPerPurchase
required

The most packs in one purchase.

integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
price
required
One of:
null
validUntil
required

When packs bought now end: the end of the UTC month.

string format: date-time
canBuy
required

The licence is paid: a trial or an ended licence cannot buy packs.

boolean
atRenewal
required
One of:
null
dedicatedServerMovePending
required

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.

boolean

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.

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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).

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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.

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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.

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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.

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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).

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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.

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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.

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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.

Media typeapplication/problem+json

RFC 9457 problem details. code is the stable reason; confirmation problems add impact and impactToken.

object
type

urn:contentsurface:problem:{code}.

string
title

A short summary for people; may change.

string
status

The HTTP status code.

integer
detail

What happened in this case, for people; may change.

string
code

The stable, machine-readable reason, such as version-mismatch; branch on this.

string
field

For validation-failed: the request field that is not valid.

string
impactToken

For confirmation-required: repeat the call with ?confirm={impactToken} to go ahead.

string
impact

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
}