Create a task in a project
POST/api/projects/:id/tasks
Create a task in a project. Cross-field constraints: when isRecurring is true, recurrenceIntervalDays (1–365) is required and parentTaskId must be absent (subtasks cannot be recurring). PT-1020: the route probes for similar OPEN tasks inside the create transaction and creates only when duplicatesReviewed NAMES every candidate that probe finds; otherwise it answers 409 DUPLICATE_CANDIDATES with that list and creates nothing. Presence of the field is not sufficient — an absent, empty, stale or partial list is refused for the candidates it does not name. Resubmit listing exactly the keys/ids the 409 reported; that always converges. Subtask creates (parentTaskId present) are exempt from the guard.
Request
Responses
- 200
- 401
- 403
- 409
Successful response
Unauthorized — authentication credentials are missing or invalid
Forbidden — requires tasks.create permission
Two conflict variants, distinguished by code. PT-1020 DUPLICATE_CANDIDATES — similar OPEN tasks exist that this request did not acknowledge (subtasks included, title trigram similarity, scoped to what the caller may read). The probe runs inside the create transaction under a tenant lock, so candidates is what exists at insert time, and nothing was created. An acknowledgment must NAME every candidate found: an absent one covers nothing, [] covers nothing (it asserts only that the caller's own earlier search was empty), and a stale one that misses a task filed since is refused too. Review each candidate: adopt an existing task instead of creating a twin, or resubmit with duplicatesReviewed listing exactly the keys/ids in candidates, which is what converges. PT-968 CYCLE_CAPACITY_EXCEEDED — the write would take the target cycle past its targetPoints; resubmit with cycleCapacityOverrideReason to admit the breach (full semantics on the cycle-capacity description of the claim route).