QHR Developers

Count holidays, weekend and working days in a period

GET/holidays/stat_cards
Read token is enoughView public holidays public_holiday/viewRequires feature public_holidayAvailable in Claudeholidays.stat_cards

Splits a period into working days, holiday days and weekend days, and names the longest holiday in it. The three always add up to period.days: a holiday falling on a weekend counts as weekend, and a day that is a holiday in two countries counts once. The weekend is the company's default attendance profile's days off. total_holidays counts holiday records; total_holiday_days counts days. longest_holidays lists every holiday tied for the most working days inside the period, with how many active employees live in its country.

When to use: to answer "how many working days are there this year / this quarter?" or "what is the longest holiday this year?". With no dates the period is the current calendar year in the company's time zone. Takes the same filters as holidays.list, e.g. q[country_eq] for one country.

Prerequisites: none.

Side effects: none.

Parameters

NameInTypeDescriptionExample
q[start_date]querystring (date)First day of the period. 1 January of the current year when omitted.2026-01-01
q[end_date]querystring (date)Last day of the period, on or after q[start_date]. 31 December of the current year when omitted.2026-12-31
q[country_eq]querystringOnly this country's holidays, ISO code.SA
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Response

200 The period's figures.

FieldTypeDescription
periodRequiredobjectThe period counted: from, to and its number of days.
period.fromstring (date)First day.
period.tostring (date)Last day.
period.daysintegerDays in the period.
total_holidaysRequiredintegerHoliday records overlapping the period.
total_holiday_daysRequiredintegerHoliday days in the period that are not weekend days.
total_weekend_daysRequiredintegerWeekend days in the period.
total_working_daysRequiredintegerDays left once weekends and holidays are taken out.
total_countriesRequiredintegerCountries with a holiday in the period.
longest_holidaysRequiredarray<object>The holiday(s) with the most working days inside the period; several when tied.
longest_holidays[].idintegerHoliday id.
longest_holidays[].namestringName in the requested language.
longest_holidays[].start_datestring (date)First day (full holiday, not clipped).
longest_holidays[].end_datestring (date)Last day (full holiday, not clipped).
longest_holidays[].countrystringISO country code.
longest_holidays[].country_namestringCountry name.
longest_holidays[].working_daysintegerIts working days that fall inside the period.
longest_holidays[].assigned_employeesintegerActive employees residing in its country.

Errors

HTTPCodeMeaningHow to fix
400bad_requestA date is not in YYYY-MM-DD form, or q[start_date] is after q[end_date].Send both dates as YYYY-MM-DD, the first on or before the second.
401token_missingNo Authorization: Bearer … header, or it is malformed.Send Authorization: Bearer qhr_… with the full token.
401token_invalidThe token is unknown or wrong, or its owner's account is locked.Check the token was copied in full, or create a new one in QHR › Settings › API & Integrations.
401token_expiredThe token is past its expiry date.Create a new token.
401token_revokedThe token was revoked by its owner or an admin, or the owner was removed from the company (which revokes all their tokens).Create a new token, or ask your admin. If the owner was removed, they must be re-invited to the company first.
401tenant_inactiveThe company account is suspended.Contact QHR support.
403forbiddenThe token owner's role lacks the permission this operation needs.Ask an admin to grant the permission shown on this operation (x-permission).
403employee_inactiveThe token owner's employee record is not active.HR must reactivate the employee record.
403tenant_access_revokedThe token's owner is no longer an active member of this company. Rare: removing a member normally revokes their tokens, which answers 401 token_revoked instead.The owner must be re-invited to the company, then create a new token. If the owner is still a member, contact QHR support.
This endpoint can also return the errors that can happen on any endpoint →402 / 412 / 425 entitlement_blocked · 429 rate_limited · 500 internal_error

See the full error catalogue →