Read the audit trail
const url = 'http://127.0.0.1:9090/api/audit?after=512&limit=100&user=token%3Adeploy&tenant=acme&action=POST%20%2Fapi%2Ftokens&since=2026-01-15T00%3A00%3A00Z&until=2026-01-16T00%3A00%3A00Z&request_id=3f2a9c1e';const options = { method: 'GET', headers: { 'X-Request-Id': '4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f', Authorization: 'Basic <credentials>' }};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://127.0.0.1:9090/api/audit?after=512&limit=100&user=token%3Adeploy&tenant=acme&action=POST%20%2Fapi%2Ftokens&since=2026-01-15T00%3A00%3A00Z&until=2026-01-16T00%3A00%3A00Z&request_id=3f2a9c1e' \ --header 'Authorization: Basic <credentials>' \ --header 'X-Request-Id: 4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f'The changes made through this API, oldest first, a page at a time: who made each one, on which instance, what it
did, and the request with its passwords, keys and secrets taken out (a secret’s request is never kept, and
sensitive values, such as PINs, card numbers, templates and photos, are kept only as their size). Every request
that changes something
and succeeds is recorded, and so is every wire capture started; requests that fail, reads, scenario runs, events
posted (data, as a device’s messages are) and the instances’ own calls to each other are not. Entries are kept for ever, or for audit_retention_days when that
setting is set. To read on, pass the answer’s next as after; a page with no entries means you have read them
all, and next stays where it was. The filters (user, tenant, action, since, until, request_id) hold
together, each from an index.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Only entries after the one with this seq: the next of the page
before. Default 0, from the oldest kept.
Example
512At most this many entries: 100 unless given, at most 1000 (more is read as 1000).
Example
100Only changes made by this user: the login’s name, token:<name>, or local.
Example
token:deployOnly changes whose request named this tenant in its path (/api/tenants/<tenant>/..., or
/api/attendance/tenants/<tenant>/...).
Example
acmeOnly changes whose action (method and path, POST /api/sinks) starts with this.
Example
POST /api/tokensOnly changes made at or after this time (RFC 3339).
Example
2026-01-15T00:00:00ZOnly changes made before this time (RFC 3339): later than since.
Example
2026-01-16T00:00:00ZOnly the change made by the request with this id (X-Request-Id).
Example
3f2a9c1eHeader Parameters
Section titled “Header Parameters”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-3a6b8d0c1e7fResponses
Section titled “Responses”A page of the audit trail, oldest first.
A page of the audit trail.
object
The entries, oldest first.
One change made through the admin API, or one the gateway made itself: written before the change is made, and finished once it
has been (outcome).
object
The request’s method and path: “POST /api/sinks”; for a change the
gateway made itself, its name for it (“job.paused”) and the user is
houradvantage.
When the change was made.
The request body, as JSON text, with passwords, keys and secrets
taken out and sensitive values kept only as their size; the first
64 KiB of it at most, a longer one cut and ended with ...[cut: N of M bytes kept]. Absent when there was none, or for a secret.
The address the request came from: the connection’s, or, when that
is one of the trusted_proxies, the address it forwarded. Absent
for a change the gateway made itself.
The gateway instance that made it.
How far the change got: started (it may have happened: the entry was written before it, and not finished), done or
failed. Entries from before outcomes were kept are done.
The id of the admin API request that made it (its X-Request-Id).
Absent for a change the gateway made itself.
Its number in the trail, higher for every later entry.
The HTTP status the request was answered with, once it was; absent for one still started, and for a change the
gateway made itself.
What it did, in a few words: “sink ‘payroll’ added”.
The tenant the request named in its path (/api/tenants/<t>/... or
/api/attendance/tenants/<t>/...). Absent for an install-level
change and for the engine’s own.
Who made it: the admin login’s user name, token:<name> for an API
token, or local when no login is configured.
The seq of the last entry on the page, or the after asked for
when the page is empty: pass it as after for the next page.
Example
{ "entries": [ { "action": "POST /api/sinks", "at": "2026-01-15T08:00:00Z", "body": "{\"events\":[\"punch\"],\"id\":\"payroll\",\"type\":\"webhook\",\"url\":\"https://example.com/houradvantage\"}", "instance": "gw-1", "outcome": "done", "seq": 513, "status": 201, "summary": "sink 'payroll' added", "user": "admin" }, { "action": "PUT /api/secrets/api_key", "at": "2026-01-15T08:01:00Z", "instance": "gw-2", "outcome": "started", "seq": 514, "summary": "PUT /api/secrets/api_key", "user": "token:deploy" } ], "next": 514}until is not later than since.
A refusal, and why.
object
Why the request was refused, in a sentence.
For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.
What is wrong with one field of a request.
object
The parameter, as the request names it (values.volume for a
setting inside values).
What is wrong with it.
The request’s id, as its X-Request-Id header gives it: what to
quote when asking what happened to it.
Example
{ "error": "until must be later than since"}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).
Example
the API token was refusedHeaders
Section titled “Headers”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
Why the request was refused, in a sentence.
For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.
What is wrong with one field of a request.
object
The parameter, as the request names it (values.volume for a
setting inside values).
What is wrong with it.
The request’s id, as its X-Request-Id header gives it: what to
quote when asking what happened to it.
Example
{ "error": "the Host must name this machine (localhost or a loopback address); an API reached by other names needs the admin login"}Example
a forwarded request needs the admin login; none is setMore 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.
Example
too many logins at once; try againHeaders
Section titled “Headers”Seconds to wait: 1.
Something went wrong in the gateway that asking again will not put right by itself; error says what.
A refusal, and why.
object
Why the request was refused, in a sentence.
For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.
What is wrong with one field of a request.
object
The parameter, as the request names it (values.volume for a
setting inside values).
What is wrong with it.
The request’s id, as its X-Request-Id header gives it: what to
quote when asking what happened to it.
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).
A refusal, and why.
object
Why the request was refused, in a sentence.
For a request whose parameters do not fit (422): what is wrong with each field. Absent otherwise.
What is wrong with one field of a request.
object
The parameter, as the request names it (values.volume for a
setting inside values).
What is wrong with it.
The request’s id, as its X-Request-Id header gives it: what to
quote when asking what happened to it.
Example
{ "error": "the gateway is starting; try again shortly"}