Create a typed lateral link from the source task ([taskId]) to another task in the same TENANT — the target may be in a different project (PT-909)
POST/api/projects/:id/tasks/:taskId/links
Create a typed lateral link from the source task ([taskId]) to another task in the same TENANT — the target may be in a different project (PT-909). The body either links an existing task ({ targetTaskId, linkType }) or creates a new follow-up task and links it ({ newTaskTitle, linkType }, status BACKLOG or the project default, reporter = caller — PT-479). Supported link types: BLOCKS | RELATES | DUPLICATES | CLONES | CAUSES | FOLLOWS. Both tasks must be in the same tenant. When the target is in a different project, the caller must also have access to that project; an unauthorized target and an absent one return the same 404, so the endpoint is not an existence oracle. The create-new branch also requires tasks.create.
Request
Responses
- 201
- 401
- 403
- 404
- 409
Successful response
Unauthorized — authentication credentials are missing or invalid
Forbidden — both intents require tasks.update.any; the create-new-follow-up variant ({ newTaskTitle }) additionally requires tasks.create.
Not Found — the target task does not exist in this tenant, or it is in a project the caller cannot access. Both cases return the same response deliberately, so the endpoint cannot be used to probe for the existence of tasks in projects the caller cannot see.
Conflict — a link with this (source, target, type) triple already exists