Cancel the subscription at the end of the paid period
Schedules the workspace owner's subscription to end when the period they have already paid for does — cancel_at_period_end, never an immediate deletion.
The account STAYS ON ITS PAID PLAN until current_period_end: the billing summary keeps reporting that plan with cancel_at_period_end: true, and only drops to free when Stripe's customer.subscription.deleted arrives at the boundary. Render it as “your <plan> ends on <date>”, not as “you are on free”.
To reverse a pending cancellation, send the customer to the billing portal. enterprise is contracted and cannot be cancelled here.
The response reports what STRIPE accepted. plan on the billing summary is written by the customer.subscription.* webhook a moment later, so a summary fetched in the same breath may still report the old plan — render the value returned here and re-fetch the summary shortly after, rather than treating the lag as a failure.
Requires the billing:write scope. Accepts all three lanes: a session JWT (bounded by the caller's role on this workspace) or an il_* machine credential whose own scope set, workspace set and validity window cover it — both ceilings apply and neither can raise the other, so a credential carrying billing:write is still refused where the role does not permit it.
A credential with no scope record resolves to LEGACY_DEFAULT, which does NOT include billing:write — mint a key with it explicitly (POST /v2/workspaces/{id}/keys).
Request
- Base URL: https://api.infolang.ai
- URL: https://api.infolang.ai/v2/workspaces/{id}/billing/cancel
- Auth: one of:
- HTTP bearer
- HTTP bearer
- HTTP bearer
Path parameters
Response
The subscription after the cancel
Changes
No recorded changes to this operation across all 1 revision of this API.