Skip to content

History API

All endpoints require authentication. Permission is checked dynamically based on the resource type.

GET /api/history/:resourceType/:resourceId

Returns the audit trail for a specific resource, ordered by most recent first (limit 200).

Path parameters:

ParamTypeDescription
resourceTypestringOne of the supported resource types (see below)
resourceIdstringThe resource’s ID

Supported resource types and their permission mappings:

Resource TypeTool Permission
dealdeals:view
companycompanies:view
contactcontacts:view
candidaterecruitment:view
contractcontracts:view
leave_requestleave:view
scorecardscorecards:view
reviewreviews:view
tasktasks:view
projectprojects:view
budgetbudgets:view
invoiceinvoices:view
proposalproposals:view
clientclients:view
emailemails:view

Response:

{
"entries": [
{
"id": "string",
"resource_type": "string",
"resource_id": "string",
"actor_id": "string",
"action": "string",
"details": "string (JSON)",
"created_at": "string",
"actor_name": "string",
"actor_picture": "string"
}
]
}

Each entry includes the actor’s name and picture from the users table.