Skip to content

Owner: cancels at the end of the period.

POST
/v1/admin/billing/cancel
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).

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

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"
}

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

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
}