POST
Claim a work item

Authorizations

Authorization
string
header
required

An environment key, aek_.... Only works on the worker routes of its own environment.

Headers

X-Worker-Hostname
string

The worker's host name, shown in the environment's worker list. At most 200 characters are kept.

Maximum string length: 200
X-Worker-Version
string

The worker's version (for example gizzi 2.4.0), shown in the environment's worker list.

Maximum string length: 200

Path Parameters

id
string
required
Example:

"env_0123456789abcdef01234567"

Body

application/json
worker_id
string
required

A stable name for this worker process. Shown in status.

Maximum string length: 200
block_ms
integer
default:0

How long to wait for work before answering 204.

Required range: 0 <= x <= 30000
reclaim_older_than_ms
integer

Also take a LIVE lease whose last renew was at least this many ms ago. Expired leases are always claimable without it. Values below 30000 are raised to 30000 (a healthy worker renews every 20 s). Values of 60000 or more add nothing.

Required range: x >= 0

Response

A work item, with a 60 second lease.

work_id
string
required
session_id
string
required
session_secret
string
required

Secret for this session only. Send it as X-Session-Secret on tool call routes. Valid until the lease ends. Never log it.

lease_generation
integer
required
lease_expires_at
string<date-time>
required
environment
object
required

The environment's rules, as they were when the work was claimed. The worker must enforce them.