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โ
| Parameter | Type | Required | Description |
|---|---|---|---|
staff_id | integer | Yes | Staff member ID |
start_date | string | Yes | Start date (YYYY-MM-DD) |
end_date | string | Yes | End date (YYYY-MM-DD, must be โฅ start_date) |
type | string | Yes | Leave type (e.g., annual_leave, sick_leave, unpaid_leave) |
is_all_day | boolean | No | Whether the request covers full days (default: true) |
start_time | string | No | Partial-day start time (HH:MM). Only relevant when is_all_day is false. |
end_time | string | No | Partial-day end time (HH:MM). Only relevant when is_all_day is false. |
reason | string | No | Reason for the leave (max 1000 characters) |
status | string | No | Override 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โ
| 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 | Missing 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"
}'