# Add / remove a link

`POST /api/v1/objects/{key}/records/{id}/links`

Links the record to another record through a relation type (`act: add`) or removes the link (`act: remove`). On a single (N:1) relation the new target replaces the old one. The response is the updated record.

## Path parameters

| Field | Type | Description |
|---|---|---|
| `key` (required) | string | Object key. |
| `id` (required) | integer | Record id. |

## Body

| Field | Type | Description |
|---|---|---|
| `relation` (required) | string | Relation key (`/objects` → `relations[].key`). |
| `target_id` (required) | integer | Target record id. |
| `act` | string | Operation. Values: `add`, `remove` |

## Response

```json 200
{
  "ok": true,
  "record": {
    "active": true,
    "customer": {
      "id": 1,
      "name": "Alize Paketleme San. ve Tic. A.Ş."
    },
    "editable": true,
    "field_list": [
      {
        "display": "Ekstrüzyon",
        "key": "makine_tipi",
        "label": "Makine tipi",
        "options": [
          "Laminasyon"
        ],
        "required": true,
        "type": "select",
        "value": "Ekstrüzyon"
      }
    ],
    "fields": {
      "devreye_alma": "2025-04-01",
      "hiz": 220.0,
      "makine_tipi": "Ekstrüzyon"
    },
    "id": 1,
    "name": "Hat 3 — şişirme",
    "owner": "Deniz Aksoy",
    "owner_id": 1,
    "relations": [
      {
        "items": [
          {
            "id": 1,
            "name": "Alize Paketleme San. ve Tic. A.Ş."
          }
        ],
        "key": "co1_customer",
        "kind": "customer",
        "label": "Firma",
        "many": false,
        "side": "a",
        "target_label": "Firma"
      }
    ],
    "sub": "Ekstrüzyon · 220",
    "updated_at": "2026-10-06T10:26:24",
    "url": "https://ornek.solk.app/o/uretim_hatti/1"
  }
}
```
