Skip to content

Request cooperative cancellation of a session task.

POST
/v1/sessions/{session_id}/tasks/{task_id}/cancel
curl --request POST \
--url https://app.everruns.com/api/v1/sessions/example/tasks/example/cancel
session_id
required
string

Session ID

task_id
required
string

Task ID

Task with cancel intent recorded

Media type application/json

A unit of background work owned by a session.

object
artifacts
Array<object>

Typed link to something the task produced.

object
name
required
string
path

Session VFS path, when the artifact lives in the session filesystem.

string | null
type
required

Artifact type: “file”, “url”, “session”, “pr”, etc.

string
url

External URL, when the artifact lives elsewhere.

string | null
attempt

Execution attempt, starting at 1. Incremented on re-attach.

integer format: int32
cancel_requested_at

Cooperative cancel intent. A flag, not a state.

string | null format: date-time
created_at
required
string format: date-time
display_name
required

Human-readable label.

string
error
One of:
null
finished_at
string | null format: date-time
heartbeat_at
string | null format: date-time
id
required

task_* public ID.

string
input_request
One of:
null
kind
required

Task kind: “subagent”, “external_agent”, “background_tool”, “monitor”, …

string
links

Cross-references owned by a task.

object
child_session_id

Child session, for subagent-shaped tasks. Full transcript lives there.

string | null
remote_task_id

Remote task ID, for tasks wrapping an external protocol task (A2A).

string | null
resource_ids

Session resources (sandboxes, browser sessions) this task holds.

Array<string>
progress
One of:
null
result_path

Machine result in the session VFS: /.tasks/{task_id}/result.json.

string | null
session_id
required

Owning session.

string
spec

Kind-specific input (instructions, tool args, external agent id).

object
started_at
string | null format: date-time
state
required

Lifecycle state of a session task.

Three classes: active (queued, running), interrupted (awaiting_input, resumable), terminal (succeeded, failed, canceled). Timeout and rejection are error.kind values on failed, not states.

string
Allowed values: queued running awaiting_input succeeded failed canceled
state_detail

Short live status line (“polling remote task”, “iteration 4/10”).

string | null
summary

Human-readable outcome.

string | null
updated_at
required
string format: date-time
wake_policy

When outbound task activity wakes the owning session’s agent.

string
Allowed values: silent on_terminal on_activity
worker_id
string | null
Example
{
"state": "queued",
"wake_policy": "silent"
}

Session or task not found