Count holidays, weekend and working days in a period
/holidays/stat_cardspublic_holiday/viewRequires feature public_holidayAvailable in Claudeholidays.stat_cardsSplits 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
| Name | In | Type | Description | Example |
|---|---|---|---|---|
q[start_date] | query | string (date) | First day of the period. 1 January of the current year when omitted. | 2026-01-01 |
q[end_date] | query | string (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] | query | string | Only this country's holidays, ISO code. | SA |
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Response
200 The period's figures.
| Field | Type | Description |
|---|---|---|
periodRequired | object | The period counted: from, to and its number of days. |
period.from | string (date) | First day. |
period.to | string (date) | Last day. |
period.days | integer | Days in the period. |
total_holidaysRequired | integer | Holiday records overlapping the period. |
total_holiday_daysRequired | integer | Holiday days in the period that are not weekend days. |
total_weekend_daysRequired | integer | Weekend days in the period. |
total_working_daysRequired | integer | Days left once weekends and holidays are taken out. |
total_countriesRequired | integer | Countries with a holiday in the period. |
longest_holidaysRequired | array<object> | The holiday(s) with the most working days inside the period; several when tied. |
longest_holidays[].id | integer | Holiday id. |
longest_holidays[].name | string | Name in the requested language. |
longest_holidays[].start_date | string (date) | First day (full holiday, not clipped). |
longest_holidays[].end_date | string (date) | Last day (full holiday, not clipped). |
longest_holidays[].country | string | ISO country code. |
longest_holidays[].country_name | string | Country name. |
longest_holidays[].working_days | integer | Its working days that fall inside the period. |
longest_holidays[].assigned_employees | integer | Active employees residing in its country. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 400 | bad_request | A 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. |
| 401 | token_missing | No Authorization: Bearer … header, or it is malformed. | Send Authorization: Bearer qhr_… with the full token. |
| 401 | token_invalid | The 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. |
| 401 | token_expired | The token is past its expiry date. | Create a new token. |
| 401 | token_revoked | The 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. |
| 401 | tenant_inactive | The company account is suspended. | Contact QHR support. |
| 403 | forbidden | The token owner's role lacks the permission this operation needs. | Ask an admin to grant the permission shown on this operation (x-permission). |
| 403 | employee_inactive | The token owner's employee record is not active. | HR must reactivate the employee record. |
| 403 | tenant_access_revoked | The 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. |
entitlement_blocked · 429 rate_limited · 500 internal_error