Overview / Operations / Create a shift

Create a shift

post https://api.flactrum.com/v1/shifts
Required scope shifts.write
Success status201
Returns One Shift object

Request body

FieldTypeDescription
branch_id * string —
name * string —
start_time * string —
end_time * string An end before the start means the shift crosses midnight. That is valid.
color string|null —

Response fields

FieldTypeDescription
id string —
branch_id string —
name string —
start_time string —
end_time string —
crosses_midnight boolean True when the shift runs into the next day (23:00–07:00).
color string|null —
assignment_count integer —

Examples

Recorded from the test suite — these are real requests and their real responses.

curl -X POST 'https://api.flactrum.com/v1/shifts' \
  -H 'Authorization: Bearer flk_your_key:your_secret' \
  -H 'Content-Type: application/json' \
  -d '{
    "branch_id": "01m43mzaj0mr7w28veyst93v03",
    "name": "Sabah",
    "start_time": "07:00",
    "end_time": "15:00",
    "color": "#6A34E0"
}'

HTTP 201 · application/json

{
    "data": {
        "id": "01m43mzajhtwxa3zcyjz55tgf4",
        "branch_id": "01m43mzaj0mr7w28veyst93v03",
        "name": "Sabah",
        "start_time": "07:00:00",
        "end_time": "15:00:00",
        "crosses_midnight": false,
        "color": "#6A34E0",
        "assignment_count": 0,
        "created_at": "2026-10-04T14:27:03+00:00",
        "updated_at": "2026-10-04T14:27:03+00:00"
    }
}