Add a public holiday
/holidayspublic_holiday/createRequires feature public_holidayNot available in Claudeholidays.createAdds a public holiday for one country, from start_date to end_date inclusive. It applies to every employee whose country of residence is country.
When to use: when the company announces a holiday (Eid, National Day). A holiday may not overlap another holiday of the same country; to lengthen one, use holidays.update.
Prerequisites: the holidays already set, from holidays.list, to avoid an overlap. The token's owner must be linked to an employee record.
Side effects: every pending or upcoming leave request of the employees in that country is recalculated so the holiday days are not counted as leave (balances change accordingly, and each changed request records the update). In the background, the holiday days are marked "holiday" in those employees' attendance, and any absence already recorded on them is removed, together with its undecided absence deduction (see Time incidents). Refused if a date falls in a payroll period that has already been paid. Not offered to Claude, because it changes the attendance and leave of everyone in the country.
Not available in Claude yet.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
Accept-Language | header | string | Language of messages and translated labels. English when omitted. Allowed values: ar, en | ar |
Request body
application/json
| Field | Type | Description |
|---|---|---|
holidayRequired | object | The holiday's fields. |
holiday.name_en | string | Name in English, up to 100 characters. |
holiday.name_ar | string | Name in Arabic, up to 100 characters. |
holiday.start_date | string (date) | First day. |
holiday.end_date | string (date) | Last day, on or after start_date. Same as start_date for a one-day holiday. |
holiday.country | string | ISO country code (SA, AE…). The holiday applies to employees residing in that country. |
holiday.show_on_dashboard_for_assigned_users | boolean | Show it in those employees' upcoming-holidays card. Default true. |
Response
201 The new holiday.
| Field | Type | Description |
|---|---|---|
idRequired | integer | Holiday id. |
name | string | Name in the requested language (English when the Arabic name is empty). |
start_dateRequired | string (date) | First day of the holiday. |
end_dateRequired | string (date) | Last day of the holiday, inclusive. |
countryRequired | string | Country that observes it, ISO code (SA, AE…). Applies to employees whose country of residence is this one. |
country_name | string | Country name in the requested language. |
show_on_dashboard_for_assigned_users | boolean | Shown in the upcoming-holidays card of the employees it applies to. |
name_enRequired | string | Name in English. |
name_arRequired | string | Name in Arabic. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 400 | bad_request | A parameter is missing or malformed. | Check the parameters against this operation's documentation. |
| 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 | token_read_only | This token can only read; the operation makes changes. | Use a token created with "Allow changes". |
| 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. |
| 422 | validation_failed | A field is missing or not valid: a blank name, an unknown country code, end_date before start_date, dates overlapping another holiday of the same country, or a date in a payroll period that has already been paid (error names the payroll run). | Fix the field named in error. For an overlap, change the dates or edit the existing holiday; for a paid period, revert that payroll run first. |
| 422 | employee_required | The token's owner has no employee record in this company. Adding, changing or deleting a holiday re-prices employees' upcoming leave and records who did it, which needs one. | Use a token created by a user who is linked to an employee record. |
entitlement_blocked · 429 rate_limited · 500 internal_error