> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ugc.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Subscription

> Cancel every account under this billing at the end of the current billing period

## Endpoint

```
POST https://api.ugc.inc/billing/cancel-subscription
```

## Overview

Cancel every active account under your billing. Each account keeps access until the end of the current billing period, then is reclaimed automatically. Individual accounts can be reactivated with [`/billing/reactivate-account`](/api-reference/endpoint/billing-reactivate-account) before that date.

## Request

No request body required.

## Response

<ResponseField name="data" type="object">
  <Expandable title="Response properties">
    <ResponseField name="message" type="string">
      Confirmation message
    </ResponseField>

    <ResponseField name="cancelled" type="number">
      Number of accounts marked for cancellation
    </ResponseField>

    <ResponseField name="cancel_at" type="string | null">
      ISO timestamp when the accounts will lose access, or null if no accounts were eligible
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.ugc.inc/billing/cancel-subscription \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```typescript React theme={null}
  import { UGCClient } from 'ugcinc';

  const client = new UGCClient({ apiKey: 'YOUR_API_KEY' });
  const response = await client.billing.cancelSubscription();

  if (response.ok) {
    console.log(`Cancelled ${response.data.cancelled} accounts`);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "ok": true,
    "code": 200,
    "message": "Success",
    "data": {
      "message": "All accounts will be cancelled at the end of the current billing period",
      "cancelled": 5,
      "cancel_at": "2026-05-01T00:00:00.000Z"
    }
  }
  ```
</ResponseExample>
