Skip to main content

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

OK — an open request already existed; the idempotent re-mark returned it. Same body as the 201.