---
title: "Create task relation"
method: POST
path: "/task-relation"
tags: ["Task Relations"]
---

# Create task relation

`POST /task-relation`

Link two tasks. Authorization is scoped to the source task's workspace.

## Request body

- object
  - `sourceTaskId` string, required
  - `targetTaskId` string, required
  - `relationType` 'subtask' | 'blocks' | 'related', required

## Response `200`

The created relation

- TaskRelation
  - `id` string, required
  - `sourceTaskId` string, required
  - `targetTaskId` string, required
  - `relationType` string, required — How the two tasks relate: `subtask`, `blocks`, or `related`.
  - `createdAt` string, date-time, required

## Other responses

- `400` — Invalid body
- `401` — Missing or invalid credentials
- `403` — No workspace access, or missing task:update permission
- `404` — Source or target task not found
- `409` — This relation already exists

## Changes

- **2026-08-24** `200744ae0bef` — 1 info
  - added the non-success response with the status `409`
- **2026-08-24** `08bbb5bedb5d` — 4 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - added the non-success response with the status `404`
- **2026-07-11** `32cece1ebe43` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/usekaneo/apis/kaneo-api/changes/task-relation/post.md)

---

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