Skip to content

envelope

Every event, whatever its type. data is described by the schema named after type (punch.json, user.json, …). Consumers must ignore fields they do not know: fields are added within a schema version.

Schema id: urn:houradvantage:events:3:envelope

Fields

FieldTypeRequiredDescription
idstringyesStable 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. pattern ^[0-9a-f]{32}$
schema3yesThe version of this contract the event follows.
typestringyesThe event type; the event reference describes each.
tenantstringyesThe 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.
endpointstringyesThe 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.
groupstringThe 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.
devicestringyesThe 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.
personstringConnect’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.
packagestringyesThe 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.
received_atstring (date-time)yesWhen the gateway received it (for the gateway’s own events, when it made them), RFC 3339 UTC.
dataobjectyesThe type’s fields.
person_idstringTo 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.
requestobjectThe 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.
request.idstringyesThe request’s id: the X-Request-Id it was answered with, and that its audit trail entry and log lines carry.
request.idempotency_keystringThe Idempotency-Key it was sent with, if any.
request.userstringWho 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.

Example

{
"id": "5175b17d2b668586c2d0fb958c0f6203",
"schema": 3,
"type": "punch",
"tenant": "acme",
"endpoint": "office",
"group": "hq",
"device": "CG0001",
"person": "0c6f2a1e-7d43-4b8e-9a51-3f2e8d6c4b10",
"package": "[email protected]",
"received_at": "2026-01-15T14:00:29.811Z",
"data": {
"user_id": "1001",
"local_time": "2026-01-15 08:00:00",
"utc_offset": "-06:00",
"time": "2026-01-15T08:00:00-06:00",
"dst_ambiguous": false,
"time_zone": "America/Chicago",
"zoned": "2026-01-15T08:00:00-06:00[America/Chicago]",
"state_name": "check_in",
"verify_name": "fingerprint",
"work_code": "7",
"vendor": {
"zk": {
"state": 0,
"verify": 1,
"work_code": "7",
"timezone": "America/Chicago"
}
}
}
}

JSON Schema

envelope.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:houradvantage:events:3:envelope",
"title": "Hour Advantage event",
"description": "Every event, whatever its type. `data` is described by the schema named after `type` (punch.json, user.json, ...). Consumers must ignore fields they do not know: fields are added within a schema version.",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Stable idempotency key, 32 hex digits: the same device record always gets the same id, and an event a system posted (endpoint \"source:<source>\") the same id whenever it is posted from the same source with the same id. Deduplicate on it.",
"pattern": "^[0-9a-f]{32}$"
},
"schema": {
"description": "The version of this contract the event follows.",
"const": 3
},
"type": {
"type": "string",
"description": "The event type; the event reference describes each."
},
"tenant": {
"type": "string",
"description": "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."
},
"endpoint": {
"type": "string",
"description": "The endpoint the device belongs to, by its id within the tenant; \"sync:<group>\" for a sync group's own events; \"source:<source>\" for an event the system <source> posted into the tenant; \"attendance\" for Time and Attendance's own events."
},
"group": {
"type": "string",
"description": "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."
},
"device": {
"type": "string",
"description": "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."
},
"person": {
"type": "string",
"description": "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."
},
"package": {
"type": "string",
"description": "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."
},
"received_at": {
"type": "string",
"description": "When the gateway received it (for the gateway's own events, when it made them), RFC 3339 UTC.",
"format": "date-time"
},
"data": {
"description": "The type's fields.",
"type": "object"
},
"person_id": {
"type": "string",
"description": "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."
},
"request": {
"type": "object",
"description": "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.",
"properties": {
"id": {
"type": "string",
"description": "The request's id: the X-Request-Id it was answered with, and that its audit trail entry and log lines carry."
},
"idempotency_key": {
"type": "string",
"description": "The Idempotency-Key it was sent with, if any."
},
"user": {
"type": "string",
"description": "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:<name> for an API token's. Absent when the caller was not known."
}
},
"required": [
"id"
]
}
},
"required": [
"id",
"schema",
"type",
"tenant",
"endpoint",
"device",
"package",
"received_at",
"data"
],
"examples": [
{
"id": "5175b17d2b668586c2d0fb958c0f6203",
"schema": 3,
"type": "punch",
"tenant": "acme",
"endpoint": "office",
"group": "hq",
"device": "CG0001",
"person": "0c6f2a1e-7d43-4b8e-9a51-3f2e8d6c4b10",
"package": "[email protected]",
"received_at": "2026-01-15T14:00:29.811Z",
"data": {
"user_id": "1001",
"local_time": "2026-01-15 08:00:00",
"utc_offset": "-06:00",
"time": "2026-01-15T08:00:00-06:00",
"dst_ambiguous": false,
"time_zone": "America/Chicago",
"zoned": "2026-01-15T08:00:00-06:00[America/Chicago]",
"state_name": "check_in",
"verify_name": "fingerprint",
"work_code": "7",
"vendor": {
"zk": {
"state": 0,
"verify": 1,
"work_code": "7",
"timezone": "America/Chicago"
}
}
}
}
]
}