Skip to main content

Create Time Off

Create a time-off request for a staff member. The request is created with status pending unless you explicitly pass a status.

Endpointโ€‹

POST /v1/staff/time-off

Authenticationโ€‹

Requires an API key with the staff:write scope.

Request Bodyโ€‹

ParameterTypeRequiredDescription
staff_idintegerYesStaff member ID
start_datestringYesStart date (YYYY-MM-DD)
end_datestringYesEnd date (YYYY-MM-DD, must be โ‰ฅ start_date)
typestringYesLeave type (e.g., annual_leave, sick_leave, unpaid_leave)
is_all_daybooleanNoWhether the request covers full days (default: true)
start_timestringNoPartial-day start time (HH:MM). Only relevant when is_all_day is false.
end_timestringNoPartial-day end time (HH:MM). Only relevant when is_all_day is false.
reasonstringNoReason for the leave (max 1000 characters)
statusstringNoOverride initial status (pending, approved, rejected). Defaults to pending.

Responseโ€‹

Success (201 Created)โ€‹

{
"data": {
"id": 8,
"staff_id": 5,
"staff": { "id": 5, "first_name": "Jane", "last_name": "Smith" },
"start_date": "2026-04-14",
"end_date": "2026-04-16",
"start_time": null,
"end_time": null,
"is_all_day": true,
"type": "annual_leave",
"status": "pending",
"reason": "Easter break",
"approved_by": null,
"created_at": "2026-04-01T09:00:00+00:00",
"updated_at": "2026-04-01T09:00:00+00:00"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-04-01T09:00:00+00:00"
}
}

Errorsโ€‹

StatusCodeDescription
401authentication_requiredNo API key provided
401invalid_api_keyInvalid API key
403insufficient_scopeAPI key lacks staff:write scope
422validation_errorMissing or invalid fields

Example Requestโ€‹

curl -X POST "https://app.equipdash.com/api/v1/staff/time-off" \
-H "Authorization: Bearer eqd_live_abc123xyz789..." \
-H "Content-Type: application/json" \
-d '{
"staff_id": 5,
"start_date": "2026-04-14",
"end_date": "2026-04-16",
"type": "annual_leave",
"is_all_day": true,
"reason": "Easter break"
}'