---
title: "Cancel a workspace's subscription (or its deal), now or at period end"
method: POST
path: "/support/billing/{workspace_id}/cancel-subscription"
tags: ["Billing Actions Support"]
---

# Cancel a workspace's subscription (or its deal), now or at period end

`POST /support/billing/{workspace_id}/cancel-subscription`

## Request

- Base URL: `https://app.mammoth.io/api/v2`
- URL: `https://app.mammoth.io/api/v2/support/billing/{workspace_id}/cancel-subscription`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-KEY` and API key in header `X-API-SECRET` and API key in header `X-WORKSPACE-ID`

`now`: billing stops today, the unused time becomes credit on the customer (no refund) and the workspace lands on Free. `period_end`: the workspace keeps its plan until the paid period ends. A live deal is cancelled instead (a partner deal: `now` only). Refused when there is nothing to cancel, for a Chargebee workspace, and when a cancellation at period end is already scheduled.

## Path parameters

- `workspace_id` integer, required

## Request body

- CancelSubscriptionData
  - `when` 'now' | 'period_end', required

## Response `200`

Request fulfilled, document follows

- CancelOutcome
  - `message` string, required
  - `when` string, required
  - `effective_at` string, nullable
  - `deal_id` integer, nullable

## Other responses

- `400`: Bad request syntax or unsupported method
- `403`: Request forbidden -- authorization will not help

---

[API](https://skmtc.dev/mammoth/apis/mammoth-analytics.md) · [All operations](https://skmtc.dev/mammoth/apis/mammoth-analytics/llms.txt) · [OpenAPI document](https://skmtc.dev/mammoth/apis/mammoth-analytics/revisions/5dfd1c296ded?raw)
