API Documentation
Add relation
Description
Adds a relation from a task to another task. The task in the URL must be on the same board as the API token. The API token needs to have the Update tasks permission.
If the related task is on another board, you also need an API token for that board. It is sent as a X-Target-Authorization header in the request. It is constructed in the same way as the regular Authorization header, but with the related task's board's API token. That API token also needs to have the Update tasks permission. Both boards must belong to the same organization. If one of the tokens is a personal API token, the other token must be a personal API token of the same user.
Request format
curl -X POST https://kanbanflow.com/api/v1/tasks/<TASK_ID>/relations -H "Content-type: application/json"
-d '{ "<PROPERTY_1>": <PROPERTY_VALUE_1>, "<PROPERTY_2>": <PROPERTY_VALUE_2> }'Example request
curl -X POST https://kanbanflow.com/api/v1/tasks/T3s6UGyzY/relations -H "Content-type: application/json"
-d '{ "relatedTaskId": "QuAzRUx8", "relationType": "dependsOn" }'Example request with related task on another board
curl -X POST https://kanbanflow.com/api/v1/tasks/T3s6UGyzY/relations -H "Content-type: application/json"
-H "X-Target-Authorization: Bearer 55d24f7baedb75b03d1f168aee6466a7"
-d '{ "relatedTaskId": "7HPu4D9Q", "relationType": "relatesTo" }'Valid properties
| Property | Type | Comment |
|---|---|---|
| relatedTaskId | String | Required. The ID of the related task. |
| relationType | String | Required. Can be either "relatesTo" (Relates to), "dependsOn" (Depends on) or "requiredBy" (Required by). The relation type is seen from the perspective of the first task in the URL, in the same way as in Get relations. |