Read a person's days
const url = 'http://127.0.0.1:9090/api/attendance/tenants/example/people/example/days?from=2026-10-01&to=2026-10-31&side=pay';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/attendance/tenants/example/people/example/days?from=2026-10-01&to=2026-10-31&side=pay' \ --header 'Authorization: Basic <credentials>' \ --header 'X-Request-Id: 4f1c2b0e-8a7d-4c51-9e2f-3a6b8d0c1e7f'Each day from from through to (at most 366 days, any days, whatever pay periods they are in): the pay period it
is in, its schedule (shifts, a day off, holidays, the leave asked for), its lines (each with its pay category, labor
context, time and decimal hours, where its time came from and what the policy’s steps did to it), its counts and
money, the punches of the day as taken, its exceptions, and its totals; then the totals of all the days, and a
summary of each pay period the days touch, with where it stands and its own totals (the whole period’s, and its
days’ in the range). A day of a period with no ledger kept (ahead, or not worked out yet) is as scheduled, worked
out on read, with no time (kept false).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The tenant’s id.
The person’s id.
Query Parameters
Section titled “Query Parameters”The first day: YYYY-MM-DD; at most 366 days in all, any days, whatever pay periods they are in.
Example
2026-10-01The last day: YYYY-MM-DD, on or after from.
Example
2026-10-31Pay (the default) or a bill side.
Example
payHeader 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”Their days.
A person’s days from from through to.
object
Each day from from through to; absent where only totals are
asked for.
One day.
object
The exceptions about it, each as the ledger keeps it: kind, at,
about, detail, and how it was followed up.
object
A holiday observed on a day.
object
Its period’s ledger is kept: false, the day is as scheduled, with no time (it is ahead, or not worked out yet).
The leave asked for on it, with where each request stands.
Leave asked for on a day.
object
The leave request’s id.
Approved, pending, rejected, refused…
Its lines, in the order they are paid.
A line: time in a pay category against a labor context.
object
Its labor context values, by dimension.
object
Where its time came from, as the ledger says it, with every field
it carries: {"segment": {"kind": "work", "punch": "p-1182"}} (the
punch that started the work), {"entry": {"id": ...}},
{"leave": {"id": ...}}, {"policy": {"step": ...}}…
object
What each policy step did to it, in order: step, layers, did.
object
When its time ran, as paid (after rounding); absent for a line of time with no time of day (a labor entry of hours, leave).
Its exact time, and its decimal hours.
Off, leave or holiday, where a schedule override took the day off.
The pay period it is in.
object
The punches whose workday it is, in the order punched.
A punch as it is taken, after its corrections.
object
The corrections that made it what it is, in order.
The punch as it came, where a correction changed it; absent for one as punched or one a correction added.
The punch as taken, with every field it carries: id, at, kind,
values, recorded, stored…
object
Where its clock stamp (punch.clock) came from, when it is not the
one the punch arrived with: the re-stamp that gave it (original
has the one it came with).
object
When it was stored.
The correction that did it.
Who asked, as the server saw it (user:<name>).
A count or money line.
object
object
The labor entry it came from, or the step that made it.
In the measure’s unit (money in its currency’s minor units).
Facts about the day stored after its period was closed, where it is:
the day above is as the close kept it, so these are not among its
punches or in its lines. Each was a late change, taken in the period
open when it was stored (stored_workday), as an adjustment line on
that day or a late_change_refused exception about it, by the
policy’s close.late_changes. Absent where there are none.
A fact stored after the close of the period of the day it is about.
object
The punch or correction as it was stored.
object
The fact’s id.
punch, or correction.
When it was stored.
The workday it was stored on, in the policy’s zone: where the open period took it.
The shifts scheduled to start in it.
A scheduled shift.
object
The labor context its work takes where the punches do not say.
object
What some lines come to.
object
By pay category, by name.
The time of a pay category.
object
The code payroll knows it by, where the setup names one.
Its decimal hours: the sum of its lines’.
Whether its time is paid. Absent where the category is not known (a total of lines kept before the setup named it): paid.
Its exact time.
Whether its time counts as worked.
The decimal hours of the lines in paid categories.
The counts and money, by measure and category.
The sum of a measure’s counts or money in a pay category, in the measure’s unit (money in its currency’s minor units).
object
The time of the lines in categories that count as worked.
The time zone its times are in (its IANA name).
Why they cannot be read (no zone set up for them, a policy step failing); the rest is then empty.
Each pay period holding a day from from through to, the
earliest first.
A pay period the days touch.
object
Approved at every stage of the period’s approval.
When it was closed; null: open.
A ledger of it is kept; false: it is ahead, or not worked out yet.
The person waits to be worked out again from a day of it or before: what is kept of it is about to change.
The totals of its days from from through to.
object
By pay category, by name.
The time of a pay category.
object
The code payroll knows it by, where the setup names one.
Its decimal hours: the sum of its lines’.
Whether its time is paid. Absent where the category is not known (a total of lines kept before the setup named it): paid.
Its exact time.
Whether its time counts as worked.
The decimal hours of the lines in paid categories.
The counts and money, by measure and category.
The sum of a measure’s counts or money in a pay category, in the measure’s unit (money in its currency’s minor units).
object
The time of the lines in categories that count as worked.
The whole period’s totals, as its ledger has them; absent where no ledger of it is kept.
object
By pay category, by name.
The time of a pay category.
object
The code payroll knows it by, where the setup names one.
Its decimal hours: the sum of its lines’.
Whether its time is paid. Absent where the category is not known (a total of lines kept before the setup named it): paid.
Its exact time.
Whether its time counts as worked.
The decimal hours of the lines in paid categories.
The counts and money, by measure and category.
The sum of a measure’s counts or money in a pay category, in the measure’s unit (money in its currency’s minor units).
object
The time of the lines in categories that count as worked.
The totals of every day from from through to.
object
By pay category, by name.
The time of a pay category.
object
The code payroll knows it by, where the setup names one.
Its decimal hours: the sum of its lines’.
Whether its time is paid. Absent where the category is not known (a total of lines kept before the setup named it): paid.
Its exact time.
Whether its time counts as worked.
The decimal hours of the lines in paid categories.
The counts and money, by measure and category.
The sum of a measure’s counts or money in a pay category, in the measure’s unit (money in its currency’s minor units).
object
The time of the lines in categories that count as worked.
Example
{ "days": [ { "date": "2026-10-05", "exceptions": [], "holidays": [], "kept": true, "leave": [], "lines": [ { "category": "work", "context": {}, "end": "2026-10-05T21:00:00Z", "from": { "segment": { "kind": "work", "punch": "p-1182" } }, "hours": "8.00", "stamps": [], "start": "2026-10-05T13:00:00Z", "time": "8h" } ], "period": { "first": "2026-10-05", "last": "2026-10-18" }, "punches": [ { "corrections": [], "punch": { "at": "2026-10-05T13:00:00Z", "id": "p-1182", "kind": "in", "recorded": "2026-10-05T13:00:00Z", "values": {} } } ], "quantities": [], "shifts": [ { "end": "2026-10-05T21:00:00Z", "id": "days-2026-10-05", "start": "2026-10-05T13:00:00Z", "values": {} } ], "totals": { "categories": [ { "category": "work", "hours": "8.00", "paid": true, "time": "8h", "worked": true } ], "paid": "8.00", "quantities": [], "worked": "8h" }, "zone": "America/Chicago" } ], "from": "2026-10-05", "periods": [ { "approved": false, "closed": null, "first": "2026-10-05", "in_range": { "categories": [ { "category": "work", "hours": "8.00", "paid": true, "time": "8h", "worked": true } ], "paid": "8.00", "quantities": [], "worked": "8h" }, "kept": true, "last": "2026-10-18", "pending": false, "totals": { "categories": [ { "category": "work", "hours": "40.00", "paid": true, "time": "40h", "worked": true } ], "paid": "40.00", "quantities": [], "worked": "40h" } } ], "person": "104552", "side": "pay", "to": "2026-10-05", "totals": { "categories": [ { "category": "work", "hours": "8.00", "paid": true, "time": "8h", "worked": true } ], "paid": "8.00", "quantities": [], "worked": "8h" }}From after to, more than 366 days, or a person with no zone set up.
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.
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).
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 setNo tenant of that id.
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.
Examplegenerated
{ "error": "example", "fields": [ { "field": "example", "message": "example" } ], "request_id": "example"}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.
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 attendance engine does not run here.
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.
Examplegenerated
{ "error": "example", "fields": [ { "field": "example", "message": "example" } ], "request_id": "example"}