Deduct or ignore a time incident
/time_incidents/{id}/decideattendance/view_teamRequires feature attendanceNot available in Claudetime_incidents.decideRecords 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
| Name | In | Type | Description | Example |
|---|---|---|---|---|
idRequired | path | integer | Time incident id, from time_incidents.list or time_incidents.team_list (the employee's own ids come from their attendance history). | 5120 |
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 |
|---|---|---|
statusRequired | string | deducted (deduct, or recommend deducting at the manager stage of a manager_and_hr route) or ignored.Allowed values: deducted, ignored |
note | string | Why, up to 500 characters. Shown to the employee with the decision. |
Response
200 The incident after the decision, in `record`.
| Field | Type | Description |
|---|---|---|
recordRequired | object | One time incident as a decider (HR or manager) sees it. |
record.idRequired | integer | Incident id. |
record.employee_idRequired | integer | The employee's id. |
record.employee_no | string | Employee number. |
record.employee_name | string | Employee's full name. |
record.department | string | Employee's department. |
record.dateRequired | string (date) | The day it happened. |
record.kindRequired | string | absence, 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.minutesRequired | integer | Minutes at stake: what a deduction would take off. |
record.hours | number | The same, in hours. |
record.statusRequired | string | pending_manager (waiting on the manager), pending_hr (waiting on HR), deducted or ignored.Allowed values: pending_manager, pending_hr, deducted, ignored |
record.deductible | boolean | False for incomplete: it can only be ignored, or fixed by correcting the attendance. |
record.can_decide | boolean | The token's owner may decide it at its current stage (its manager, or HR at the HR stage). |
record.can_act | boolean | No payroll run blocks a decision. Act only when both can_act and can_decide are true. |
record.lock_reason | string | Why 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_reference | string | Reference of the payroll run behind lock_reason. |
record.payroll_id | integer | The payroll run that paid this deduction. |
record.deduct_escalates | boolean | Deducting 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.manager | object | The manager who owes, or gave, the manager-stage decision. |
record.manager.id | integer | Employee id. |
record.manager.name | string | Full name. |
record.manager_acted_at | string (date-time) | When the manager recommended a deduction (UTC). |
record.manager_note | string | The manager's note with that recommendation. |
record.decided_by | object | Who made the final decision. |
record.decided_by.id | integer | Employee id. |
record.decided_by.name | string | Full name. |
record.decided_at | string (date-time) | When the final decision was made (UTC). |
record.note | string | The decider's note. |
record.justification | object | The employee's reason, or null when they gave none. |
record.justification.reason | string | What the employee wrote. |
record.justification.submitted_at | string (date-time) | When it was written (UTC). |
record.justification.conflicted | boolean | The incident's minutes changed after the reason was written (the attendance was corrected); read both before deciding. |
record.justification_window | object | Whether the employee can still explain the day. Information only: a decision is allowed while it is open. |
record.justification_window.open | boolean | The window is still open. |
record.justification_window.deadline | string (date) | Last day to explain; null when the profile allows no corrections. |
record.justification_window.days_left | integer | Days left until the deadline. |
record.attendance | object | The attendance record behind it. |
record.attendance.record_id | integer | Attendance record id. |
record.attendance.status | string | Attendance status of the day (absent, late, present…). |
record.attendance.check_in_at | string (date-time) | Check-in (UTC). |
record.attendance.check_out_at | string (date-time) | Check-out (UTC). |
record.attendance.worked_hours | number | Hours worked. |
record.attendance_profile | object | The attendance profile and shift the day was judged against. |
record.attendance_profile.id | integer | Profile id. |
record.attendance_profile.name | string | Profile name. |
record.attendance_profile.daily_target_hours | number | Hours expected a day. |
record.attendance_profile.grace_period_minutes | integer | Grace period. |
record.attendance_profile.shift_start | string | Shift start, HH:MM (null on a flexible day). |
record.attendance_profile.shift_end | string | Shift end, HH:MM. |
record.attendance_profile.day_type | string | working_day, weekend, holiday or on_leave. |
record.attendance_profile.flexible | boolean | A flexible day (hours, no fixed window). |
record.attendance_profile.scheduled_hours | number | Hours scheduled that day. |
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 | The 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. |
| 422 | employee_required | The 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. |
entitlement_blocked · 429 rate_limited · 500 internal_error