QHR Developers

Add a public holiday

POST/holidays
Needs a read & write tokenAdd public holidays public_holiday/createRequires feature public_holidayNot available in Claudeholidays.create

Adds 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

NameInTypeDescriptionExample
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Request body

application/json

FieldTypeDescription
holidayRequiredobjectThe holiday's fields.
holiday.name_enstringName in English, up to 100 characters.
holiday.name_arstringName in Arabic, up to 100 characters.
holiday.start_datestring (date)First day.
holiday.end_datestring (date)Last day, on or after start_date. Same as start_date for a one-day holiday.
holiday.countrystringISO country code (SA, AE…). The holiday applies to employees residing in that country.
holiday.show_on_dashboard_for_assigned_usersbooleanShow it in those employees' upcoming-holidays card. Default true.

Response

201 The new holiday.

FieldTypeDescription
idRequiredintegerHoliday id.
namestringName in the requested language (English when the Arabic name is empty).
start_dateRequiredstring (date)First day of the holiday.
end_dateRequiredstring (date)Last day of the holiday, inclusive.
countryRequiredstringCountry that observes it, ISO code (SA, AE…). Applies to employees whose country of residence is this one.
country_namestringCountry name in the requested language.
show_on_dashboard_for_assigned_usersbooleanShown in the upcoming-holidays card of the employees it applies to.
name_enRequiredstringName in English.
name_arRequiredstringName in Arabic.

Errors

HTTPCodeMeaningHow to fix
400bad_requestA parameter is missing or malformed.Check the parameters against this operation's documentation.
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.
403token_read_onlyThis token can only read; the operation makes changes.Use a token created with "Allow changes".
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.
422validation_failedA 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.
422employee_requiredThe 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.
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 →