Create Shift
Create a new staff shift. If a staff_id is provided, the shift is assigned to that staff member. Otherwise, an open shift is created.
Endpointโ
POST /v1/staff/shifts
Authenticationโ
Requires an API key with the staff:write scope.
Request Bodyโ
| Parameter | Type | Required | Description |
|---|---|---|---|
shift_date | string | Yes | Shift date (YYYY-MM-DD) |
start_time | string | Yes | Start time (HH:MM) |
end_time | string | Yes | End time (HH:MM) |
staff_id | integer | No | Staff member to assign. If omitted, creates an open shift. |
location_id | integer | No | Location for the shift |
break_setting | boolean | No | Enable break (default: false) |
break_type | string | No | Break type (e.g., lunch_break) |
break_time | string | No | Break duration in minutes |
break_payment | string | No | Break payment: paid or unpaid |
shift_notes | string | No | Notes for the shift (max 1000 characters) |
experience_availability_id | integer | No | Pre-fill shift_date, start_time, and end_time from an experience session. When provided those three fields become optional. |
Linking to an Experience Session
When experience_availability_id is supplied, shift_date, start_time, and end_time are automatically derived from that session. You can still override any of them by including them in the request body.
Responseโ
Success (201 Created)โ
{
"data": {
"id": 15,
"staff": {
"id": 5,
"first_name": "Jane",
"last_name": "Smith"
},
"staff_id": 5,
"location": null,
"location_id": null,
"shift_date": "2026-03-15",
"start_time": "09:00:00",
"end_time": "17:00:00",
"duration_calculation": "8 hours",
"break_setting": false,
"break_type": null,
"break_time": null,
"break_payment": null,
"shift_notes": null,
"status": "Unpublished",
"publish_type": null,
"created_at": "2026-03-10T08:00:00+00:00",
"updated_at": "2026-03-10T08:00:00+00:00"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-03-10T08:00:00+00:00"
}
}
Status Logic
- Shifts assigned to a staff member are created with status Unpublished
- Open shifts (no
staff_id) are created with status Open
Errorsโ
| Status | Code | Description |
|---|---|---|
| 401 | authentication_required | No API key provided |
| 401 | invalid_api_key | Invalid API key |
| 403 | insufficient_scope | API key lacks staff:write scope |
| 422 | validation_error | Invalid request body |
| 422 | shift_creation_error | Business logic error (e.g., staff not found) |
Example Requestโ
curl -X POST "https://app.equipdash.com/api/v1/staff/shifts" \
-H "Authorization: Bearer eqd_live_abc123xyz789..." \
-H "Content-Type: application/json" \
-d '{
"staff_id": 5,
"shift_date": "2026-03-15",
"start_time": "09:00",
"end_time": "17:00",
"break_setting": true,
"break_type": "lunch_break",
"break_time": "30",
"break_payment": "paid",
"shift_notes": "Morning briefing at 8:45"
}'