Explain a node-scoped authorization decision
/api/v1/permissions/evaluate/explainReturns a full authorization trace explaining why an identity is or isn't granted a permission at a node_id. In addition to the verdict (copied verbatim from the evaluate engine), the response includes the resolved lineage from the node up its ancestors, each node's role assignments, and which assignments actually grant the permission — useful for debugging inherited access. Returns 404 when the identity or node cannot be found; scoped API keys must carry the evaluate scope (403). Rate-limited to 200 requests/minute.
Authentication
Authorization Option A JWT access token
X-API-Key Option B API key for management-tier access
Request body
application/json
identity_idstring Required Identity ID (from the `identities` table — the end user being explained, not an admin).
permissionstring Required node_idstring Required The hierarchy node to explain the decision at. The lineage from the root to this node is walked and returned in the trace.
Responses
application/json
data *PermissionTraceDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X POST "https://auth.canopy-io.com/api/v1/permissions/evaluate/explain" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "identity_id": "string", "permission": "string", "node_id": "string" }'
{ "data": { "identity_id": "string", "permission": "string", "node_id": "string", "allowed": false, "denial_reason": "string", "effective_node_id": "string", "granting_role_ids": [ "string" ], "granting_node_ids": [ "string" ], "lineage": [ { "node_id": "string", "name": "string", "node_type": "string", "depth": 0, "is_target": false, "assignments": [ { "assignment_id": "string", "role_id": "string", "role_name": "string", "active": false, "effective_from": "string", "effective_to": "string", "grants_permission": false } ] } ] } }
Tell us how we can improve this guide.