---
title: "Resolve a waiting task run"
method: POST
path: "/task_runs/{id}/resolve"
tags: ["TaskRuns"]
---

# Resolve a waiting task run

`POST /task_runs/{id}/resolve`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/task_runs/{id}/resolve`
- Auth: API key in header `Authorization`

Typed resolution for a run paused in `needs_input`. `type: "approvals"` answers the run's pending integration approvals — the submitted set must exactly match `pending_approval_ids` on the run, or the request returns 409 `stale_resolution` (re-read the run and retry). `type: "input"` sends follow-up instructions into the run's chat and starts a new turn. `type: "complete"` closes the run as completed without resuming it. Returns 202 when the run resumes in the background (`approvals`, `input`) and 200 when resolved inline (`complete`). 409 `run_not_waiting` if the run is not in `needs_input`.

## Path parameters

- `id` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `type` 'approvals' | 'input' | 'complete', required: Which resolution flow to run.
  - `approvals` object[]: Required for `type: "approvals"`. One decision per pending approval; must cover the exact pending set.
    - `id` string, required: Approval id (apr_...)
    - `approved` boolean, required: true approves and replays the frozen action; false denies it.
    - `reason` string: Optional denial reason.
  - `message` string: Required for `type: "input"`. Follow-up instructions for the agent.

## Response `200`

Resolved inline (type `complete`).

- AiTaskRun
  - `id` string, required
  - `object` string, required
  - `task_id` string, required
  - `task_name` string, required
  - `chat_id` string, nullable, required: The run's own conversation (`aichat_...`): what it read, called and said. Read it with `search_chats`.
  - `status` 'pending' | 'running' | 'completed' | 'failed' | 'needs_input' | 'timed_out' | 'unknown' | 'skipped', required
  - `summary` string, nullable, required
  - `error_message` string, nullable, required
  - `test_run` boolean, required
  - `input_tokens` integer, required
  - `output_tokens` integer, required
  - `credits_consumed` integer, required
  - `tool_calls_count` integer, required
  - `duration_ms` integer, nullable, required
  - `started_at` string, date-time, nullable, required
  - `completed_at` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `skip_reason` 'condition' | 'no_paid_plan_or_credits' | 'no_recent_activity' | 'no_task_activity' | 'no_personal_sources' | 'wake_gate' | 'wake_limit' | 'rate_limited' | 'misfire' | 'task_busy' | 'account_at_capacity' | 'null', nullable, required
  - `skip_count` integer, required
  - `delivery_status` 'delivered' | 'not_delivered' | 'not_requested' | 'unknown', required
  - `completion` 'verified' | 'recorded' | 'recovered' | 'null', nullable, required: How the agent closed a completed run: `verified` (it re-checked the result), `recorded` (it reported without re-checking), or `recovered` (it never reported; `summary` is its last message). Null unless an agent turn completed the run.
  - `trigger_source` 'scheduled' | 'event' | 'manual', required
  - `trigger_event` object, nullable, required: The event that started this run, `{type, data}`, exactly as the run received it; `data` matches the event's webhook payload. Null for a run no event started. POST /task_runs/{id}/replay runs the task again on it.
  - `replay_of` string, nullable, required: The run (`trun_...`) whose event this run replays. Null unless started by POST /task_runs/{id}/replay.
  - `captured_deliveries` unknown[], required
    - unknown
  - `pending_approval_ids` unknown[], required
    - unknown

## Other responses

- `202`: Accepted — the run resumes in the background; poll GET /task_runs/{id} or open its stream.
- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Resource not found
- `409`: Conflict — the run is not waiting for input (`run_not_waiting`), the submitted approvals are stale (`stale_resolution`), or approvals must be resolved first (`approvals_pending`).
- `422`: Validation error
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.
- `500`: Internal server error

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
