---
title: "Cancel the subscription, at the end of the billing period (default) or immediately."
method: POST
path: "/cancel"
tags: ["account"]
---

# Cancel the subscription, at the end of the billing period (default) or immediately.

`POST /cancel`

## Request

- Base URL: `https://api.coldrig.dev`
- URL: `https://api.coldrig.dev/cancel`
- Auth: HTTP bearer

HTTP-only (not an MCP tool). The body is optional; an empty body means `{ "immediate": false }`. Default (`immediate: false`): the account is marked `canceling` as soon as this call lands, campaigns already running keep sending until the paid period ends (see `sendingStopsAt` on GET /account), then all sending stops (an account that is not paid up stops sending at once), and mailboxes and domains are NOT released by this call (`teardown` is `null`). `immediate: true`: the account is marked `canceled`, campaigns are stopped, every mailbox is released right away and cannot be brought back, and domains we bought for you are released too (a connected domain is not touched); `teardown` counts what was released. Calling it again after an immediate cancel returns the recorded teardown with `alreadyCanceled: true` and releases nothing more. The dashboard Billing page calls this same route. The call tells Stripe before it changes the account: the default stops the subscription from renewing (`periodEndsAt` is the end of the paid period, from Stripe, when sending continues until then), and `immediate: true` ends the subscription at Stripe now with no proration, credit or refund. If Stripe refuses or gives no clear answer, nothing changes on the account and the call answers 502.

## Request body

- object
  - `immediate` boolean: false = end of the billing period (default); true = now.

## Response `200`

Cancellation recorded (or the earlier immediate cancel replayed).

- CancelResult: `effective` is `end_of_period` or `immediate`. `teardown` is `null` for an end-of-period cancel (nothing is released by that call) and the release summary for an immediate one. `periodEndsAt` is the end of the paid period as Stripe gave it when this call scheduled an end-of-period cancel that keeps running campaigns sending until then, and `null` otherwise (an immediate cancel, a repeated call, an account with no Stripe subscription, or one that was not paid up, which stops sending at once).
  - `alreadyCanceled` boolean, required
  - `billingState` string, required: `canceling` or `canceled` right after the call.
  - `effective` 'end_of_period' | 'immediate', required
  - `periodEndsAt` integer, nullable, required: Epoch milliseconds, from Stripe: when sending stops; `null` when this call stored no date.
  - `teardown` CancelTeardown, required: What an immediate cancel released. `mailboxReleaseFailures` counts mailboxes the provider refused to release; they are still live.
    - `reason` 'voluntary_cancel' | 'abuse_terminate', required
    - `effective` string, required
    - `domainsReleased` integer, required
    - `mailboxesReleased` integer, required
    - `mailboxReleaseFailures` integer, required
    - `campaignsStopped` integer, required
    - `annualDomainLiabilityCents` integer, required
    - `ts` integer, required: Epoch milliseconds.

## Other responses

- `400`: Request body failed schema validation.
- `401`: Missing, invalid, or inactive bearer token.
- `413`: Request body too large.
- `502`: Stripe refused the cancellation (`stripe_refused`) or gave no clear answer (`stripe_unknown`). The cancellation could not be confirmed with the billing provider. Repeat the call; repeating is safe.

---

[API](https://skmtc.dev/coldrig/apis/agent-cold-email-api.md) · [All operations](https://skmtc.dev/coldrig/apis/agent-cold-email-api/llms.txt) · [OpenAPI document](https://skmtc.dev/coldrig/apis/agent-cold-email-api/revisions/242a462d82c4?raw)
