DeveloperRegister an app
Menu

Create a shift

POST /shifts

Requires the shifts:write scope and an Idempotency-Key header. Plans one shift for an employee of the connected company. Rest-law rules apply and cannot be overridden; the employee is notified like for any new shift.

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.

NameRequiredDescription
employee_refYesThe employee, as returned by the shifts or mileage reads.
start_timeYesISO 8601 with a UTC offset, to the minute.
end_timeYesISO 8601 with a UTC offset, to the minute. After start_time, at most 24 hours later.
break_minutesNoUnpaid 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" \
  -H "Authorization: Bearer $SPARRO_ACCESS_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"employee_ref":"emp_Qm9hcmRFeGFtcGxlUmVmZXJlbmNlS2V5Rm9yRG9jc09","start_time":"2026-11-02T08:00:00+01:00","end_time":"2026-11-02T16:00:00+01:00","break_minutes":30}'