Skip to main content

Get Entity Audit Trail

Returns all audit log entries for a specific entity, providing a complete history of changes. Results are ordered by createdAt descending.
GET /v1/audit/logs/entity/:entityType/:entityId

Path Parameters

ParameterTypeDescription
entityTypestringThe type of entity (e.g., artifact, recipient, policy, group, secret)
entityIdstringThe entity ID

Example Request

curl https://api.docyard.io/v1/audit/logs/entity/policy/pol_01HQ3P... \
  -H "Authorization: Bearer dk_live_a1b2c3d4..."

Response

[
  {
    "id": "aud_01HQ6A...",
    "dockId": "dock_01HQ3K...",
    "entityType": "policy",
    "entityId": "pol_01HQ3P...",
    "action": "update",
    "actor": "user_01HQ2A...",
    "changes": {
      "before": { "name": "Mortgagee Access" },
      "after": { "name": "Standard Mortgagee Access" }
    },
    "metadata": {},
    "ipAddress": "203.0.113.42",
    "userAgent": "Mozilla/5.0",
    "createdAt": "2025-01-22T10:15:00.000Z"
  },
  {
    "id": "aud_01HQ6B...",
    "dockId": "dock_01HQ3K...",
    "entityType": "policy",
    "entityId": "pol_01HQ3P...",
    "action": "create",
    "actor": "user_01HQ2A...",
    "changes": null,
    "metadata": { "source": "api" },
    "ipAddress": "203.0.113.42",
    "userAgent": "curl/8.1.2",
    "createdAt": "2025-01-15T11:00:00.000Z"
  }
]

Error Handling

StatusCondition
401Missing or invalid API key
404No audit logs found for the specified entity
This endpoint returns logs across all docks. Use it to get a complete audit trail for any entity in the system. For dock-scoped queries, use List Audit Logs with the dockId filter instead.