Skip to content
Get started

Tasks

Run and inspect tasks against a worker.

Create a task
tasks.create(TaskCreateParams**kwargs) -> Worker
POST/api/tasks
Retrieve a task
tasks.retrieve(strtask_id) -> TaskRetrieveResponse
GET/api/tasks/{taskId}
List task turns
tasks.list_turns(strtask_id) -> TaskTurnList
GET/api/tasks/{taskId}/turns
Archive a task
tasks.delete(strtask_id) -> DeleteTaskResponse
DELETE/api/tasks/{taskId}
ModelsExpand Collapse
class CreateTask:
input: str
minLength1
budget: Optional[Literal["low", "standard", "high", "unlimited"]]

Compute budget the worker is allowed to spend on the task. Defaults to standard.

One of the following:
"low"
"standard"
"high"
"unlimited"
task_id: Optional[str]

Optional client-provided task id. Reuse this id to add turns to an existing task.

minLength1
worker_id: Optional[str]

Worker id the task belongs to. If omitted, a new worker is created on-the-fly using the input as instructions.

minLength1
class DeleteTaskResponse:
archived: bool
class Task:
id: str
completed_at: Optional[str]
created_at: str
created_by_user_id: Optional[str]
organization_id: str
status: Literal["pending", "running", "completed", 2 more]
One of the following:
"pending"
"running"
"completed"
"error"
"aborted"
title: str
totals: Totals

Aggregate credit spend, elapsed wall-clock, and number of turns across the task.

credits: int
duration_ms: int
turn_count: int
triggered_by: Literal["api", "email", "schedule", "ui"]
One of the following:
"api"
"email"
"schedule"
"ui"
url: str

Web URL of the task in the Handinger dashboard.

worker_id: str
class TaskTurnList:
items: List[Turn]
id: str
completed_at: Optional[str]
credits: int
duration_ms: int
files: List[File]

Files published by this turn.

filename: Optional[str]
media_type: str
url: str
formaturi
size: Optional[int]
minimum0
input: str
input_tokens: int
output_text: str
output_tokens: int
role: str
seq: int
started_at: str
status: str
structured_output: Optional[Dict[str, object]]

Structured JSON payload when the worker is configured with an output schema. null otherwise.

task_id: str
task_id: str
class Turn:
id: str
completed_at: Optional[str]
credits: int
duration_ms: int
files: List[File]

Files published by this turn.

filename: Optional[str]
media_type: str
url: str
formaturi
size: Optional[int]
minimum0
input: str
input_tokens: int
output_text: str
output_tokens: int
role: str
seq: int
started_at: str
status: str
structured_output: Optional[Dict[str, object]]

Structured JSON payload when the worker is configured with an output schema. null otherwise.

task_id: str
class TaskRetrieveResponse:
task: Task
id: str
completed_at: Optional[str]
created_at: str
created_by_user_id: Optional[str]
organization_id: str
status: Literal["pending", "running", "completed", 2 more]
One of the following:
"pending"
"running"
"completed"
"error"
"aborted"
title: str
totals: Totals

Aggregate credit spend, elapsed wall-clock, and number of turns across the task.

credits: int
duration_ms: int
turn_count: int
triggered_by: Literal["api", "email", "schedule", "ui"]
One of the following:
"api"
"email"
"schedule"
"ui"
url: str

Web URL of the task in the Handinger dashboard.

worker_id: str