1. Docs
  2. API Reference
  3. Explain a node-scoped authorization decision

Explain a node-scoped authorization decision

POST/api/v1/permissions/evaluate/explain

Returns 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

Bearer TokenAuthorization Option A

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

API KeyX-API-Key Option B

API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.

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

  • dataPermissionTraceDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Rate limit

200 requests per 1mPer caller: the signed-in user for a bearer token; for an API key, the key and the end user's address when a backend forwards it, otherwise the client address

Returned object

Request
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"
  }'
Response
{
  "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
          }
        ]
      }
    ]
  }
}
Related endpoints
GETList permission catalog
POSTRegister new permission(s)
GETGet a permission
PATCHUpdate permission metadata
DELETERemove a permission
GETGet where a permission is used
POSTEvaluate authorization
POSTBulk evaluate authorization
Was this page helpful?

Tell us how we can improve this guide.