---
title: "Create a new relation between two tasks"
method: PUT
path: "/tasks/{taskID}/relations"
tags: ["task"]
---

# Create a new relation between two tasks

`PUT /tasks/{taskID}/relations`

Creates a new relation between two tasks. The user needs to have update permissions on the base task and at least read permissions on the other task. Both tasks do not need to be on the same project. Take a look at the docs for available task relation kinds.

## Path parameters

- `taskID` integer, required

## Request body

- ModelsTaskRelation
  - `created` string — A timestamp when this label was created. You cannot change this value.
  - `created_by` UserUser
    - `bot_owner_id` integer — BotOwnerID is the ID of the owning (human) user if this user is a bot. A non-zero value means this user is a bot and cannot authenticate via password.
    - `created` string — A timestamp when this task was created. You cannot change this value.
    - `email` string — The user's email address.
    - `id` integer — The unique, numeric id of this user.
    - `name` string — The full name of the user.
    - `updated` string — A timestamp when this task was last updated. You cannot change this value.
    - `username` string — The username of the user. Is always unique.
  - `other_task_id` integer — The ID of the other task, the task which is being related.
  - `relation_kind` 'unknown' | 'subtask' | 'parenttask' | 'related' | 'duplicateof' | 'duplicates' | 'blocking' | 'blocked' | 'precedes' | 'follows' | 'copiedfrom' | 'copiedto'
  - `task_id` integer — The ID of the "base" task, the task which has a relation to another.

## Response `201`

The created task relation object.

- ModelsTaskRelation
  - `created` string — A timestamp when this label was created. You cannot change this value.
  - `created_by` UserUser
    - `bot_owner_id` integer — BotOwnerID is the ID of the owning (human) user if this user is a bot. A non-zero value means this user is a bot and cannot authenticate via password.
    - `created` string — A timestamp when this task was created. You cannot change this value.
    - `email` string — The user's email address.
    - `id` integer — The unique, numeric id of this user.
    - `name` string — The full name of the user.
    - `updated` string — A timestamp when this task was last updated. You cannot change this value.
    - `username` string — The username of the user. Is always unique.
  - `other_task_id` integer — The ID of the other task, the task which is being related.
  - `relation_kind` 'unknown' | 'subtask' | 'parenttask' | 'related' | 'duplicateof' | 'duplicates' | 'blocking' | 'blocked' | 'precedes' | 'follows' | 'copiedfrom' | 'copiedto'
  - `task_id` integer — The ID of the "base" task, the task which has a relation to another.

## Other responses

- `400` — Invalid task relation object provided.
- `500` — Internal error

---

[API](https://skmtc.net/go-vikunja/apis/vikunja-api.md) · [All operations](https://skmtc.net/go-vikunja/apis/vikunja-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/go-vikunja/vikunja-api/revisions/feb3f68bbdf1/schema)
