Explain one of my time incidents
/time_incidents/{id}/justificationattendance/view_ownRequires feature attendanceAvailable in Claudetime_incidents.submit_justificationAttaches 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
| 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 |
|---|---|---|
reasonRequired | string | What happened that day, in the employee's words. 1 to 500 characters. |
Response
200 The incident with its reason, in `record`.
| Field | Type | Description |
|---|---|---|
recordRequired | object | One of the employee's own incidents, as they see it. |
record.idRequired | integer | Incident id. |
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. |
record.hours | number | The same, in hours. |
record.statusRequired | string | pending (not decided yet), deducted or ignored.Allowed values: pending, deducted, ignored |
record.review | object | The decision, once there is one. |
record.review.decision | string | deducted or ignored; null while pending. |
record.review.decided_by | object | Who decided. |
record.review.decided_by.id | integer | Employee id. |
record.review.decided_by.name | string | Full name. |
record.review.decided_at | string (date-time) | When (UTC). |
record.review.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.can_justifyRequired | boolean | The employee may still write, change or withdraw the reason. |
record.blocked_reason | string | Why not, when can_justify is false: corrections_disabled, window_expired, already_decided or payroll_locked. |
record.justify_deadline | string (date) | Last day to explain; null when the profile allows no corrections. |
record.days_left | integer | Days left until the deadline. |
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 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. |
| 422 | employee_required | The token's owner has no employee record in this company, so has no incidents to explain. | Use a token created by the employee themselves. |
entitlement_blocked · 429 rate_limited · 500 internal_error