Skip to content
Get started

Tasks

Run and inspect tasks against a worker.

Create a task
client.Tasks.New(ctx, body) (*Worker, error)
POST/api/tasks
Retrieve a task
client.Tasks.Get(ctx, taskID) (*TaskGetResponse, error)
GET/api/tasks/{taskId}
List task turns
client.Tasks.ListTurns(ctx, taskID) (*TaskTurnList, error)
GET/api/tasks/{taskId}/turns
Archive a task
client.Tasks.Delete(ctx, taskID) (*DeleteTaskResponse, error)
DELETE/api/tasks/{taskId}
ModelsExpand Collapse
type CreateTask struct{…}
Input string
minLength1
Budget CreateTaskBudgetOptional

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

One of the following:
const CreateTaskBudgetLow CreateTaskBudget = "low"
const CreateTaskBudgetStandard CreateTaskBudget = "standard"
const CreateTaskBudgetHigh CreateTaskBudget = "high"
const CreateTaskBudgetUnlimited CreateTaskBudget = "unlimited"
TaskID stringOptional

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

minLength1
WorkerID stringOptional

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

minLength1
type DeleteTaskResponse struct{…}
Archived bool
type Task struct{…}
ID string
CompletedAt string
CreatedAt string
CreatedByUserID string
OrganizationID string
Status TaskStatus
One of the following:
const TaskStatusPending TaskStatus = "pending"
const TaskStatusRunning TaskStatus = "running"
const TaskStatusCompleted TaskStatus = "completed"
const TaskStatusError TaskStatus = "error"
const TaskStatusAborted TaskStatus = "aborted"
Title string
Totals TaskTotals

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

Credits int64
DurationMs int64
TurnCount int64
TriggeredBy TaskTriggeredBy
One of the following:
const TaskTriggeredByAPI TaskTriggeredBy = "api"
const TaskTriggeredByEmail TaskTriggeredBy = "email"
const TaskTriggeredBySchedule TaskTriggeredBy = "schedule"
const TaskTriggeredByUi TaskTriggeredBy = "ui"
URL string

Web URL of the task in the Handinger dashboard.

WorkerID string
type TaskTurnList struct{…}
Items []Turn
ID string
CompletedAt string
Credits int64
DurationMs int64
Files []TurnFile

Files published by this turn.

Filename string
MediaType string
URL string
formaturi
Size int64Optional
minimum0
Input string
InputTokens int64
OutputText string
OutputTokens int64
Role string
Seq int64
StartedAt string
Status string
StructuredOutput map[string, any]

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

TaskID string
TaskID string
type Turn struct{…}
ID string
CompletedAt string
Credits int64
DurationMs int64
Files []TurnFile

Files published by this turn.

Filename string
MediaType string
URL string
formaturi
Size int64Optional
minimum0
Input string
InputTokens int64
OutputText string
OutputTokens int64
Role string
Seq int64
StartedAt string
Status string
StructuredOutput map[string, any]

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

TaskID string