QHR Developers

Withdraw my reason for a time incident

DELETE/time_incidents/{id}/justification
Needs a read & write tokenCheck in/out and view own attendance history attendance/view_ownRequires feature attendanceNot available in Claudetime_incidents.withdraw_justification

Deletes the reason the token's owner attached to one of their own incidents. The incident itself stays pending, now with no explanation.

When to use: when the employee no longer wants their explanation on file. To change the wording, send a new one with time_incidents.submit_justification instead. Allowed under the same conditions as writing it: nobody has acted on the incident, the deadline has not passed and no payroll run covers the day.

Prerequisites: the incident's id, from the employee's own attendance history. An incident that is not the owner's, or that has no reason on file, answers 404.

Side effects: the reason is deleted for good. Recorded in the audit log. Not offered to Claude: the text cannot be recovered, and the deciders then see the day unexplained.

Irreversible operation

This operation cannot be undone and can affect the whole company. Double-check the ids before you call it. For safety it is never offered through Claude.

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

Response

200 The incident without a 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 →