QHR Developers

Create an attendance profile

POST/attendance_settings
Needs a read & write tokenAdd attendance profiles attendance_profile/createRequires feature attendance_profileNot available in Claudeattendance_profiles.create

Creates a set of working-time rules: working hours, days off, optional per-weekday shifts, grace period, when a missing check-in becomes an absence, break tracking, and whether employees may ask for corrections and permissions. A new profile has nobody on it until employees are moved onto it.

When to use: when a group of employees works on different rules from the existing profiles (a night shift, a branch with another weekend). To move people onto it afterwards, use attendance_profiles.assign.

Prerequisites: a unique English and Arabic name. Location ids for day shifts come from employees.meta_data (locations). Send days_off: when omitted on create the profile has no day off.

Side effects: recorded in the audit log. With is_default: true the profile replaces the company default, and the upcoming leave of every employee who falls back to the default is recounted with its days off. Not offered to Claude, because it sets how attendance and leave are counted for the whole company.

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
attendance_settingRequiredobjectThe profile's fields. On update, send only what changes.
attendance_setting.name_enstringName in English, unique in the company.
attendance_setting.name_arstringName in Arabic, unique in the company.
attendance_setting.is_defaultbooleanMake this the company's default profile (the previous default stops being one). Cannot be turned off directly: make another profile the default instead.
attendance_setting.work_start_timestringWork starts, HH:MM, company time.
attendance_setting.work_end_timestringWork ends, HH:MM; must differ from the start. An end before the start is a night shift, whose length must equal daily_target_hours.
attendance_setting.daily_target_hoursnumberHours owed on a working day, 1 to 24.
attendance_setting.days_offarray<integer>Days off, 0 (Sunday) to 6 (Saturday); at least one working day must remain. Omitted on create: no day off. Omitted on update: unchanged.
attendance_setting.correction_requests_enabledbooleanAllow correction requests.
attendance_setting.correction_request_limit_daysintegerDays back a correction may be asked for, 1 to 90.
attendance_setting.correction_approved_bystringWho approves correction and permission requests: manager, hr or manager_and_hr (the manager, then HR).
Allowed values: manager, hr, manager_and_hr
attendance_setting.permission_requests_enabledbooleanAllow permission (late arrival / early leave) requests.
attendance_setting.grace_period_enabledbooleanUse a grace period for late arrivals.
attendance_setting.grace_period_minutesintegerGrace period, 0 to 120 minutes.
attendance_setting.auto_absent_after_minutesintegerMark absent after this many minutes with no check-in, 1 to 720; more than the grace period.
attendance_setting.track_breaksbooleanRecord breaks and deduct them from hours worked.
attendance_setting.allowed_break_minutesintegerAllowed break a day, 0 to 480 minutes, shorter than the working day.
attendance_setting.day_shifts_attributesarray<object>Day shifts to add, change (with id) or remove (id + _destroy: true). One per weekday, never on a day off.
attendance_setting.day_shifts_attributes[].idintegerExisting day shift id, to change or remove it.
attendance_setting.day_shifts_attributes[].namestringShift name.
attendance_setting.day_shifts_attributes[].day_of_weekintegerWeekday, 0 (Sunday) to 6 (Saturday).
attendance_setting.day_shifts_attributes[].kindstringrigid or flexible.
Allowed values: rigid, flexible
attendance_setting.day_shifts_attributes[].start_timestringStart, HH:MM; required on a rigid day, ignored on a flexible one.
attendance_setting.day_shifts_attributes[].required_hoursnumberHours; on a rigid day it must equal daily_target_hours.
attendance_setting.day_shifts_attributes[].location_idintegerLocation of the shift, from employees.meta_data (locations).
attendance_setting.day_shifts_attributes[]._destroybooleanTrue to remove this shift.

Response

201 The new profile.

FieldTypeDescription
idintegerProfile id; null only for the built-in default of a company with no saved profile.
namestringName in the requested language.
name_enstringName in English, unique in the company.
name_arstringName in Arabic, unique in the company.
is_defaultbooleanTrue for the company's default profile, used by every employee with no other profile.
work_start_timestringWork starts, HH:MM, company time.
work_end_timestringWork ends, HH:MM; earlier than the start means a night shift ending the next day.
daily_target_hoursnumberHours owed on a working day.
weekly_target_hoursnumberHours owed in a week, derived from the days off and day shifts.
weekly_target_daysintegerWorking days in a week (7 minus the days off).
days_offarray<integer>The profile's days off, 0 (Sunday) to 6 (Saturday).
correction_requests_enabledbooleanEmployees may ask to correct a missed or wrong check-in.
correction_request_limit_daysintegerHow many days back a correction may be asked for.
correction_approved_bystringWho approves correction and permission requests: manager, hr or manager_and_hr (the manager, then HR).
Allowed values: manager, hr, manager_and_hr
permission_requests_enabledbooleanEmployees may ask permission to arrive late or leave early.
grace_period_enabledbooleanA late arrival within the grace period is not counted late.
grace_period_minutesintegerGrace period in minutes.
auto_absent_after_minutesintegerMinutes after the start with no check-in before the day is marked absent.
track_breaksbooleanBreaks are recorded and deducted from the hours worked.
allowed_break_minutesintegerBreak minutes a day allowed when breaks are tracked.
assigned_employees_countintegerEmployees on this profile today.
day_shiftsarray<object>Per-weekday shifts; a weekday with none uses the work start and end times.
day_shifts[].idintegerDay shift id; send it back to change or remove this shift.
day_shifts[].namestringShift name, e.g. Morning.
day_shifts[].day_of_weekintegerWeekday, 0 (Sunday) to 6 (Saturday).
min 0 · max 6
day_shifts[].kindstringrigid (fixed start) or flexible (hours only).
Allowed values: rigid, flexible
day_shifts[].start_timestringStart, HH:MM, company time; null on a flexible day.
day_shifts[].required_hoursnumberHours the day lasts.
day_shifts[].location_idintegerLocation the shift is worked at, if any.
day_shifts[].location_namestringThat location's name.

Errors

HTTPCodeMeaningHow to fix
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 breaks a rule: a name already used, start and end equal, hours out of range, all seven days off, a rigid day shift whose hours differ from the daily target, two shifts on one weekday or a shift on a day off.Fix the field named in error and send again.
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 →