Update an attendance profile
/attendance_settings/{id}attendance_profile/editRequires feature attendance_profileNot available in Claudeattendance_profiles.updateChanges the fields you send; the rest stay as they are. Day shifts are added, changed (with their id) or removed (_destroy: true) through day_shifts_attributes.
A change to the days off or day shifts applies from tomorrow: today keeps the schedule it started with, so check-ins already judged today are not restated. A profile created today changes at once.
When to use: to change working hours, days off, the grace period or request rules for everyone on a profile. To move one employee to another profile instead, use attendance_profiles.change_employee_profile.
Prerequisites: the profile's id from attendance_profiles.list; read the current values and day shift ids with attendance_profiles.show.
Side effects: recorded in the audit log. When the days off change, or the profile becomes the default, the upcoming leave (pending, and approved but not started) of every employee it governs is recounted with the new days off. Not offered to Claude, because it changes how attendance and leave are counted for everyone on the profile.
Not available in Claude yet.
Before you call this
You will need ids that come from these operations:
Parameters
| Name | In | Type | Description | Example |
|---|---|---|---|---|
idRequired | path | integer | Attendance profile id, from attendance_profiles.list. | 3 |
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 |
|---|---|---|
attendance_settingRequired | object | The profile's fields. On update, send only what changes. |
attendance_setting.name_en | string | Name in English, unique in the company. |
attendance_setting.name_ar | string | Name in Arabic, unique in the company. |
attendance_setting.is_default | boolean | Make 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_time | string | Work starts, HH:MM, company time. |
attendance_setting.work_end_time | string | Work 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_hours | number | Hours owed on a working day, 1 to 24. |
attendance_setting.days_off | array<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_enabled | boolean | Allow correction requests. |
attendance_setting.correction_request_limit_days | integer | Days back a correction may be asked for, 1 to 90. |
attendance_setting.correction_approved_by | string | Who 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_enabled | boolean | Allow permission (late arrival / early leave) requests. |
attendance_setting.grace_period_enabled | boolean | Use a grace period for late arrivals. |
attendance_setting.grace_period_minutes | integer | Grace period, 0 to 120 minutes. |
attendance_setting.auto_absent_after_minutes | integer | Mark absent after this many minutes with no check-in, 1 to 720; more than the grace period. |
attendance_setting.track_breaks | boolean | Record breaks and deduct them from hours worked. |
attendance_setting.allowed_break_minutes | integer | Allowed break a day, 0 to 480 minutes, shorter than the working day. |
attendance_setting.day_shifts_attributes | array<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[].id | integer | Existing day shift id, to change or remove it. |
attendance_setting.day_shifts_attributes[].name | string | Shift name. |
attendance_setting.day_shifts_attributes[].day_of_week | integer | Weekday, 0 (Sunday) to 6 (Saturday). |
attendance_setting.day_shifts_attributes[].kind | string | rigid or flexible.Allowed values: rigid, flexible |
attendance_setting.day_shifts_attributes[].start_time | string | Start, HH:MM; required on a rigid day, ignored on a flexible one. |
attendance_setting.day_shifts_attributes[].required_hours | number | Hours; on a rigid day it must equal daily_target_hours. |
attendance_setting.day_shifts_attributes[].location_id | integer | Location of the shift, from employees.meta_data (locations). |
attendance_setting.day_shifts_attributes[]._destroy | boolean | True to remove this shift. |
Response
200 The profile after the change.
| Field | Type | Description |
|---|---|---|
id | integer | Profile id; null only for the built-in default of a company with no saved profile. |
name | string | Name in the requested language. |
name_en | string | Name in English, unique in the company. |
name_ar | string | Name in Arabic, unique in the company. |
is_default | boolean | True for the company's default profile, used by every employee with no other profile. |
work_start_time | string | Work starts, HH:MM, company time. |
work_end_time | string | Work ends, HH:MM; earlier than the start means a night shift ending the next day. |
daily_target_hours | number | Hours owed on a working day. |
weekly_target_hours | number | Hours owed in a week, derived from the days off and day shifts. |
weekly_target_days | integer | Working days in a week (7 minus the days off). |
days_off | array<integer> | The profile's days off, 0 (Sunday) to 6 (Saturday). |
correction_requests_enabled | boolean | Employees may ask to correct a missed or wrong check-in. |
correction_request_limit_days | integer | How many days back a correction may be asked for. |
correction_approved_by | string | Who approves correction and permission requests: manager, hr or manager_and_hr (the manager, then HR).Allowed values: manager, hr, manager_and_hr |
permission_requests_enabled | boolean | Employees may ask permission to arrive late or leave early. |
grace_period_enabled | boolean | A late arrival within the grace period is not counted late. |
grace_period_minutes | integer | Grace period in minutes. |
auto_absent_after_minutes | integer | Minutes after the start with no check-in before the day is marked absent. |
track_breaks | boolean | Breaks are recorded and deducted from the hours worked. |
allowed_break_minutes | integer | Break minutes a day allowed when breaks are tracked. |
assigned_employees_count | integer | Employees on this profile today. |
day_shifts | array<object> | Per-weekday shifts; a weekday with none uses the work start and end times. |
day_shifts[].id | integer | Day shift id; send it back to change or remove this shift. |
day_shifts[].name | string | Shift name, e.g. Morning. |
day_shifts[].day_of_week | integer | Weekday, 0 (Sunday) to 6 (Saturday). min 0 · max 6 |
day_shifts[].kind | string | rigid (fixed start) or flexible (hours only).Allowed values: rigid, flexible |
day_shifts[].start_time | string | Start, HH:MM, company time; null on a flexible day. |
day_shifts[].required_hours | number | Hours the day lasts. |
day_shifts[].location_id | integer | Location the shift is worked at, if any. |
day_shifts[].location_name | string | That location's name. |
Errors
| HTTP | Code | Meaning | How to fix |
|---|---|---|---|
| 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. |
| 404 | not_found | The record does not exist, or you cannot see it. | Check the id. List the records first to get a valid one. |
| 422 | validation_failed | A field breaks a rule (see attendance_profiles.create), or is_default: false was sent for the default profile. | Fix the field named in error. To change the default, make another profile the default. |
entitlement_blocked · 429 rate_limited · 500 internal_error