Create a work item dependency
Add a dependency of one type between the work item in the path and each work item in work_item_ids. The type is named from the path work item's side: blocking on ENG-42 for ENG-17 means ENG-42 blocks ENG-17, so ENG-17 lists ENG-42 under blocked_by.
Two work items can have only one dependency between them, of any type and in either direction. A work item that already has a dependency with the path work item is skipped without an error, and its existing dependency stays as it was. The response is 201 with the path work item's whole dependencies map after the write, so check it to see what is linked.
The call is all or nothing on lookups: if any work item in work_item_ids isn't found, it returns 404 and creates no dependencies.
You need edit access to the path work item. Project admins, contributors, and workspace owners and admins have it. The other work items only need to be visible to you, and they can be in any project in the workspace.
Path parameters
slug:requiredstringThe workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.
project_id:requiredstringThe project the resource belongs to. Accepts the project UUID or its bare identifier, for example ENG.
work_item_id:requiredstringThe work item the resource belongs to. Accepts the work item UUID or its PROJ-123 identifier.
Body parameters
relation_type:requiredstringThe dependency type, from the path work item's side:
blocked_by: it can't start until the other one finishes.blocking: the other one can't start until this one finishes.start_before: it has to start before the other one starts.start_after: it can only start after the other one starts.finish_before: it has to finish before the other one finishes.finish_after: it can only finish after the other one finishes.
Any other value returns 400. All six are accepted on every plan.
work_item_ids:requiredarray of string (uuid)The work items on the other side of the dependency, from 1 to 100 UUIDs. PROJ-123 identifiers aren't accepted here. A repeated id counts once.
Every id must be a work item in the workspace that you can see. Archived, draft, and intake work items count as missing. One missing id fails the whole call with 404.
Scopes
projects.work_items.relations:write
Errors
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | relation_type is missing or isn't one of the six types, work_item_ids is missing, empty, or has more than 100 ids, or an id isn't a UUID. See errors[]. |
401 | unauthorized | Missing or invalid credentials. |
403 | forbidden | You can't edit this work item, or your token scope doesn't allow this. |
404 | not_found | No such workspace, project, or work item, you can't see the work item, or it's archived. |
404 | not_found | An id in work_item_ids isn't a work item you can see. Nothing is created. |
406 | not_acceptable | The Accept header asks for a representation the API can't produce. |
409 | governance_migration_in_progress | A governance migration is running in this workspace, so writes are paused. Retry after it finishes. |
413 | payload_too_large | The request body is over the size limit. |
415 | unsupported_media_type | The Content-Type isn't one this endpoint accepts. |
429 | rate_limited | Throttled. Honor the Retry-After header before retrying. |
curl -X POST \
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b/work-items/8c3d1f72-4a9e-4b65-9d20-6e1f3b7a5c48/dependencies/" \
-H "X-Api-Key: $PLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"relation_type": "blocking",
"work_item_ids": ["9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88"]
}'import requests
response = requests.post(
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b/work-items/8c3d1f72-4a9e-4b65-9d20-6e1f3b7a5c48/dependencies/",
headers={"X-Api-Key": "your-api-key"},
json={
"relation_type": "blocking",
"work_item_ids": ["9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88"],
},
)
print(response.json())const response = await fetch(
"https://api.plane.so/api/v2/workspaces/my-team/projects/4af68566-94a4-4eb3-94aa-50dc9427067b/work-items/8c3d1f72-4a9e-4b65-9d20-6e1f3b7a5c48/dependencies/",
{
method: "POST",
headers: {
"X-Api-Key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
relation_type: "blocking",
work_item_ids: ["9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88"],
}),
},
);
const data = await response.json();{
"blocking": ["9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88"],
"blocked_by": ["b51d7e09-8a3c-4f62-9e17-4c2a6d8f1b95"],
"start_after": [],
"start_before": ["6e2a9d47-1c5b-4f83-a7d0-3b8e4f1c9a62"],
"finish_after": [],
"finish_before": []
}{
"type": "invalid_request",
"code": "invalid_request",
"detail": "One or more fields failed validation.",
"errors": [
{
"field": "relation_type",
"code": "invalid_choice",
"message": "\"blocks\" is not a valid choice."
}
]
}
