Marks a contact unsubscribed. `:subscriber` is an id or email. Subscriber DELETE is disabled; this is the supported removal path. Permission: `subscribers`.

Idempotent: repeating the call on an already unsubscribed contact still returns 200.

## Path Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| `subscriber` | string | **Required.** Subscriber id or email. |

## Response Fields

| Field | Type | Description |
| ----- | ---- | ----------- |
| `message` | string | Confirmation text. |
| `id` | string | Subscriber id when present. |
| `email` | string | Email when present. |
| `status` | string | `UNSUBSCRIBED` when present. |

## Errors

| Status | `name` | When |
| ------ | ------ | ---- |
| 401 | `missing_api_key` | Missing or invalid bearer token |
| 403 | `missing_permission` | Token lacks the `subscribers` permission |
| 404 | `not_found` | Unknown id or email |

## Related

- [Get Subscriber](/docs/api-reference/v2/subscribers-get)
- [SDK: lumail.subscribers.unsubscribe](/docs/sdk/v2/subscribers-unsubscribe)


## API Reference
**Method:** POST
**Endpoint:** /api/v2/subscribers/:subscriber/unsubscribe

### SDK
```ts
import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.subscribers.unsubscribe(
  "user@example.com",
);
if (error) {
  throw error;
}
console.log(data.message);
```

### cURL
```bash
curl -X POST https://lumail.io/api/v2/subscribers/user@example.com/unsubscribe \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### JavaScript
```javascript
const response = await fetch(
  "https://lumail.io/api/v2/subscribers/user@example.com/unsubscribe",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_API_TOKEN",
    },
  },
);
const data = await response.json();
```

### Success Response
```json
{
  "message": "Subscriber unsubscribed successfully"
}
```

### Error Response
```json
{
  "name": "not_found",
  "message": "Subscriber not found",
  "statusCode": 404
}
```
