Atomically claim a batch of pending jobs
POST /jobs/claim
Pulls up to limit pending jobs whose type is in the
types allowlist (omit types to claim any type the caller
is authorised to run). Each claimed job is marked running
with a lease — the worker must call /jobs/{id}/heartbeat
before the lease expires or the watchdog will requeue it.
Auth: any authenticated caller for now. A future phase adds a
worker token kind that scopes claim/complete/fail without
granting any read access elsewhere.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Body for POST /jobs/claim. types is the allowlist of job
types this worker is willing to run; omit to claim any.
worker_id is a stable string the server records in
claimed_by for diagnostic tracing.
object
Responses
Section titled “ Responses ”Claimed jobs (possibly an empty array)
object
Trimmed view of a Job that workers actually need to execute
the work. lease_seconds tells the worker how often to
heartbeat before the watchdog reclaims the job.
object
object
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}