Skip to content

List jobs

GET
/api/tenants/{tenant}/jobs
curl --request GET \
--url 'http://127.0.0.1:9090/api/tenants/acme/jobs?limit=50' \
--header 'Authorization: Basic <credentials>' \
--header 'X-Request-Id: 4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f'

The newest jobs first, each with how many of its devices are in each state (counts). The devices themselves are not listed: get one job for those.

tenant
required
string

The tenant’s id.

Example
acme
limit
integer

How many jobs, newest first: 1 to 500, 500 unless given (0 counts as 1, more than 500 as 500).

Example
50
X-Request-Id
string
<= 128 characters /^[A-Za-z0-9._:-]+$/

An id to follow the request by: answered back in X-Request-Id, and in the log, the audit trail and the events the request causes. 1 to 128 letters, digits, -, _, . or :; anything else is replaced by a new id.

Example
4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f

At most limit jobs, newest first, without their devices.

Media typeapplication/json
Array

A job as the API shows it: the job, how many of its devices are in each state, and, for one job, every device.

object
abort_seen

How many devices had failed when the abort threshold last paused it: once resumed, it pauses again only on a new failure.

integer format: int32
created_at
required

When it was created.

string format: date-time
created_by
required

Who created it: the admin login, token:<name> for an API token, or local when no login is configured.

string
finished_at

When it was completed, or cancelled with nothing left running.

string | null format: date-time
id
required

The job’s id.

integer format: int64
matched
required

Devices the targets matched (each has an execution).

integer format: int32
missing

Devices listed in targets.devices that are not known or not allowed.

Array<string>
reason

Why it is as it is, when that is worth saying: what paused it, what it waits for.

string | null
spec
required

The job as it was asked for, defaults filled in.

object
abort
One of:
null
action
required

What each device runs: a standard action its package offers, or a package action or command (firmware upgrades are package actions).

string
lane

The lane each device’s action queues in: interactive (the default) or bulk.

string
Allowed values: interactive bulk
name

A name for people to know it by (not unique).

string
params

The action’s parameters, by name. None may be one the package marks sensitive: a job keeps its parameters to start each device’s action.

object
rollout

How the devices are taken on. One wave of every device, advancing on its own, unless said.

object
advance

auto (the default): the next wave starts once every device of the current one succeeded. manual: only when told (POST /api/tenants/{tenant}/jobs/{id}/advance).

string
Allowed values: auto manual
max_concurrent

Devices running at once, at most (1 or more). Absent: no limit beyond the wave.

integer | null format: int32
waves

The size of each wave, in order: a count (5) or a share of all the devices (“10%”, rounded up). Devices left over after the last make one more wave. Absent: one wave of every device.

Array
targets
required

Which devices it runs on.

object
devices

Devices by “endpoint/device”.

Array<string>
endpoints

The endpoints whose allowed devices it runs on (with select, those it picks). Absent: every endpoint, when select is given.

Array<string>
select

A selector over the devices’ labels (docs/selectors.md): site = north and floor in (1, 2).

string | null
timeout

How long each device has, from when its action is started, in seconds (a file or body may also say “90s”, “30m”, “2h”, “1d”); any positive duration. At that instant its action expires: its steps not handed out are cancelled, those in the device’s hand are given up on (unanswered, each with its event), and the device is timed_out. Absent: no deadline. The device’s action waits until the device answers, its commands are lost (by order, or a restart), or the action is cancelled or given up on.

integer format: int64
window
One of:
null
state
required

Where a job stands: running (devices are started as the rollout allows), paused (no device is started; those running go on to their end), cancelled (stopped for good: devices not started never will be) or completed (every device has finished).

string
Allowed values: running paused cancelled completed
tenant

The tenant it is of: it runs on that tenant’s devices only.

string
updated_at
required

When it last changed.

string format: date-time
wave
required

The current wave, from 0: devices of this wave and those before it may start.

integer format: int32
waves
required

How many waves it has.

integer format: int32
counts
required

How many of its devices are in each state.

object
cancelled
required

Devices cancelled: with the job, or their action was cancelled.

integer format: int32
failed
required

Devices whose action failed or could not be started.

integer format: int32
queued
required

Devices whose wave has not started, or that wait for room.

integer format: int32
running
required

Devices whose action is started.

integer format: int32
succeeded
required

Devices whose action succeeded.

integer format: int32
timed_out
required

Devices whose action did not finish within the job’s timeout.

integer format: int32
waiting_window
required

Devices whose turn it is, waiting for their window to open.

integer format: int32
executions

Every device of the job, in seq order. Absent in the list of jobs.

Array<object> | null

One device’s part in a job.

object
action_id

The action started on it (the latest attempt’s).

integer | null format: int64
attempt
required

1, then one more for each retry-failed that took it again.

integer format: int32
detail

What went wrong, for one that failed, timed out or was cancelled (the step its action stopped at, counted from 1); what it waits for, for one waiting for its window (“waiting for window (opens 2026-10-04 22:00 America/Chicago)”).

string | null
device
required

The device’s id.

string
endpoint
required

The device’s endpoint.

string
finished_at

When it finished (the latest attempt).

string | null format: date-time
held

Shown, not kept: the device is held (a gate of an action did not pass, and its outgoing queue waits for a release).

boolean
seq
required

Its place among the job’s devices, from 0.

integer format: int32
started_at

When its action was started (the latest attempt’s).

string | null format: date-time
state
required

Where one device stands in a job: queued (its wave has not started, or there is no room yet under max_concurrent), waiting_window (its turn, but the window is closed where it is), running (its action is started), succeeded, failed (its action failed, a step went unanswered, or it could not be started), timed_out (its action did not finish within the job’s timeout) or cancelled (the job was cancelled, or its action was).

string
Allowed values: queued waiting_window running succeeded failed timed_out cancelled
wave
required

Its wave, from 0.

integer format: int32
zone

The zone its window is read in: its endpoint’s timezone option, else its sync group’s timezone setting. Absent: it has none, and UTC is used.

string | null
no_zone

How many of its devices have no zone of their own: their window is read in UTC. Always 0 in the list of jobs.

integer format: int32
Example
[
{
"abort_seen": 0,
"counts": {
"cancelled": 0,
"failed": 0,
"queued": 0,
"running": 0,
"succeeded": 2,
"timed_out": 0,
"waiting_window": 0
},
"created_at": "2026-01-15T16:55:00Z",
"created_by": "admin",
"finished_at": "2026-01-15T17:01:10Z",
"id": 7,
"matched": 2,
"no_zone": 0,
"spec": {
"abort": {
"after": 5,
"failed_percent": 20
},
"action": "show_message",
"lane": "interactive",
"name": "Evening notice, north site",
"params": {
"minutes": 60,
"text": "The clocks restart at 22:00"
},
"rollout": {
"advance": "auto",
"max_concurrent": 10,
"waves": [
1,
"50%"
]
},
"targets": {
"endpoints": [
"office"
],
"select": "site = north"
},
"timeout": 1800,
"window": {
"days": [
"mon",
"tue",
"wed",
"thu",
"fri"
],
"hours": "17:00-21:00"
}
},
"state": "completed",
"updated_at": "2026-01-15T17:01:10Z",
"wave": 1,
"waves": 2
}
]

A login is configured and the request carries neither it nor an API token, or it carries a wrong login (WWW-Authenticate: Basic realm="Hour Advantage", no body). Or the request carries an API token that is not one (revoked, or never made), login or not (WWW-Authenticate: Bearer realm="Hour Advantage", error="invalid_token", the body the API token was refused).

Media typetext/plain
string
Example
the API token was refused
WWW-Authenticate
string

The scheme to answer with: Basic realm="Hour Advantage", or for a refused token Bearer realm="Hour Advantage", error="invalid_token".

The Host header does not name a loopback address while one is required (no login configured, or the API listens on loopback), or the Origin header does not match the Host: {"error": ...} says which. Or no login is configured and the request carries Forwarded, X-Forwarded-For or X-Real-IP (a proxy forwarded it): the plain text body says so. Or an API token asks for a route its scope does not reach: the plain text body says so.

A refusal, and why.

object
error
required

Why the request was refused, in a sentence.

string
fields

For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.

Array<object>

What is wrong with one field of a request.

object
field
required

The parameter, as the request names it (values.volume for a setting inside values).

string
message
required

What is wrong with it.

string
request_id

The request’s id, as its X-Request-Id header gives it: what to quote when asking what happened to it.

string | null
Example
{
"error": "the Host must name this machine (localhost or a loopback address); an API reached by other names needs the admin login"
}

More than 2 admin logins are being checked at once: send the request again after the Retry-After seconds. A request carrying the login that checked out last, or an API token, is not held up.

Media typetext/plain
string
Example
too many logins at once; try again
Retry-After
integer

Seconds to wait: 1.

Something went wrong in the gateway that asking again will not put right by itself; error says what.

Media typeapplication/json

A refusal, and why.

object
error
required

Why the request was refused, in a sentence.

string
fields

For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.

Array<object>

What is wrong with one field of a request.

object
field
required

The parameter, as the request names it (values.volume for a setting inside values).

string
message
required

What is wrong with it.

string
request_id

The request’s id, as its X-Request-Id header gives it: what to quote when asking what happened to it.

string | null
Example
{
"error": "db error: ERROR: permission denied for table settings"
}

The database cannot be used right now (not reachable, too busy, no connection free in time), or the instance is still starting: send the same request again shortly. An API token that cannot be checked for the same reason is answered 503 in plain text (the API token cannot be checked right now; try again shortly).

Media typeapplication/json

A refusal, and why.

object
error
required

Why the request was refused, in a sentence.

string
fields

For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.

Array<object>

What is wrong with one field of a request.

object
field
required

The parameter, as the request names it (values.volume for a setting inside values).

string
message
required

What is wrong with it.

string
request_id

The request’s id, as its X-Request-Id header gives it: what to quote when asking what happened to it.

string | null
Example
{
"error": "the gateway is starting; try again shortly"
}