Skip to content

List a tenant's events

GET
/api/attendance/tenants/{tenant}/events
curl --request GET \
--url 'http://127.0.0.1:9090/api/attendance/tenants/acme/events?after=1180&limit=100&type=period.closed&source=erp&since=2026-10-19T00%3A00%3A00Z&until=2026-10-20T00%3A00%3A00Z' \
--header 'Authorization: Basic <credentials>' \
--header 'X-Request-Id: 4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f'

The tenant’s events in Time and Attendance’s log, oldest first, a page at a time, each with its sequence number (seq): the engine’s own (endpoint attendance) and those other systems posted into the tenant (endpoint source:<source>). An event is never returned before every event with a lower seq is in place, so reading on from next skips nothing. They are kept for the install’s retention_days once every sink they go to has taken them, and until it does while one has not.

tenant
required
string

The tenant’s id.

Example
acme
after
integer format: int64

Only events after the one with this sequence number: the next of the page before. Default 0, from the oldest kept.

Example
1180
limit
integer

At most this many events: 100 unless given, at most 1000.

Example
100
type
string

Only events of this type.

Example
period.closed
source
string

Only the events this source posted (erp), or the engine’s own (attendance).

Example
erp
since
string format: date-time

Only events received at or after this time (RFC 3339).

Example
2026-10-19T00:00:00Z
until
string format: date-time

Only events received before this time (RFC 3339).

Example
2026-10-20T00:00:00Z
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 events, oldest first.

Media typeapplication/json

A page of stored events.

object
events
required

The events, oldest first.

Array

An event as it is kept: with the sequence number it was stored under.

object
data
required

The type’s fields.

object
device
required

The device’s id: whatever its package identifies it by (a serial number, a MAC address, a cloud id); “” for an event about a whole job (job., but not job.execution.) or a sync group; for an event a system posted, what it is about, as posted (“” when it named nothing); for Time and Attendance’s own, the person or timecard it is about.

string
endpoint
required

The endpoint the device belongs to, by its id within the tenant; “sync:” for a sync group’s own events; “source:” for an event the system posted into the tenant; “attendance” for Time and Attendance’s own events.

string
group

The sync group of the endpoint (every endpoint is in one, its own unless it names one), by its id within the tenant; for a group’s own events, that group. Absent for an endpoint no longer configured, and for events of another engine.

string
id
required

Stable idempotency key, 32 hex digits: the same device record always gets the same id, and an event a system posted (endpoint “source:”) the same id whenever it is posted from the same source with the same id. Deduplicate on it.

string
/^[0-9a-f]{32}$/
package
required

The package that read it, “name@version”; for the gateway’s own events about a device, that device’s package; “houradvantage-connect” for a job’s or sync group’s own events; for an event a system posted, its source; “houradvantage-attend” for Time and Attendance’s own.

string
person

Connect’s own id of the person the event is about (data.user_id) in its group: opaque, and kept when the person’s user id changes. Present when the group keeps people and has the person.

string
person_id

To a sink with person_id only: the id, in the system the sink names, of the person the event is about (data.user_id), from the person’s external_ids; absent when they have none there.

string
received_at
required

When the gateway received it (for the gateway’s own events, when it made them), RFC 3339 UTC.

string format: date-time
request

The admin API request that caused the event, made while it ran: a change made through the API, an event posted through it. Absent for an event no request caused: a device’s message, a job’s waves, Time and Attendance working a ledger out. A request id is a correlation id only: the caller may have chosen it.

object
id
required

The request’s id: the X-Request-Id it was answered with, and that its audit trail entry and log lines carry.

string
idempotency_key

The Idempotency-Key it was sent with, if any.

string
user

Who made the request, as the server named them from its login or token, never as the caller says: the login’s user, or token: for an API token’s. Absent when the caller was not known.

string
schema
required

The version of this contract the event follows.

Allowed value: 3
tenant
required

The tenant the event belongs to: in Connect’s events, the Connect tenant its endpoint is of (or that it was posted into); in Time and Attendance’s, the Time and Attendance tenant. Events of the source “attendance” in Connect’s log say “default” but are no Connect tenant’s: only install-level sinks that name the source are sent them, and they stay in the log until those sinks have taken them, then retention removes them as any event. Time and Attendance keeps its own events in a log of its own.

string
type
required

The event type; the event reference describes each.

string
seq
required

The sequence number it was stored under, one order across the whole install. Read on from it with after.

integer format: int64
next
required

The seq of the last event 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
{
"events": [
{
"data": {
"person": "104552",
"side": "pay",
"tenant": "acme"
},
"device": "104552/pay/2026-10-05",
"endpoint": "attendance",
"id": "9c1e7b6d4a0f8e5c2b1a9d8c7e6f3f2a",
"package": "houradvantage-attend",
"received_at": "2026-10-19T05:00:00Z",
"schema": 3,
"seq": 1205,
"tenant": "acme",
"type": "period.closed"
}
],
"next": 1205
}

until is not later than since, or source is not an id.

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
Examplegenerated
{
"error": "example",
"fields": [
{
"field": "example",
"message": "example"
}
],
"request_id": "example"
}

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

No such tenant.

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": "no tenant 'acme'"
}

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 attendance engine does not run here.

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 attendance engine does not run on this instance (start it with HOURADVANTAGE_ATTEND)"
}