Skip to main content

Shift History

Retrieve the full audit trail for a shift โ€” who created it, every edit made, and every status change.

Endpointโ€‹

GET /v1/staff/shifts/{id}/history

Authenticationโ€‹

Requires an API key with the staff:read scope.

Path Parametersโ€‹

ParameterTypeDescription
idintegerID of the shift

Responseโ€‹

Success (200 OK)โ€‹

{
"data": [
{
"id": 101,
"staff_shift_id": 42,
"shift_reference": "SH-42",
"user": {
"id": 3,
"name": "Sarah Johnson",
"email": "sarah@example.com"
},
"source": "web",
"action": "created",
"changes": null,
"description": "Shift created",
"created_at": "2026-03-10T08:00:00+00:00"
},
{
"id": 108,
"staff_shift_id": 42,
"shift_reference": "SH-42",
"user": {
"id": 3,
"name": "Sarah Johnson",
"email": "sarah@example.com"
},
"source": "web",
"action": "updated",
"changes": {
"start_time": { "from": "09:00:00", "to": "10:00:00" }
},
"description": "Start time changed",
"created_at": "2026-04-01T09:30:00+00:00"
}
],
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-04-01T10:00:00+00:00"
}
}

Response Fieldsโ€‹

FieldTypeDescription
idintegerAudit log entry ID
staff_shift_idintegerAssociated shift ID
shift_referencestring|nullHuman-readable shift reference
userobject|nullUser who made the change (id, name, email)
sourcestringChange source (e.g., web, api)
actionstringAction type (e.g., created, updated, deleted, status_changed)
changesobject|nullKey/value map of changed fields with from and to values
descriptionstring|nullHuman-readable description
created_atstringISO 8601 datetime

Errorsโ€‹

StatusCodeDescription
401authentication_requiredNo API key provided
401invalid_api_keyInvalid API key
403insufficient_scopeAPI key lacks staff:read scope
404not_foundShift not found or belongs to another supplier

Example Requestโ€‹

curl -X GET "https://app.equipdash.com/api/v1/staff/shifts/42/history" \
-H "Authorization: Bearer eqd_live_abc123xyz789..."