# Set a thread's category

`POST /api/v1/threads/{id}/category`

Sets the thread's category by hand (v50; `category_source: user` — it stays when new messages arrive) or returns it to automatic with `auto` (recalculated from keywords and linked records). Categories come from the workspace settings (`/me` → `constants.mail_categories`). The thread's owner, the company owner or an admin may change it.

## Path parameters

| Field | Type | Description |
|---|---|---|
| `id` (required) | integer | Thread id. |

## Body

| Field | Type | Description |
|---|---|---|
| `category` (required) | string | Category key or `auto`. |

## Response

```json 200
{
  "ok": true,
  "thread": {
    "category": "teklif",
    "category_color": "#6b5bd6",
    "category_label": "Teklif / fiyat",
    "category_source": "user",
    "customer": "Alize Paketleme San. ve Tic. A.Ş.",
    "customer_id": 1,
    "id": 21,
    "last_at": "2026-10-08T09:42:43",
    "last_dir": "out",
    "n": 2,
    "opp": "Mevcut Müşteri — Yenileme · 2026",
    "opp_how": "manual",
    "opp_id": 31,
    "opp_note": "elle seçildi",
    "peer": "selin.dogan@alizepaketleme.example",
    "subject": "Numune ve fiyat teklifi",
    "suggested": false,
    "waiting": false
  }
}
```
