Skip to main content
POST
Replay a task run's event

Authorizations

Authorization
string
header
required

API key in the format: Bearer {api_token}

Headers

Idempotency-Key
string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Maximum string length: 255

Path Parameters

id
string
required

Task run id (trun_...) whose event to replay

Body

application/json
test_run
boolean

Replay as a test run: real research, but writes are refused and deliveries are captured on the run. Defaults to false.

Response

Accepted — the replay runs in the background on a new run; poll GET /task_runs/{id}.

id
string
required
object
string
required
task_id
string
required
task_name
string
required
chat_id
string | null
required

The run's own conversation (aichat_...): what it read, called and said. Read it with search_chats.

cancel_requested_at
string | null
required

When a stop was requested. The run stays running until it reaches its next step, then settles as cancelled.

status
enum<string>
required
Available options:
pending,
running,
completed,
failed,
needs_input,
timed_out,
unknown,
skipped,
cancelled
summary
string | null
required
error_message
string | null
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 | null
required
started_at
string<date-time> | null
required
completed_at
string<date-time> | null
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
skip_reason
enum<string> | null
required
Available options:
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
skip_count
integer
required
delivery_status
enum<string>
required
Available options:
delivered,
not_delivered,
not_requested,
unknown
completion
enum<string> | null
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.

Available options:
verified,
recorded,
recovered,
null
trigger_source
enum<string>
required
Available options:
scheduled,
event,
manual
trigger_event
object | null
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 | null
required

The run (trun_...) whose event this run replays. Null unless started by POST /task_runs/{id}/replay.

captured_deliveries
array
required
pending_approval_ids
array
required