Raise a decision request — an in-progress agent marks its task as awaiting a human decision (question + optional proposed options)
POST/api/projects/:id/tasks/:taskId/decision-request
Raise a decision request — an in-progress agent marks its task as awaiting a human decision (question + optional proposed options). At most one OPEN request exists per task; a re-mark while one is already open idempotently returns the existing row (HTTP 200) rather than creating a second one (HTTP 201 on genuine creation). Authorised as the task's CURRENT assignee — which under the INF-113 claim convention is a synthetic agent+<class>@constellation.local user rather than the token owner, so a caller driving that agent supplies the optional agentId body field naming it and the call then acts as that agent. Supplying it requires tasks.update.any (403 without), and the id must be an ACTIVE synthetic agent in this tenant — a human, suspended, soft-deleted or foreign-tenant id is rejected (400), so this delegates to a robot account and cannot impersonate a person. Omit it when the token itself is the assignee. Authorised only while the task is in an in_progress-category status AND is not already complete — a task counts as complete by ANY of a completed-category status, a stamped completedAt, or progress >= 100, because a task can be completed without its status saying so (progress-only completion). All re-validated authoritatively under a row lock, never trusted from client input. Never mutates task.status/assigneeId and never emits projects.task.unblocked. On first creation only, best-effort posts a task comment carrying the question.
Request
Responses
- 200
- 201
- 400
- 401
- 403
- 404
OK — an open request already existed; the idempotent re-mark returned it. Same body as the 201.
Successful response
Bad Request — malformed body, an agentId that fails the assignability check for this project (no Guest Customers) or is not an ACTIVE synthetic agent user in this tenant (a human, suspended, soft-deleted or foreign-tenant id), the acting identity is not the task's current assignee, the task is not in an in_progress-category status, or the task is already complete (a completed-category status, a stamped completedAt, or progress >= 100).
Unauthorized — no authenticated user.
Forbidden — the caller cannot read this project, supplied agentId without holding 'tasks.update.any' (acting as another identity is gated by the same permission claim-next-ready requires to claim FOR an agent), or the tenant wrapper rejected the request (an x-act-as-org override the caller is not an active member of, or no valid tenant context).
Task not found in this project.