## Correct an entry

`PATCH /api/hr/v1/time-entries/{id}`

Module: HR · operationId: `updateTimeEntry` · Tag: Working time · Auth: access token (`Authorization: Bearer <accessToken>`)

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string (uuid) | yes |  |

### Request body

`application/json` (required)

- `start` (string (date-time), required): Start of the segment
- `breakMinutes` (integer): Break inside the segment in minutes
- `employeeId` (string): Defaults to the caller
- `end` (string (date-time)): End of the segment; omitted for an open (running) one
- `endedForBreak` (boolean): The end is a break stamp („Pause“), not „Gehen“. Omitted on PATCH keeps the stored value; ignored without an end.
- `note` (string): Note on the entry
- `reason` (string): Reason of the change; required for other people's time and own entries older than the self-edit window
- `version` (integer): Required for PATCH

Example:

```json
{
  "breakMinutes": 45,
  "end": "2026-11-17T15:15:00Z",
  "reason": "Pause und Ende korrigiert",
  "start": "2026-11-17T06:30:00Z",
  "version": 2
}
```

### Responses

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

Fields of the 200 answer:

- `autoEnded` (boolean): HR ended the segment at midnight because nobody clocked out (setting `autoEndAtMidnight`). It counts no working time until it is corrected; any change clears the mark.
- `breakMinutes` (integer): Break inside the segment in minutes (manual entries)
- `createdAt` (string (date-time)): When the time entry was created
- `createdBy` (string): Who created the time entry (e-mail of the caller)
- `employeeId` (string): Id of the employee
- `end` (string (date-time)): Missing while running
- `endedForBreak` (boolean): The segment was closed by starting a break
- `id` (string): Id of the time entry
- `note` (string): Note on the entry
- `source` (string): clock: stamped, manual: entered by hand (one of `clock`, `manual`)
- `start` (string (date-time)): Start of the segment
- `updatedAt` (string (date-time)): When the time entry was last changed
- `updatedBy` (string): Who last changed the time entry (e-mail of the caller)
- `version` (integer): Version for optimistic locking: send the version you read with a change (stale: 409 version_conflict)

Example 200 answer:

```json
{
  "autoEnded": false,
  "breakMinutes": 30,
  "createdAt": "2026-11-18T06:28:00Z",
  "createdBy": "sophie.huber@muster-it.example",
  "employeeId": "e5a1c3d7-2b4f-4c6e-8a0b-1d3f5b7c9e02",
  "end": "2026-11-18T15:00:00Z",
  "endedForBreak": false,
  "id": "3a5c7e9a-1c3e-4a5c-9e7a-1c3e5a7c9e36",
  "source": "clock",
  "start": "2026-11-18T06:28:00Z",
  "updatedAt": "2026-11-18T15:00:00Z",
  "updatedBy": "sophie.huber@muster-it.example",
  "version": 1
}
```

### Example request

```bash
curl -X PATCH 'https://api.mbcom.cloud/api/hr/v1/time-entries/3f2b8c1e-7d4a-4e9b-9c2a-5b1d6e8f0a12' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"breakMinutes":45,"end":"2026-11-17T15:15:00Z","reason":"Pause und Ende korrigiert","start":"2026-11-17T06:30:00Z","version":2}'
```
