Skip to content

punch

A user punched in or out at a device. Sent by the device’s package for every attendance record the device uploads (zk-push 2.0, 2.4 and 3.4: each ATTLOG line; brightlink-cloud: each punch message), including records uploaded again, which keep their id. user_id, local_time, utc_offset, time, dst_ambiguous, time_zone and zoned are always there; the other fields are there when the device reports them. The gateway adds a sync object when the device’s sync group keeps punches, or keeps people and its placement does not put the user on this device. Where the punching person’s group keeps people, the gateway routes it (route or candidates); a punch routed later through the API is the same punch, sent again with the same id and its route.

Schema id: urn:houradvantage:events:3:punch

Fields

FieldTypeRequiredDescription
user_idstringyesThe user’s id on the device, as the device sent it.
local_timestringyesThe time the device recorded, as its display showed it, “YYYY-MM-DD HH:MM:SS” (fractions of a second are dropped). pattern ^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$
utc_offsetstringyesThe offset from UTC at local_time, “+HH:MM” or “-HH:MM”: the offset the device stated, or, for a device that states none, the offset of the endpoint’s timezone option at that time. pattern ^[+-]\d{2}:\d{2}$
timestring (date-time)yesThe instant: local_time with utc_offset, RFC 3339 to the second (“2026-01-15T08:00:00-06:00”). Order punches by this, not by arrival.
dst_ambiguousbooleanyesTrue when local_time happens twice in the zone (the hour after daylight saving ends) or never (the hour skipped when it starts). A time that happens twice is taken as the first (utc_offset is the offset in force before the change), so the instant may be an hour out; a skipped time is placed forward over the gap (utc_offset, time and zoned read 03:30 for 02:30) while local_time stays what the device showed. Always false when the device stated its offset.
time_zonestringyesThe zone the time was placed in: an IANA name (“America/Chicago”) when the endpoint’s timezone option is one, or an offset (“-07:00”, “+00:00”) when the device stated only an offset or the endpoint’s timezone is a fixed offset.
zonedstringyesThe instant with its zone, RFC 9557: time followed by [time_zone] (“2026-01-15T08:00:00-06:00[America/Chicago]”). pattern ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}[+-]\d{2}:\d{2}\[[^\]]+\]$
offset_statedbooleanTrue when the device stated the offset the time was made under (BrightLink’s timestamps carry one) and false or absent when the endpoint’s zone gave it. A device that states its offset is never told as a clock behind (device.clock_behind): its time is its own.
clock_behind_secondsintegerPresent while the device’s clock is behind (device.clock_behind): by how many seconds, as first told. Added by the gateway to the punches of a message that is not on time, whose offset the endpoint’s zone gave. The punch’s time is as the clock reported it; it is for whoever reads the punch to take into account. It is not there when the device is not behind.
state_namestringWhat the punch was, as a word: check_in, check_out, meal_in, meal_out, break_in, break_out, overtime_in, overtime_out (zk-push 3.4 only for the overtime pair). The list is open: brightlink-cloud passes on a direction it does not know as the device sent it. Absent when the device’s code has no name or the device sent none.
verify_namestringHow the user verified: fingerprint, card, password, face, palm, user_id (the id keyed in), or user_id_unverified and card_unverified (zk-push 2.0); combinations are joined with ”+” (all of them) or ”|” (any of them), as in “card+fingerprint”. brightlink-cloud passes on the device’s own verifyMode text. The list is open. Absent when the device’s code has no name or the device sent none.
work_codestringThe work (job, labour) code the user entered with the punch. Absent when none was entered (zk-push: a code of “0” is none).
syncobjectAdded by the gateway, beside the package’s data, when the device’s endpoint is in a sync group that keeps punches (domain “punches”), or that keeps people and does not place the punching person on this device. The punch itself is never dropped or changed. In a group that keeps punches every field below is there (null where there is nothing to say); in a group that keeps only people, only group and placement are there. Absent for a device in no sync group, and for a punch with no user_id or no readable time.
sync.groupstringyesThe name of the sync group.
sync.previousobject or nullThe person’s latest punch before this one, at any member of the group. The group keeps up to 8 recent punches per person, from the 24 hours before their latest; null when none of them is earlier than this punch.
sync.previous.timestring (date-time)yesThe instant of that punch, RFC 3339 to the second, with the offset it was recorded under (“Z” for UTC).
sync.previous.state_namestring or nullThat punch’s state_name; null when it had none.
sync.previous.endpointstringyesThe endpoint of the device that punch was made on.
sync.previous.devicestringyesThe id of the device that punch was made on.
sync.duplicatebooleanTrue when another punch of the person, at any member, is within 60 seconds of this one, before or after it.
sync.within_lockoutbooleanTrue when this punch is less than the group’s lockout_minutes after previous. Always false when lockout_minutes is 0 or there is no previous punch.
sync.latebooleanTrue when a later punch of the person had already been stored: this one arrived out of order, and the person’s latest punch stays the later one.
sync.clock_aheadbooleanTrue when the punch’s time is more than 5 minutes after the moment it reached Connect: the clock that made it is set ahead. The punch is delivered as the clock reported it, but it is kept out of the person’s punch state and zone state (it is never the latest punch, and passes no zone), so the person’s real punches after it are judged as usual. The device’s status says the same (clock_ahead in its info), and device.clock_ahead is told once when it is first seen so.
sync.zoneobject or nullThe anti-passback zone (an access row of kind zone) the punch’s device is a reader of, and whether the punch broke the zone’s rule; null when the device is a reader of no zone.
sync.zone.namestringThe zone’s name.
sync.zone.violationbooleanTrue when the punch broke the zone’s rule: entering while inside or leaving while outside (anti_passback), or entering again within the zone’s minutes (timed). False when nothing is known of the person in the zone since its daily reset.
sync.user_id_alias_ofstring or nullThe person’s new id, when user_id is an old id of a person whose id was changed and the alias still lasts; null otherwise. user_id is left as the device sent it.
sync.placement"outside"“outside”: the person is in the group, but the group’s placement does not put them on this device (the device still held them, or they punched by a means the device accepts from anyone). The punch is kept and delivered all the same. Absent when the person is placed on the device, or the group does not keep people.
routeobjectAdded by the gateway where the punch went (the site’s /docs/policy/ page, Routes): the one route of the person who punched, or the one the endpoint’s policy picked. A sink that speaks for a system is sent only the punches routed to it. Absent for a punch with no route: of a device whose group keeps no people, of a person with none, or unrouted (a punch.unrouted event says why).
route.systemstringyesThe receiving system, as a sink names the system it speaks for.
route.tenantstringyesThe tenant in that system the punch goes to.
route.person_idstringThe person’s id in that system: their own route’s, or their external id there. Absent when they have none.
route.codesobjectCodes for the receiver, as the route carries them.
candidatesarray of objectAdded by the gateway in place of route when the endpoint’s policy passed the punch’s candidates on, for a receiver that resolves them itself: every one of them, all of one system.
candidates[].systemstringyesThe receiving system, as a sink names the system it speaks for.
candidates[].tenantstringyesThe tenant in that system the punch goes to.
candidates[].person_idstringThe person’s id in that system: their own route’s, or their external id there. Absent when they have none.
candidates[].codesobjectCodes for the receiver, as the route carries them.
vendorobjectWhat the device said in its own terms, under one key naming the vendor or package (“zk”, “brightlink”). Not part of this contract: see the package’s documentation.

Examples

{
"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"
}
}
}
{
"user_id": "1001",
"local_time": "2026-01-15 17:02:11",
"utc_offset": "-06:00",
"time": "2026-01-15T17:02:11-06:00",
"dst_ambiguous": false,
"time_zone": "America/Chicago",
"zoned": "2026-01-15T17:02:11-06:00[America/Chicago]",
"state_name": "check_out",
"verify_name": "card",
"sync": {
"group": "hq",
"previous": {
"time": "2026-01-15T08:00:00-06:00",
"state_name": "check_in",
"endpoint": "office",
"device": "CG0002"
},
"duplicate": false,
"within_lockout": false,
"late": false,
"clock_ahead": false,
"zone": null,
"user_id_alias_of": null
},
"vendor": {
"zk": {
"state": 1,
"verify": 2,
"work_code": "0",
"timezone": "America/Chicago"
}
}
}
{
"user_id": "1001",
"local_time": "2026-01-15 14:00:00",
"utc_offset": "+00:00",
"time": "2026-01-15T14:00:00+00:00",
"dst_ambiguous": false,
"time_zone": "+00:00",
"zoned": "2026-01-15T14:00:00+00:00[+00:00]",
"state_name": "check_out",
"verify_name": "face",
"vendor": {
"brightlink": {
"direction": "out",
"score": 93
}
}
}

JSON Schema

punch.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:houradvantage:events:3:punch",
"title": "punch: data",
"description": "A user punched in or out at a device. Sent by the device's package for every attendance record the device uploads (zk-push 2.0, 2.4 and 3.4: each ATTLOG line; brightlink-cloud: each punch message), including records uploaded again, which keep their id. user_id, local_time, utc_offset, time, dst_ambiguous, time_zone and zoned are always there; the other fields are there when the device reports them. The gateway adds a sync object when the device's sync group keeps punches, or keeps people and its placement does not put the user on this device. Where the punching person's group keeps people, the gateway routes it (route or candidates); a punch routed later through the API is the same punch, sent again with the same id and its route.",
"type": "object",
"properties": {
"user_id": {
"type": "string",
"description": "The user's id on the device, as the device sent it."
},
"local_time": {
"type": "string",
"description": "The time the device recorded, as its display showed it, \"YYYY-MM-DD HH:MM:SS\" (fractions of a second are dropped).",
"pattern": "^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}$"
},
"utc_offset": {
"type": "string",
"description": "The offset from UTC at local_time, \"+HH:MM\" or \"-HH:MM\": the offset the device stated, or, for a device that states none, the offset of the endpoint's timezone option at that time.",
"pattern": "^[+-]\\d{2}:\\d{2}$"
},
"time": {
"type": "string",
"description": "The instant: local_time with utc_offset, RFC 3339 to the second (\"2026-01-15T08:00:00-06:00\"). Order punches by this, not by arrival.",
"format": "date-time"
},
"dst_ambiguous": {
"type": "boolean",
"description": "True when local_time happens twice in the zone (the hour after daylight saving ends) or never (the hour skipped when it starts). A time that happens twice is taken as the first (utc_offset is the offset in force before the change), so the instant may be an hour out; a skipped time is placed forward over the gap (utc_offset, time and zoned read 03:30 for 02:30) while local_time stays what the device showed. Always false when the device stated its offset."
},
"time_zone": {
"type": "string",
"description": "The zone the time was placed in: an IANA name (\"America/Chicago\") when the endpoint's timezone option is one, or an offset (\"-07:00\", \"+00:00\") when the device stated only an offset or the endpoint's timezone is a fixed offset."
},
"zoned": {
"type": "string",
"description": "The instant with its zone, RFC 9557: time followed by [time_zone] (\"2026-01-15T08:00:00-06:00[America/Chicago]\").",
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}[+-]\\d{2}:\\d{2}\\[[^\\]]+\\]$"
},
"offset_stated": {
"type": "boolean",
"description": "True when the device stated the offset the time was made under (BrightLink's timestamps carry one) and false or absent when the endpoint's zone gave it. A device that states its offset is never told as a clock behind (device.clock_behind): its time is its own."
},
"clock_behind_seconds": {
"type": "integer",
"description": "Present while the device's clock is behind (device.clock_behind): by how many seconds, as first told. Added by the gateway to the punches of a message that is not on time, whose offset the endpoint's zone gave. The punch's time is as the clock reported it; it is for whoever reads the punch to take into account. It is not there when the device is not behind."
},
"state_name": {
"type": "string",
"description": "What the punch was, as a word: check_in, check_out, meal_in, meal_out, break_in, break_out, overtime_in, overtime_out (zk-push 3.4 only for the overtime pair). The list is open: brightlink-cloud passes on a direction it does not know as the device sent it. Absent when the device's code has no name or the device sent none."
},
"verify_name": {
"type": "string",
"description": "How the user verified: fingerprint, card, password, face, palm, user_id (the id keyed in), or user_id_unverified and card_unverified (zk-push 2.0); combinations are joined with \"+\" (all of them) or \"|\" (any of them), as in \"card+fingerprint\". brightlink-cloud passes on the device's own verifyMode text. The list is open. Absent when the device's code has no name or the device sent none."
},
"work_code": {
"type": "string",
"description": "The work (job, labour) code the user entered with the punch. Absent when none was entered (zk-push: a code of \"0\" is none)."
},
"sync": {
"description": "Added by the gateway, beside the package's data, when the device's endpoint is in a sync group that keeps punches (domain \"punches\"), or that keeps people and does not place the punching person on this device. The punch itself is never dropped or changed. In a group that keeps punches every field below is there (null where there is nothing to say); in a group that keeps only people, only group and placement are there. Absent for a device in no sync group, and for a punch with no user_id or no readable time.",
"type": "object",
"properties": {
"group": {
"type": "string",
"description": "The name of the sync group."
},
"previous": {
"description": "The person's latest punch before this one, at any member of the group. The group keeps up to 8 recent punches per person, from the 24 hours before their latest; null when none of them is earlier than this punch.",
"type": [
"object",
"null"
],
"properties": {
"time": {
"type": "string",
"format": "date-time",
"description": "The instant of that punch, RFC 3339 to the second, with the offset it was recorded under (\"Z\" for UTC)."
},
"state_name": {
"type": [
"string",
"null"
],
"description": "That punch's state_name; null when it had none."
},
"endpoint": {
"type": "string",
"description": "The endpoint of the device that punch was made on."
},
"device": {
"type": "string",
"description": "The id of the device that punch was made on."
}
},
"required": [
"time",
"endpoint",
"device"
]
},
"duplicate": {
"type": "boolean",
"description": "True when another punch of the person, at any member, is within 60 seconds of this one, before or after it."
},
"within_lockout": {
"type": "boolean",
"description": "True when this punch is less than the group's lockout_minutes after previous. Always false when lockout_minutes is 0 or there is no previous punch."
},
"late": {
"type": "boolean",
"description": "True when a later punch of the person had already been stored: this one arrived out of order, and the person's latest punch stays the later one."
},
"clock_ahead": {
"type": "boolean",
"description": "True when the punch's time is more than 5 minutes after the moment it reached Connect: the clock that made it is set ahead. The punch is delivered as the clock reported it, but it is kept out of the person's punch state and zone state (it is never the latest punch, and passes no zone), so the person's real punches after it are judged as usual. The device's status says the same (clock_ahead in its info), and device.clock_ahead is told once when it is first seen so."
},
"zone": {
"description": "The anti-passback zone (an access row of kind zone) the punch's device is a reader of, and whether the punch broke the zone's rule; null when the device is a reader of no zone.",
"type": [
"object",
"null"
],
"properties": {
"name": {
"type": "string",
"description": "The zone's name."
},
"violation": {
"type": "boolean",
"description": "True when the punch broke the zone's rule: entering while inside or leaving while outside (anti_passback), or entering again within the zone's minutes (timed). False when nothing is known of the person in the zone since its daily reset."
}
}
},
"user_id_alias_of": {
"type": [
"string",
"null"
],
"description": "The person's new id, when user_id is an old id of a person whose id was changed and the alias still lasts; null otherwise. user_id is left as the device sent it."
},
"placement": {
"const": "outside",
"description": "\"outside\": the person is in the group, but the group's placement does not put them on this device (the device still held them, or they punched by a means the device accepts from anyone). The punch is kept and delivered all the same. Absent when the person is placed on the device, or the group does not keep people."
}
},
"required": [
"group"
]
},
"route": {
"type": "object",
"properties": {
"system": {
"type": "string",
"description": "The receiving system, as a sink names the system it speaks for."
},
"tenant": {
"type": "string",
"description": "The tenant in that system the punch goes to."
},
"person_id": {
"type": "string",
"description": "The person's id in that system: their own route's, or their external id there. Absent when they have none."
},
"codes": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Codes for the receiver, as the route carries them."
}
},
"required": [
"system",
"tenant"
],
"description": "Added by the gateway where the punch went (the site's /docs/policy/ page, Routes): the one route of the person who punched, or the one the endpoint's policy picked. A sink that speaks for a system is sent only the punches routed to it. Absent for a punch with no route: of a device whose group keeps no people, of a person with none, or unrouted (a punch.unrouted event says why)."
},
"candidates": {
"type": "array",
"items": {
"type": "object",
"properties": {
"system": {
"type": "string",
"description": "The receiving system, as a sink names the system it speaks for."
},
"tenant": {
"type": "string",
"description": "The tenant in that system the punch goes to."
},
"person_id": {
"type": "string",
"description": "The person's id in that system: their own route's, or their external id there. Absent when they have none."
},
"codes": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Codes for the receiver, as the route carries them."
}
},
"required": [
"system",
"tenant"
]
},
"description": "Added by the gateway in place of route when the endpoint's policy passed the punch's candidates on, for a receiver that resolves them itself: every one of them, all of one system."
},
"vendor": {
"description": "What the device said in its own terms, under one key naming the vendor or package (\"zk\", \"brightlink\"). Not part of this contract: see the package's documentation.",
"type": "object",
"minProperties": 1,
"maxProperties": 1,
"additionalProperties": {
"type": "object"
}
}
},
"required": [
"user_id",
"local_time",
"utc_offset",
"time",
"dst_ambiguous",
"time_zone",
"zoned"
],
"examples": [
{
"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"
}
}
},
{
"user_id": "1001",
"local_time": "2026-01-15 17:02:11",
"utc_offset": "-06:00",
"time": "2026-01-15T17:02:11-06:00",
"dst_ambiguous": false,
"time_zone": "America/Chicago",
"zoned": "2026-01-15T17:02:11-06:00[America/Chicago]",
"state_name": "check_out",
"verify_name": "card",
"sync": {
"group": "hq",
"previous": {
"time": "2026-01-15T08:00:00-06:00",
"state_name": "check_in",
"endpoint": "office",
"device": "CG0002"
},
"duplicate": false,
"within_lockout": false,
"late": false,
"clock_ahead": false,
"zone": null,
"user_id_alias_of": null
},
"vendor": {
"zk": {
"state": 1,
"verify": 2,
"work_code": "0",
"timezone": "America/Chicago"
}
}
},
{
"user_id": "1001",
"local_time": "2026-01-15 14:00:00",
"utc_offset": "+00:00",
"time": "2026-01-15T14:00:00+00:00",
"dst_ambiguous": false,
"time_zone": "+00:00",
"zoned": "2026-01-15T14:00:00+00:00[+00:00]",
"state_name": "check_out",
"verify_name": "face",
"vendor": {
"brightlink": {
"direction": "out",
"score": 93
}
}
}
]
}