API reference · Serverless
List jobs of an endpoint, newest first
/v1/serverless/endpoints/{endpoint_id}/jobs- TypeScript
client.serverless.listJobs()- Python
client.serverless.list_jobs()- CLI
hayonix serverless jobs
Jobs without their input or attempt history (fetch one job for those). Filter by state to find queued or failed jobs.
Project API key (Authorization: Bearer sk_…), or a console session. Requires the serverless_endpoint:read permission (a key's scope, or a role that includes it).
Examples
The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.
curl -sS "$API_BASE_URL/serverless/endpoints/sep_01jc5zq4m8k3v6x9t2w7r0b1e4/jobs" \
-H "Authorization: Bearer $API_KEY"Request
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
X-Project-Id | session only | The project to act in, for console sessions. Requests with an API key leave it out. |
Path parameters
endpoint_idstringrequiredID of the endpoint
ID with prefix sep_
Query parameters
limitinteger1–200, default 50
1–200
cursorstring`next_cursor` of the previous page
up to 200 characters
statestringOnly jobs in this state
One of
queuedrunningsucceededfailedtimed_outcanceledexpired
Response
200 a page of results — A page of jobs
The items of this page.
ShowHide 25 fields of
dataobjectstringrequiredAlways `serverless_job`: the type of this object
One of
serverless_jobidstringrequiredUnique ID (`sjb_…`)
ID with prefix sjb_
endpoint_idstringrequiredID of the endpoint
ID with prefix sep_
statestringrequired`queued`: waiting for a worker. `running`: a worker is on it. Final states: `succeeded` (result in `output` or `output_url`), `failed` (the handler reported an error, or retries ran out after lost workers; see `error`), `timed_out` (ran past its execution deadline), `canceled` (by request, a purge or the endpoint being deleted), `expired` (not started within its queue TTL).
One of
queuedrunningsucceededfailedtimed_outcanceledexpiredoutputany JSONThe handler result (inline results)
output_urlstring | nullrequiredTime-limited link to a large result kept in object storage
output_bytesinteger | nullrequiredSize of the result in bytes; null until there is one
ShowHide 3 fields of
errorcodestringrequiredMachine-readable code
messagestringrequiredOne sentence for people
detailsany JSONExtra JSON the handler reported with the error, if any
progressany JSONThe latest progress the handler reported (any JSON); null when none
attemptintegerrequiredHow many times a worker has taken the job (0 while it has never started)
retriesintegerrequiredTimes the job was re-queued because its worker was lost
max_retriesintegerrequiredRetries allowed before the job fails with `worker_lost`
worker_idstring | nullrequiredID of the worker
release_idstring | nullrequiredID of the release
queue_delay_msinteger | nullrequiredMilliseconds from submission until a worker first took the job; null while it has never started
execution_msinteger | nullrequiredMilliseconds the last attempt ran, from its start to the end of the job; null until the job finishes after starting
created_atstring (date-time)requiredWhen it was created (ISO 8601, UTC)
started_atstring (date-time) | nullrequiredWhen it started (null until then) (ISO 8601, UTC)
finished_atstring (date-time) | nullrequiredWhen it finished (null until then) (ISO 8601, UTC)
queue_expires_atstring (date-time)requiredTime queue expires (ISO 8601, UTC)
execution_deadlinestring (date-time) | nullrequiredWhen the current attempt times out; null while the job waits in the queue
result_expires_atstring (date-time) | nullrequiredTime result expires (ISO 8601, UTC)
result_expiredbooleanrequiredTrue once the result has been deleted after `result_expires_at`
inputany JSONThe submitted input. Only when fetching one job (`GET /serverless/jobs/{job_id}`).
attempt_historyarray of objectFinished attempts, oldest first. Only when fetching one job (`GET /serverless/jobs/{job_id}`).
ShowHide 5 fields of
attempt_historyattemptintegerrequiredAttempt number, from 1
worker_idstring | nullrequiredID of the worker
started_atstring (date-time) | nullrequiredWhen it started (null until then) (ISO 8601, UTC)
ended_atstring (date-time) | nullrequiredWhen it ended (null until then) (ISO 8601, UTC)
outcomestringrequired`succeeded`, `failed`, `timed_out`, `canceled`, `returned` (handed back by the worker) or `worker_lost`
next_cursorstring | nullrequiredPass as `cursor` for the next page; null on the last page.
Example response
{
"data": [
{
"object": "serverless_job",
"id": "sjb_01jc5zq4m8k3v6x9t2w7r0b1e4",
"endpoint_id": "sep_01jc5zq4m8k3v6x9t2w7r0b1e4",
"state": "queued",
"output": {},
"output_url": "string",
"output_bytes": 1,
"error": {
"code": "string",
"message": "string",
"details": {}
},
"progress": {},
"attempt": 1,
"retries": 1,
"max_retries": 1,
"worker_id": "string",
"release_id": "string",
"queue_delay_ms": 1,
"execution_ms": 1,
"created_at": "2026-01-01T00:00:00.000Z",
"started_at": "2026-01-01T00:00:00.000Z",
"finished_at": "2026-01-01T00:00:00.000Z",
"queue_expires_at": "2026-01-01T00:00:00.000Z",
"execution_deadline": "2026-01-01T00:00:00.000Z",
"result_expires_at": "2026-01-01T00:00:00.000Z",
"result_expired": true,
"input": {},
"attempt_history": [
{
"attempt": 1,
"worker_id": "string",
"started_at": "2026-01-01T00:00:00.000Z",
"ended_at": "2026-01-01T00:00:00.000Z",
"outcome": "string"
}
]
}
],
"next_cursor": "string"
}Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
400 | invalid_request_error | A parameter or body field is missing or not allowed; param names it. |
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
404 | not_found_error | No such resource in this project (an ID from another project is answered the same way). |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |