Skip to content
Kapten
Esc
↑↓navigate↵open⌘Jpreview

Cancel the subscription

Requires organization:update. Returns the URL of the Stripe Customer Portal’s cancellation page. Answers 404 without a current subscription, and 409 when it is already set to be canceled.

POST/organizations/{organizationId}/billing/subscription/cancel
Authorization
AuthorizationBearer token (JWT) · headerrequired

An access token issued by this service (RFC 9068), in the Authorization header as Bearer <token>.

Path parameters
organizationIdstring<uuid>required
Request body
requiredapplication/json
return_urlstring<uri>required

A console URL Stripe returns to.

Responses
200

The Stripe page to open.

urlstring<uri>required
default

The request failed.

errorstringrequired

Stable machine-readable code.

Allowed:invalid_requestunauthorizedforbiddennot_foundconflictgoneunavailableinternal
messagestringrequired

Human-readable explanation.

Request
curl -X POST 'https://auth.kapten.io/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/billing/subscription/cancel' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "return_url": "http://example.com"
}'
Response
{
  "url": "http://example.com"
}