---
title: "Link relation"
method: POST
path: "/public/v1/objects/{name}/rows/{id}/relations/{relation}/link"
tags: ["Object relations"]
---

# Link relation

`POST /public/v1/objects/{name}/rows/{id}/relations/{relation}/link`

Links the target row to this row via the relation. Requires a USER API key.

## Path parameters

- `name` string, required
- `id` string, required — Row id (Mongo ObjectId)
- `relation` string, required

## Request body

- object
  - `target_id` string, required

## Response `200`

Updated row

- object
  - `ok` true, required
  - `data` object, required
    - `id` string
    - `auto_id` number
    - `created_at` string, nullable
    - `updated_at` string, nullable

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found

---

[API](https://skmtc.dev/getfrontline/apis/public-api.md) · [All operations](https://skmtc.dev/getfrontline/apis/public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/getfrontline/public-api/revisions/9d33b6aad674/schema)
