QHR Developers

Request overtime

POST/overtime_requests
Needs a read & write tokenCheck in/out and view own attendance history attendance/view_ownRequires feature attendanceAvailable in Claudeovertime_requests.create

Submits overtime the token owner worked, as a date with a start and end time on the company clock. Overtime is time outside the schedule, so QHR removes any part that falls inside the shift of that day: if it cuts the window, the request is saved with the kept hours, trimmed: true, and a warning saying what was cut. On a weekend, holiday or leave day the whole window counts. On a flexible day only hours worked beyond the day's required hours, between check-in and check-out, count, and only once the employee has checked out.

Approval chain: the request goes to the employee's manager (pending_manager) and then to HR (pending_hr); with no manager it goes straight to HR. Only after HR approves is it paid.

When to use: when an employee says they stayed late or worked a day off. Check the result's warning and tell the employee if hours were cut.

Prerequisites: the token owner must be an employee, with "View own attendance". The date may not be in a payroll run that has passed time verification, may not overlap another pending or approved request of the same day, and the window may not last more than 12 hours.

Side effects: emails the manager that a request awaits approval (or, with no manager, everyone who holds "View attendance reports", i.e. HR). Nothing reaches payroll until HR approves. Recorded in the audit log.

Parameters

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

Request body

application/json

FieldTypeDescription
overtime_requestRequiredobjectThe overtime worked.
overtime_request.dateRequiredstring (date)The work day (YYYY-MM-DD). For a window past midnight, the day it started.
overtime_request.start_timeRequiredstringStart, HH:MM 24-hour, company time zone.
overtime_request.end_timeRequiredstringEnd, HH:MM. Earlier than the start means the next day. At most 12 hours.
overtime_request.reasonRequiredstringWhy the overtime was needed, up to 500 characters.

Response

201 The saved request; `warning` when it was trimmed.

FieldTypeDescription
recordRequiredobjectOne overtime request.
record.idRequiredintegerOvertime request id.
record.employee_idRequiredintegerId of the employee who asked.
record.employee_nostringTheir employee number.
record.employee_namestringTheir full name.
record.dateRequiredstring (date)The work day the hours belong to (YYYY-MM-DD).
record.start_timeRequiredstringStart, HH:MM on the employee's wall clock (company time zone).
record.end_timeRequiredstringEnd, HH:MM. Earlier than the start means it ends the next day.
record.minutesRequiredintegerLength in minutes (1 to 720).
record.hoursnumberLength in hours, two decimals.
record.reasonstringWhy the overtime was worked.
record.statusRequiredstringWhere the request stands: pending_manager (waiting for the employee's manager), pending_hr (waiting for HR), approved (will be paid), rejected or cancelled (by the employee).
Allowed values: pending_manager, pending_hr, approved, rejected, cancelled
record.trimmedbooleanTrue when QHR cut the asked window because part of it fell inside the shift.
record.original_start_timestringThe start originally asked, when trimmed.
record.original_end_timestringThe end originally asked, when trimmed.
record.current_approver_namestringWho must decide next: the manager's name, or "HR" (translated). Null once decided.
record.can_actbooleanTrue when the token owner may approve or reject it now.
record.attendance_profileobjectThe employee's schedule on that date, so an approver can see the claim is outside it.
record.attendance_profile.idintegerAttendance profile id.
record.attendance_profile.namestringAttendance profile name.
record.attendance_profile.daily_target_hoursnumberHours a normal day asks.
record.attendance_profile.grace_period_minutesintegerLate grace, minutes.
record.attendance_profile.shift_startstringShift start that day, HH:MM; null on a day off or flexible day.
record.attendance_profile.shift_endstringShift end that day, HH:MM.
record.attendance_profile.day_typestringworking_day, weekend, holiday or on_leave.
record.attendance_profile.flexiblebooleanTrue on a flexible day (hours owed, no fixed window).
record.attendance_profile.scheduled_hoursnumberHours owed that day; null when nothing is owed.
record.managerobjectThe manager's decision: who, when and the note. Null until that desk has acted.
record.manager.idintegerEmployee id of the approver.
record.manager.namestringApprover's full name.
record.manager.acted_atstringWhen they decided, in UTC (ISO 8601).
record.manager.notestringTheir note; always present on a rejection.
record.hrobjectThe HR decision: who, when and the note. Null until that desk has acted.
record.hr.idintegerEmployee id of the approver.
record.hr.namestringApprover's full name.
record.hr.acted_atstringWhen they decided, in UTC (ISO 8601).
record.hr.notestringTheir note; always present on a rejection.
record.payroll_idintegerThe payroll run that paid it; null until a run takes it.
record.created_atstringWhen it was submitted, in UTC (ISO 8601).
warningstringPresent when the window was trimmed: what was kept and why. Show it to the employee.

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.
422employee_requiredThe token owner is a system user with no employee record, and overtime belongs to employees.Use a token created by a user linked to an employee, or ask HR to link your user to your 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 →