QHR Developers

Deduct or ignore a time incident

PATCH/time_incidents/{id}/decide
Needs a read & write tokenView team attendance attendance/view_teamRequires feature attendanceNot available in Claudetime_incidents.decide

Records the decision on one incident: deducted (take the time off pay) or ignored (let it go), with an optional note. The same operation serves the employee's manager and HR; QHR checks who may act at the incident's stage: at pending_manager only the employee's direct manager, at pending_hr only HR (a role with "View attendance reports").

What happens next depends on the stage. A manager's ignored is final. A manager's deducted is final on a manager route, but on a manager_and_hr route it is a recommendation: the incident moves to pending_hr with the manager's note and HR makes the final call (deduct_escalates on the row tells you in advance). HR's decision is always final. A decision can never be changed afterwards.

When to use: when the token's owner has reviewed the day and the employee's reason. incomplete days cannot be deducted, only ignored; fix the attendance instead. To decide many at once, use time_incidents.bulk_decide.

Prerequisites: the incident's id from time_incidents.list (HR) or time_incidents.team_list (manager), where can_decide and can_act must both be true. The token's owner must be linked to an employee record.

Side effects: a final deducted is included by the payroll run covering the date, which lowers that month's pay (absence or undertime minutes on the timesheet). The employee can no longer change or withdraw their reason. Recorded in the audit log. Not offered to Claude, because a deduction takes money off an employee's salary and cannot be undone.

Not available in Claude yet.

Before you call this

You will need ids that come from these operations:

Parameters

NameInTypeDescriptionExample
idRequiredpathintegerTime incident id, from time_incidents.list or time_incidents.team_list (the employee's own ids come from their attendance history).5120
Accept-LanguageheaderstringLanguage of messages and translated labels. English when omitted.
Allowed values: ar, en
ar

Request body

application/json

FieldTypeDescription
statusRequiredstringdeducted (deduct, or recommend deducting at the manager stage of a manager_and_hr route) or ignored.
Allowed values: deducted, ignored
notestringWhy, up to 500 characters. Shown to the employee with the decision.

Response

200 The incident after the decision, in `record`.

FieldTypeDescription
recordRequiredobjectOne time incident as a decider (HR or manager) sees it.
record.idRequiredintegerIncident id.
record.employee_idRequiredintegerThe employee's id.
record.employee_nostringEmployee number.
record.employee_namestringEmployee's full name.
record.departmentstringEmployee's department.
record.dateRequiredstring (date)The day it happened.
record.kindRequiredstringabsence, late, early_leave, short_hours (a flexible day under its hours) or incomplete (check-in or check-out missing; never deductible).
Allowed values: absence, late, early_leave, short_hours, incomplete
record.minutesRequiredintegerMinutes at stake: what a deduction would take off.
record.hoursnumberThe same, in hours.
record.statusRequiredstringpending_manager (waiting on the manager), pending_hr (waiting on HR), deducted or ignored.
Allowed values: pending_manager, pending_hr, deducted, ignored
record.deductiblebooleanFalse for incomplete: it can only be ignored, or fixed by correcting the attendance.
record.can_decidebooleanThe token's owner may decide it at its current stage (its manager, or HR at the HR stage).
record.can_actbooleanNo payroll run blocks a decision. Act only when both can_act and can_decide are true.
record.lock_reasonstringWhy can_act is false: already_paid (a payroll run paid it) or period_locked (a run covering the date is past time verification).
record.payroll_referencestringReference of the payroll run behind lock_reason.
record.payroll_idintegerThe payroll run that paid this deduction.
record.deduct_escalatesbooleanDeducting it now passes it to HR instead of ending it (manager stage of a manager_and_hr route): the button is "Send to HR", not "Deduct".
record.managerobjectThe manager who owes, or gave, the manager-stage decision.
record.manager.idintegerEmployee id.
record.manager.namestringFull name.
record.manager_acted_atstring (date-time)When the manager recommended a deduction (UTC).
record.manager_notestringThe manager's note with that recommendation.
record.decided_byobjectWho made the final decision.
record.decided_by.idintegerEmployee id.
record.decided_by.namestringFull name.
record.decided_atstring (date-time)When the final decision was made (UTC).
record.notestringThe decider's note.
record.justificationobjectThe employee's reason, or null when they gave none.
record.justification.reasonstringWhat the employee wrote.
record.justification.submitted_atstring (date-time)When it was written (UTC).
record.justification.conflictedbooleanThe incident's minutes changed after the reason was written (the attendance was corrected); read both before deciding.
record.justification_windowobjectWhether the employee can still explain the day. Information only: a decision is allowed while it is open.
record.justification_window.openbooleanThe window is still open.
record.justification_window.deadlinestring (date)Last day to explain; null when the profile allows no corrections.
record.justification_window.days_leftintegerDays left until the deadline.
record.attendanceobjectThe attendance record behind it.
record.attendance.record_idintegerAttendance record id.
record.attendance.statusstringAttendance status of the day (absent, late, present…).
record.attendance.check_in_atstring (date-time)Check-in (UTC).
record.attendance.check_out_atstring (date-time)Check-out (UTC).
record.attendance.worked_hoursnumberHours worked.
record.attendance_profileobjectThe attendance profile and shift the day was judged against.
record.attendance_profile.idintegerProfile id.
record.attendance_profile.namestringProfile name.
record.attendance_profile.daily_target_hoursnumberHours expected a day.
record.attendance_profile.grace_period_minutesintegerGrace period.
record.attendance_profile.shift_startstringShift start, HH:MM (null on a flexible day).
record.attendance_profile.shift_endstringShift end, HH:MM.
record.attendance_profile.day_typestringworking_day, weekend, holiday or on_leave.
record.attendance_profile.flexiblebooleanA flexible day (hours, no fixed window).
record.attendance_profile.scheduled_hoursnumberHours scheduled that day.

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.
404not_foundThe record does not exist, or you cannot see it.Check the id. List the records first to get a valid one.
422validation_failedThe decision cannot be recorded. error says why: status is not deducted or ignored; the incident was already decided; the token's owner is not the approver at its stage; a payroll run has paid it or covers its date past time verification; an incomplete day cannot be deducted; or the note is over 500 characters.Read the incident again with time_incidents.list: act only when can_decide and can_act are true, ignore rather than deduct an incomplete day, and to change a locked period revert its payroll run first.
422employee_requiredThe token's owner has no employee record in this company. A decision records who made it, and a manager's queue is their own direct reports, so both need 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 →