## Approve, reject or cancel an absence

`POST /api/hr/v1/absences/{id}/{action}`

Module: HR · operationId: `runAbsenceAction` · Tag: Absences · Auth: access token (`Authorization: Bearer <accessToken>`)

Approvers (hr:absence:approve) approve and reject requests and cancellation requests of
others (a reason is required to reject) and cancel any absence. Owners withdraw their
requests; cancelling an approved absence that needs approval and has not started becomes
`cancellation_requested`. Not allowed in the current status: `409 invalid_state`.

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string (uuid) | yes |  |
| `action` | path | string | yes | (one of `approve`, `reject`, `cancel`) |

### Request body

`application/json` (required)

- `version` (integer, required): Version of the absence the decision is based on
- `note` (string): Note of the decision (e.g. the reason of a rejection) (max length 2000)

Example:

```json
{
  "note": "Passt, die Vertretung übernimmt Elias.",
  "version": 1
}
```

### Responses

- **200** Decided (`application/json`)
- **400** Error (`application/json`)
- **403** Error (`application/json`)
- **404** Error (`application/json`)
- **409** Error (`application/json`)

Fields of the 200 answer:

- `createdAt` (string (date-time)): When the absence was created
- `createdBy` (string): Who entered the absence (e-mail of the caller; the platform team acting in the tenant: „Plattformbetrieb (MBCOM) · <Name>“)
- `days` (number): Working days (halves allowed)
- `decidedAt` (string (date-time)): When it was decided last
- `decidedBy` (string): Who decided last (e-mail; the platform team acting in the tenant: „Plattformbetrieb (MBCOM) · <Name>“)
- `decisionNote` (string): Note of the last decision (e.g. the reason of a rejection)
- `employeeId` (string): Id of the employee
- `employeeName` (string): Display name of the employee (in lists)
- `endDate` (string (date)): Last day (YYYY-MM-DD), inclusive
- `endHalf` (boolean): The last day is only the morning
- `id` (string): Id of the absence
- `note` (string): The employee's note
- `startDate` (string (date)): First day (YYYY-MM-DD)
- `startHalf` (boolean): The first day is only the afternoon
- `status` (string): State of the absence; types without approval start as approved (one of `requested`, `approved`, `rejected`, `cancelled`, `cancellation_requested`)
- `typeId` (string): Id of the absence type
- `updatedAt` (string (date-time)): When the absence was last changed
- `version` (integer): Version for optimistic locking: send the version you read with a change (stale: 409 version_conflict)

Example 200 answer:

```json
{
  "createdAt": "2026-11-16T08:12:00Z",
  "createdBy": "sophie.huber@muster-it.example",
  "days": 5,
  "employeeId": "e5a1c3d7-2b4f-4c6e-8a0b-1d3f5b7c9e02",
  "employeeName": "Sophie Huber",
  "endDate": "2026-12-18",
  "endHalf": false,
  "id": "3e5a7c9e-1a3c-4e5a-8c7e-9a1c3e5a7c31",
  "note": "Städtereise Wien",
  "startDate": "2026-12-14",
  "startHalf": false,
  "status": "requested",
  "typeId": "8c0e2a4c-6e8a-4c0e-9a4c-6e8a0c2e4a13",
  "updatedAt": "2026-11-16T08:12:00Z",
  "version": 1
}
```

### Example request

```bash
curl -X POST 'https://api.mbcom.cloud/api/hr/v1/absences/3f2b8c1e-7d4a-4e9b-9c2a-5b1d6e8f0a12/approve' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"note":"Passt, die Vertretung übernimmt Elias.","version":1}'
```
