Cancel a subscription
Cancels at the end of the current paid period: the subscriber keeps what they already paid for, no refund. There is no immediate cancellation; atPeriodEnd: false returns 400. 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).
canceled subscription is a no-op. It returns the same result without hitting the card processor a second time. If the subscription never completed a first successful charge (stripeSubscriptionId is null), cancel returns 400. There is no immediate cancellation: atPeriodEnd: false also returns 400, and the subscription always runs to the end of the period the subscriber paid for.subscription.updated fires right away, when the call schedules the cancel. subscription.canceled fires when the period ends, on AgentaOS’s next check. A repeat call sends nothing. See Which action fires which event.Authorizations
Your secret key, from app.agentaos.ai -> Settings -> Developers -> API Keys. The key's prefix is both its identity and its environment: sk_test_... (sandbox, free, no verification) or sk_live_... (real money, requires business verification). A missing or invalid key returns 401.
Path Parameters
Subscription UUID (the id field from the list response, not stripeSubscriptionId).
Body
Only true is accepted, and it is the default: the cancellation is scheduled for the end of the current period. false returns 400; there is no immediate cancellation.
Response
The subscription's updated cancellation state.