Subscriptions

Cancel a subscription

Cancels at the end of the current paid period by default: the subscriber keeps what they already paid for, no refund. Pass atPeriodEnd: false to cancel immediately instead. Calling cancel again on an already-canceled subscription is a no-op. Returns 400 if the subscription never completed a first successful charge (stripeSubscriptionId is null).

post/gateway/subscriptions/{id}/cancel

Request

  • Base URL: https://api.agentaos.ai/api/v1
  • URL: https://api.agentaos.ai/api/v1/gateway/subscriptions/{id}/cancel
  • Auth: API key in header x-api-key

Path parameters

idstring uuid required

Subscription UUID (the id field from the list response, not stripeSubscriptionId).

Request body

atPeriodEndboolean

true schedules the cancellation for period end. false cancels now.

Response

The subscription's updated cancellation state.

status'incomplete' | 'incomplete_expired' | 'trialing' | 'active' | 'past_due' | 'canceled' | 'unpaid' | 'paused' required
currentPeriodEndstring date-time nullable required
cancelAtPeriodEndboolean required
effectiveCancelDatestring date-time nullable required

Changes

No recorded changes to this operation across all 1 revision of this API.