Skip to main content

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โ€‹

ParameterTypeRequiredDescription
shift_datestringYesShift date (YYYY-MM-DD)
start_timestringYesStart time (HH:MM)
end_timestringYesEnd time (HH:MM)
staff_idintegerNoStaff member to assign. If omitted, creates an open shift.
location_idintegerNoLocation for the shift
break_settingbooleanNoEnable break (default: false)
break_typestringNoBreak type (e.g., lunch_break)
break_timestringNoBreak duration in minutes
break_paymentstringNoBreak payment: paid or unpaid
shift_notesstringNoNotes for the shift (max 1000 characters)
experience_availability_idintegerNoPre-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โ€‹

StatusCodeDescription
401authentication_requiredNo API key provided
401invalid_api_keyInvalid API key
403insufficient_scopeAPI key lacks staff:write scope
422validation_errorInvalid request body
422shift_creation_errorBusiness 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"
}'