Skip to main content

Update Staff Availability

Set a staff member's usual week, their answers for specific dates, or both in one call. Hours set here count as set by you, so set_by reads owner afterwards.

Endpointโ€‹

PUT /v1/staff/{staffId}/availability

Authenticationโ€‹

Requires an API key with the staff:write scope.

Path Parametersโ€‹

ParameterTypeDescription
staffIdintegerStaff member ID

Request Bodyโ€‹

Send week, dates, or both. At least one is required.

ParameterTypeRequiredDescription
weekobjectNoKeyed by day name, monday to sunday. Days you leave out keep their current hours.
week.{day}.onbooleanNofalse switches the day off. Sending only start or end switches it on.
week.{day}.startstringNoStart time, HH:MM, 24-hour
week.{day}.endstringNoEnd time, HH:MM, 24-hour. Must be after start.
datesobject or arrayNoKeyed by date (YYYY-MM-DD), or a list of rows that each carry a date.
dates.*.onbooleanNofalse means they can't work that date. can_work is accepted as another name for it.
dates.*.startstringNoStart time, HH:MM. A date sent without times takes the hours of their usual week for that weekday.
dates.*.endstringNoEnd time, HH:MM. Must be after start.

How saving worksโ€‹

  • The week in force ends yesterday and the new week starts today, so the staff member's page in the portal keeps the old hours under Show past hours.
  • A date answer replaces any earlier answer for the same date.
  • If any day or date is refused, nothing is saved.

Example bodyโ€‹

{
"week": {
"monday": { "on": true, "start": "09:00", "end": "17:00" },
"saturday": { "on": true, "start": "07:00", "end": "12:00" },
"sunday": { "on": false }
},
"dates": {
"2026-10-05": { "on": false },
"2026-10-06": { "on": true, "start": "12:00", "end": "18:00" }
}
}

Responseโ€‹

Success (200 OK)โ€‹

Returns the updated availability object.

{
"data": {
"week": {
"monday": { "on": true, "start": "09:00", "end": "17:00" },
"tuesday": { "on": false, "start": "09:00", "end": "17:00" },
"wednesday": { "on": false, "start": "09:00", "end": "17:00" },
"thursday": { "on": false, "start": "09:00", "end": "17:00" },
"friday": { "on": false, "start": "09:00", "end": "17:00" },
"saturday": { "on": true, "start": "07:00", "end": "12:00" },
"sunday": { "on": false, "start": "09:00", "end": "17:00" }
},
"set_by": "owner",
"dates": [
{ "date": "2026-10-05", "can_work": false, "start": null, "end": null },
{ "date": "2026-10-06", "can_work": true, "start": "12:00", "end": "18:00" }
]
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-09-28T09:00:00+00:00"
}
}

Errorsโ€‹

StatusCodeDescription
401authentication_requiredNo API key provided
401invalid_api_keyInvalid API key
403insufficient_scopeAPI key lacks the staff:write scope
404resource_not_foundNo staff member with that ID in your account
422validation_errorweek or dates is not an object
422availability_not_savedThe hours could not be saved. message says why, for example "On Monday, the end time has to be after the start time." or "Send the weekly hours, some dates, or both."

Example Requestโ€‹

curl -X PUT "https://app.equipdash.com/api/v1/staff/123/availability" \
-H "Authorization: Bearer eqd_live_abc123xyz789..." \
-H "Content-Type: application/json" \
-d '{
"week": { "saturday": { "on": true, "start": "07:00", "end": "12:00" } },
"dates": { "2026-10-05": { "on": false } }
}'