Register hours
POST /shifts/hours
Requires the shifts:write scope and an Idempotency-Key header. Registers hours an employee already worked. The entry is submitted and counts for nothing until the company's owner approves it. Same body as Create a shift, but the times must have already happened.
Authentication
Requires a bearer access token with the shifts:write scope.
Idempotency
Send an Idempotency-Key header with every request. See Idempotency. The sample generates one with uuidgen.
Body
JSON. A field that is not listed is refused.
| Name | Required | Description |
|---|---|---|
employee_ref | Yes | The employee, as returned by the shifts or mileage reads. |
start_time | Yes | ISO 8601 with a UTC offset, to the minute. |
end_time | Yes | ISO 8601 with a UTC offset, to the minute. After start_time, at most 24 hours later. |
break_minutes | No | Unpaid break in whole minutes, 0 to 720 and shorter than the shift. Default 0. |
Errors
See Errors for the full list of status codes this endpoint can return.
Samples
curl
curl -X POST "https://app.sparro.dk/api/v2/shifts/hours" \
-H "Authorization: Bearer $SPARRO_ACCESS_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"employee_ref":"emp_Qm9hcmRFeGFtcGxlUmVmZXJlbmNlS2V5Rm9yRG9jc09","start_time":"2026-10-30T08:00:00+01:00","end_time":"2026-10-30T16:00:00+01:00","break_minutes":30}'