History API
All endpoints require authentication. Permission is checked dynamically based on the resource type.
Get Resource History
Section titled “Get Resource History”GET /api/history/:resourceType/:resourceIdReturns the audit trail for a specific resource, ordered by most recent first (limit 200).
Path parameters:
| Param | Type | Description |
|---|---|---|
resourceType | string | One of the supported resource types (see below) |
resourceId | string | The resource’s ID |
Supported resource types and their permission mappings:
| Resource Type | Tool Permission |
|---|---|
deal | deals:view |
company | companies:view |
contact | contacts:view |
candidate | recruitment:view |
contract | contracts:view |
leave_request | leave:view |
scorecard | scorecards:view |
review | reviews:view |
task | tasks:view |
project | projects:view |
budget | budgets:view |
invoice | invoices:view |
proposal | proposals:view |
client | clients:view |
email | emails: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.