Skip to content

Read the audit trail

GET
/api/audit
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.

after
integer format: int64

Only entries after the one with this seq: the next of the page before. Default 0, from the oldest kept.

Example
512
limit
integer

At most this many entries: 100 unless given, at most 1000 (more is read as 1000).

Example
100
user
string

Only changes made by this user: the login’s name, token:<name>, or local.

Example
token:deploy
tenant
string

Only changes whose request named this tenant in its path (/api/tenants/<tenant>/..., or /api/attendance/tenants/<tenant>/...).

Example
acme
action
string

Only changes whose action (method and path, POST /api/sinks) starts with this.

Example
POST /api/tokens
since
string format: date-time

Only changes made at or after this time (RFC 3339).

Example
2026-01-15T00:00:00Z
until
string format: date-time

Only changes made before this time (RFC 3339): later than since.

Example
2026-01-16T00:00:00Z
request_id
string

Only the change made by the request with this id (X-Request-Id).

Example
3f2a9c1e
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

A page of the audit trail, oldest first.

Media typeapplication/json

A page of the audit trail.

object
entries
required

The entries, oldest first.

Array<object>

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
action
required

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.

string
at
required

When the change was made.

string format: date-time
body

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.

string | null
client

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.

string | null
instance
required

The gateway instance that made it.

string
outcome
required

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.

string
Allowed values: started done failed
request_id

The id of the admin API request that made it (its X-Request-Id). Absent for a change the gateway made itself.

string | null
seq
required

Its number in the trail, higher for every later entry.

integer format: int64
status

The HTTP status the request was answered with, once it was; absent for one still started, and for a change the gateway made itself.

integer | null format: int32
summary
required

What it did, in a few words: “sink ‘payroll’ added”.

string
tenant

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.

string | null
user
required

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

string
next
required

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.

integer format: int64
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.

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": "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).

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"
}