QHR Developers

Explain one of my time incidents

PUT/time_incidents/{id}/justification
Needs a read & write tokenCheck in/out and view own attendance history attendance/view_ownRequires feature attendanceAvailable in Claudetime_incidents.submit_justification

Attaches the token owner's reason to one of their own incidents (an absence, late arrival, early leave or short day), or replaces the reason already there. The manager or HR sees it next to the incident when they decide whether to deduct it from pay. Writing it does not decide anything: the incident stays pending.

When to use: when an employee wants to explain a day ("I was stuck in traffic", "I was at a client's office"). Allowed only while nobody has acted on the incident, before the deadline (the attendance profile's correction days after the incident date) and while no payroll run covers the day; the incident's can_justify says whether it is still possible, and blocked_reason why not.

Prerequisites: the incident's id, from the employee's own attendance history. Only the token owner's own incidents can be explained; any other id answers 404.

Side effects: the reason is stored with the time it was written and the incident's minutes at that moment; if the attendance is later corrected, the deciders see it flagged conflicted. Sending it again replaces the text. Recorded in the audit log. No notification is sent.

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
reasonRequiredstringWhat happened that day, in the employee's words. 1 to 500 characters.

Response

200 The incident with its reason, in `record`.

FieldTypeDescription
recordRequiredobjectOne of the employee's own incidents, as they see it.
record.idRequiredintegerIncident id.
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.
record.hoursnumberThe same, in hours.
record.statusRequiredstringpending (not decided yet), deducted or ignored.
Allowed values: pending, deducted, ignored
record.reviewobjectThe decision, once there is one.
record.review.decisionstringdeducted or ignored; null while pending.
record.review.decided_byobjectWho decided.
record.review.decided_by.idintegerEmployee id.
record.review.decided_by.namestringFull name.
record.review.decided_atstring (date-time)When (UTC).
record.review.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.can_justifyRequiredbooleanThe employee may still write, change or withdraw the reason.
record.blocked_reasonstringWhy not, when can_justify is false: corrections_disabled, window_expired, already_decided or payroll_locked.
record.justify_deadlinestring (date)Last day to explain; null when the profile allows no corrections.
record.days_leftintegerDays left until the deadline.

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 reason cannot be changed now. blocked_reason says why: corrections_disabled (the employee's attendance profile does not allow corrections), window_expired (past the deadline, the profile's correction days after the incident date), already_decided (a manager or HR has acted on it) or payroll_locked (a payroll run has paid it or covers its date). Without blocked_reason, the reason itself is not valid (blank, or over 500 characters).With blocked_reason nothing can be done through the API; the employee can raise it with their manager or HR. Otherwise send a reason of 1 to 500 characters.
422employee_requiredThe token's owner has no employee record in this company, so has no incidents to explain.Use a token created by the employee themselves.
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 →