# Link a thread

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

`opp` changes the project (`opp_id`), `link` links a record (`kind`, `obj_id`), `unlink` removes a link, `dismiss` ignores a suggestion. Only the thread's owner, the company owner or an admin may change it.

## Path parameters

| Field | Type | Description |
|---|---|---|
| `id` (required) | integer | Thread id. |
| `action` (required) | string | Action. Values: `opp`, `link`, `unlink`, `dismiss` |

## Body

| Field | Type | Description |
|---|---|---|
| `opp_id` | integer | Project (`opp`). |
| `kind` | string | Record type (`link`/`unlink`). |
| `obj_id` | integer | Record id. |

## Response

```json 200
{
  "msg": "Yazışma projesi: Mevcut Müşteri — Yenileme · 2026.",
  "ok": true,
  "thread": {
    "companies": [
      {
        "contacts": [
          {
            "email": "selin.dogan@alizepaketleme.example",
            "id": 1,
            "name": "Selin Doğan"
          }
        ],
        "id": 1,
        "name": "Alize Paketleme San. ve Tic. A.Ş.",
        "role": "main"
      }
    ],
    "customer": "Alize Paketleme San. ve Tic. A.Ş.",
    "customer_id": 1,
    "id": 1,
    "last_at": "2026-10-01T15:06:59",
    "last_dir": "out",
    "linkables": [
      {
        "items": [
          {
            "id": 74,
            "label": "30.09.2026 · Call · Tanışma"
          }
        ],
        "kind": "visit",
        "klabel": "Ziyaret / görüşme"
      }
    ],
    "links": [],
    "may_edit": true,
    "messages": [
      {
        "at": "2026-09-30T17:06:59",
        "body": "Merhaba Deniz Bey,\n\nNumuneler bize ulaştı, hat denemesini perşembe yapacağız. Aylık 12 ton için güncel fiyatınızı paylaşabilir misiniz?\n\nİyi çalışmalar",
        "cc": "",
        "dir": "in",
        "from_addr": "selin.dogan@alizepaketleme.example",
        "from_name": "Selin Doğan",
        "hidden": false,
        "id": 1,
        "subject": "Numune ve fiyat teklifi",
        "to": "deniz@ornekkimya.com.tr"
      }
    ],
    "n": 2,
    "opp": "Mevcut Müşteri — Yenileme · 2026",
    "opp_how": "manual",
    "opp_id": 31,
    "opp_note": "elle seçildi",
    "opps": [
      {
        "id": 44,
        "name": "Müşteri Takibi",
        "open": true,
        "stage_label": "Müşteri Takibi"
      }
    ],
    "peer": "selin.dogan@alizepaketleme.example",
    "reply": {
      "contact_id": 1,
      "customer_id": 1,
      "in_reply_to": "<a2@mail.ornek>",
      "opp_id": 31,
      "subject": "Re: Numune ve fiyat teklifi",
      "to": "selin.dogan@alizepaketleme.example"
    },
    "subject": "Numune ve fiyat teklifi",
    "suggested": false,
    "suggestions": [
      {
        "date": "2026-09-30",
        "how": "",
        "id": 74,
        "kind": "visit",
        "klabel": "Ziyaret / görüşme",
        "label": "Call 30.09.2026",
        "nav": {
          "id": 74,
          "kind": "visit",
          "screen": "action"
        },
        "url": "/action/visit/74",
        "why": "yazışmayla aynı günlerde görüşme"
      }
    ],
    "waiting": false
  }
}
```
