Skip to content
Get started

Retrieve a worker

GET/api/workers/{workerId}

Retrieve the current worker state and messages from its most recent task (or a specific task via taskId).

Path ParametersExpand Collapse
workerId: string
Query ParametersExpand Collapse
taskId: optional string

Return the worker state and messages for a specific task instead of the most recent one.

minLength1
ReturnsExpand Collapse
Worker object { id, created_at, error, 13 more }
id: string
created_at: number
error: unknown
files: array of object { filename, mediaType, url, size }
filename: string
mediaType: string
url: string
size: optional number
minimum0
incomplete_details: unknown
messages: array of unknown
metadata: map[unknown]
object: "worker"
output: array of object { id, content, role, 2 more }
id: string
content: array of object { text, type }
text: string
type: "output_text"
role: "assistant"
status: "completed"
type: "message"
output_text: string
running: boolean
sources: array of object { id, title, type, url }
id: string
title: string
type: "url"
url: string
status: "running" or "completed" or "pending"
One of the following:
"running"
"completed"
"pending"
structured_output: map[unknown]
url: string

Web URL of the worker in the Handinger dashboard.

usage: optional object { credits, durationMs }
credits: optional number
minimum0
durationMs: optional number
minimum0

Retrieve a worker

curl https://handinger.com/api/workers/$WORKER_ID \
    -H "Authorization: Bearer $HANDINGER_API_KEY"
{
  "id": "id",
  "created_at": 0,
  "error": null,
  "files": [
    {
      "filename": "filename",
      "mediaType": "mediaType",
      "url": "url",
      "size": 0
    }
  ],
  "incomplete_details": null,
  "messages": [
    {}
  ],
  "metadata": {
    "foo": "bar"
  },
  "object": "worker",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "text": "text",
          "type": "output_text"
        }
      ],
      "role": "assistant",
      "status": "completed",
      "type": "message"
    }
  ],
  "output_text": "output_text",
  "running": true,
  "sources": [
    {
      "id": "id",
      "title": "title",
      "type": "url",
      "url": "url"
    }
  ],
  "status": "running",
  "structured_output": {
    "foo": "bar"
  },
  "url": "https://v3.handinger.com/worker/wrk_vk81XUHKHG-qr4",
  "usage": {
    "credits": 0,
    "durationMs": 0
  }
}
Returns Examples
{
  "id": "id",
  "created_at": 0,
  "error": null,
  "files": [
    {
      "filename": "filename",
      "mediaType": "mediaType",
      "url": "url",
      "size": 0
    }
  ],
  "incomplete_details": null,
  "messages": [
    {}
  ],
  "metadata": {
    "foo": "bar"
  },
  "object": "worker",
  "output": [
    {
      "id": "id",
      "content": [
        {
          "text": "text",
          "type": "output_text"
        }
      ],
      "role": "assistant",
      "status": "completed",
      "type": "message"
    }
  ],
  "output_text": "output_text",
  "running": true,
  "sources": [
    {
      "id": "id",
      "title": "title",
      "type": "url",
      "url": "url"
    }
  ],
  "status": "running",
  "structured_output": {
    "foo": "bar"
  },
  "url": "https://v3.handinger.com/worker/wrk_vk81XUHKHG-qr4",
  "usage": {
    "credits": 0,
    "durationMs": 0
  }
}