# Delete a subscription

Source: https://langbot.ai/docs/api/webhooks/delete-subscription

`DELETE /v1/subscriptions/{sub_id}`

Stop a subscription and its webhook deliveries.

**Auth.** An API token: `Authorization: Bearer lb_…` ([create one](https://langbot.ai/app/tokens)). Signed-in web sessions work too.

**Limits.** Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).

## Parameters

### Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `sub_id` | string | yes | The subscription id (`sub_…`). |

## Request

**curl**

```bash
curl -X DELETE "https://api.langbot.ai/v1/subscriptions/sub_01J9" \
  -H "Authorization: Bearer $LANGBOT_API_TOKEN"
```

**Python**

```python
from langbot import LangbotClient

async with LangbotClient() as lb:  # reads LANGBOT_API_TOKEN
    await lb.delete_subscription("sub_01J9")
```

**TypeScript**

```ts
import { LangbotClient } from "@langbotai/sdk";

const lb = new LangbotClient(); // reads LANGBOT_API_TOKEN
await lb.deleteSubscription("sub_01J9");
```

## Response

`204 No Content`

## Errors

| Status | `code` | When |
|---|---|---|
| 404 | `not_found` | No subscription with that id on your account. |
| 401 | `auth_required` | No token was sent. |
| 401 | `token_invalid` | The token was not recognised (mistyped, revoked or expired). |
| 422 | `validation_error` | A parameter failed validation; `detail[].loc` names it. |
| 429 | `rate_limited` | Over your request budget; wait `Retry-After` seconds. |

Every error body is `{"detail": …, "code": "…"}`; branch on `code`. All codes: [Errors](https://langbot.ai/docs/api#errors).
