# Absence

An absence: the period an employee was away from work, booked for them by HR. An absence with no `end` is still running and reaches through now everywhere it is read, so planning capacity and reporting both keep counting it until someone closes it. The free-text note absences once carried was purged as health data and is not exposed here.

## Used by
- GET /api/v2/absences: List absences (AbsenceList)
- POST /api/v2/absences: Book an absence (Absence)
- GET /api/v2/absences/{absence}: Read an absence (Absence)
- PATCH /api/v2/absences/{absence}: Update an absence (Absence)

## Absence fields
- id (integer, required): Unique identifier.
- user_id (integer, required): The employee this absence is for. Writing it requires the `absences::manage` permission.
- user (Ref or UserSummary, required): The employee the absence is for. Renders as an `{"id": N}` reference unless expanded, and stays a reference when the employee has since been deleted.
- manager_id (integer or null, required): Manager who filed or approved the absence, or `null` when none was recorded. The foreign key nulls on delete, so removing the manager leaves the absence behind unattributed.
- manager (Ref or UserSummary or null, required): The manager who filed or approved the absence; absent when none was recorded.
- start (timestamp (YYYY-MM-DDThh:mm:ssZ), required): When the absence begins. RFC 3339 UTC.
- end (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): When the absence ends, or `null` while it is still running. An ongoing absence reaches through now everywhere it is read (planning capacity and reporting both count it), and that reach is uncapped, so an absence nobody closed keeps consuming capacity. RFC 3339 UTC.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Creation timestamp.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp; use for incremental sync.
- links (AbsenceLinks, required)
  - self (url, required): The canonical URI of this record.

## Variants

### AbsenceList

What a collection returns, and what `?view=summary` returns on a single record.

10 fields.
Identical to the detail object above.

### AbsenceSummary

The embedded form: what you get when another resource carries this one and you did not `include` it.

3 fields.
Omits: user_id, user, manager_id, manager, created_at, updated_at, links

### AbsenceLinks

The `links` object on this resource.

Keys: self

## Example
```json
{
  "id": 1,
  "user_id": 1,
  "user": {
    "id": 1
  },
  "manager_id": 1,
  "manager": null,
  "start": "2026-03-02T08:00:00Z",
  "end": "2026-03-06T17:00:00Z",
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1"
  }
}
```
