Detaches tags from a contact. Emits `tag.removed` events. Permission: `subscribers`.

Pass `tags` as a JSON array in the query string.

## Path Parameters

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

## Query Parameters

| Name | Type | Description |
| ---- | ---- | ----------- |
| `tags` | string | **Required.** JSON array of tag names, e.g. `["customer"]`. |

## Response Fields

| Field | Type | Description |
| ----- | ---- | ----------- |
| `removedCount` | integer | Associations removed. |
| `message` | string | Optional status text. |

## 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 subscriber |
| 422 | `validation_error` | `tags` is not a JSON array of strings |

## Related

- [Add Subscriber Tags](/docs/api-reference/v2/subscribers-tags-add)
- [SDK: lumail.subscribers.removeTags](/docs/sdk/v2/subscribers-remove-tags)


## API Reference
**Method:** DELETE
**Endpoint:** /api/v2/subscribers/:subscriber/tags

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

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

### cURL
```bash
curl -X DELETE "https://lumail.io/api/v2/subscribers/user@example.com/tags?tags=%5B%22customer%22%5D" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### JavaScript
```javascript
const tags = encodeURIComponent(JSON.stringify(["customer"]));
const response = await fetch(
  `https://lumail.io/api/v2/subscribers/user@example.com/tags?tags=${tags}`,
  {
    method: "DELETE",
    headers: {
      Authorization: "Bearer YOUR_API_TOKEN",
    },
  },
);
const data = await response.json();
```

### Success Response
```json
{
  "removedCount": 1
}
```

### Error Response
```json
{
  "name": "validation_error",
  "message": "tags must be a JSON array of strings",
  "statusCode": 422
}
```
