v4

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-13216144508.7 KB
sdk-v1

Get Chat Task

Return a snapshot of one task's current state.

SDK clients call this to poll a previously-submitted task for its status, latest output, or failure reason. The shape is deliberately flat -- detailed step-by-step execution data lives behind GET /v1/chat/tasks/{task_id}/steps (commit F).

Args: task_id: Path parameter; the target task's primary key. authed: (Agent, AgentApiKey) tuple. db: SQLAlchemy session.

Returns: :class:TaskInfoResponse with task_id, agent_id, status, latest-turn input / output / error, created_at, and completed_at (set only when the task has reached a terminal state).

Raises: V1ApiError 401: missing / invalid / revoked key. V1ApiError 404: task missing or not owned by the calling agent.

get/v1/chat/tasks/{task_id}

Path parameters

task_idinteger required

Response

Successful Response

task_idinteger required
agent_idinteger required
statusstring required

One of: pending / running / paused / completed / failed.

inputstring nullable

Latest-turn user input. Null if no message yet recorded.

outputstring nullable

Latest-turn assistant output. Populated when status reaches 'completed'; null while running or pending.

errorstring nullable

Last failure reason when status='failed'.

created_atstring date-time required
completed_atstring date-time nullable

UTC timestamp when the task reached a terminal state (completed or failed). Null while still running.