Approve or decline a suspended tool call
Submits an approval decision for a task whose agent stream is suspended
waiting for user input (for example, plan_review or ask_question).
- approve: for
plan_review, executes the approved plan and continues in the same task stream. - decline: for
plan_review, requests a revision rather than cancelling the task. Interactive clients should send the pendingtool_call_idas correlation/reconciliation metadata and provide revision guidance inmetadata.feedback. The planner resumes all suspended iterations with that feedback and creates a revised plan that is also approval-gated. Interactive clients should requiremetadata.feedbackto be a string whose trimmed value is non-empty. - ask_question: continues to accept answers in
metadata.answers.
To cancel the task terminally, use POST /api/v1/tasks/{id}/abort;
a plan_review decline is not terminal cancellation.
For suspended streams, the endpoint atomically transitions the stream
from suspended to resuming (CAS guard) to prevent double-approve.
When the pending approval target is available, tool_call_id must
exactly match it and is validated in the same atomic transition;
mismatches are rejected. Legacy suspended tasks without a stored target
may still resume without this check.
For active streams with in-tool timeout approval (ask_question), the
endpoint forwards the decision to the Bun agent’s in-memory waiter.
Agent-side failures, including an approval target mismatch detected
after forwarding, are returned with HTTP 200 and
{success: false, error: "..."} so clients can inspect the response
body. HTTP 409 is reserved for the pre-forward no pending approval
guard.
Authorizations
JWT authentication token
Path Parameters
Task ID
Body
Decision payload for a pending tool call. For plan_review, approve
executes the approved plan in the same task stream, while decline asks
the planner to revise it using metadata.feedback. The revised plan
requires approval again. Terminal task cancellation uses the task abort
endpoint instead. ask_question answers remain supported in
metadata.answers.
Whether to approve or decline the pending tool call. Declining a
plan_review requests a revision; it does not cancel the task.
approve, decline Agent ID to resume (optional, resolved from stream metadata if omitted)
Additional data passed to the resumed tool. Use answers for
ask_question. For a declined plan_review, use feedback with
revision guidance; interactive clients should require a string
whose trimmed value is non-empty.
Agent run ID (optional, resolved from stream metadata if omitted)
Exact pending tool call to approve. When target metadata is available, this value is matched atomically with the suspended approval and a mismatch is rejected. It remains optional only for compatibility with legacy suspended tasks that have no stored target.
Response
Approval processing result. success: false reports an agent-side
failure such as a target mismatch without changing the HTTP 200 status.
Stable machine-readable reason when approval failed
approval_target_mismatch, approval_not_suspended, approval_invalid_feedback, approval_metadata_unavailable, approval_metadata_invalid, approval_expired, agent_not_found, redis_unavailable, approval_state_unavailable, active_stream_registration_failed, agent_unavailable Error message if approval failed
ID of the resumed stream

