Evaluate authorization
/api/v1/permissions/evaluateEvaluates whether a target identity (identity_id) holds a permission, returning a boolean decision plus the scope_evaluated, effective_node_id, granting_roles, and any denial_reason. With scope: node the engine walks the node's hierarchy lineage so a permission granted on an ancestor is inherited at node_id; scope: app_wide answers the coarse 'anywhere in the Application' question (returns effective_node_id: null) and must never be used for resource-scoped enforcement. Scoped API keys must carry the evaluate scope or the call returns 403. Rate-limited to 1000 requests/minute.
Authentication
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
X-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 evaluated, not an admin).
permissionstring Required scopeenum Required Required. `node` asks 'does this identity have the permission *at* `node_id`?' (lineage walk). `app_wide` asks the coarse-grained 'does this identity have the permission *anywhere* in the org?' question — useful for UI gating, **never** for resource-scoped enforcement. `node` requires `node_id`; `app_wide` forbids it.
node_idstring Optional Required when `scope` is `node`; must be omitted when `scope` is `app_wide`.
Responses
application/json
data *EvaluateResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X POST "https://auth.canopy-io.com/api/v1/permissions/evaluate" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "identity_id": "string", "permission": "string", "scope": "node", "node_id": "string" }'
{ "data": { "allowed": false, "permission": "string", "scope_evaluated": "node", "effective_node_id": "string", "granting_roles": [ "string" ], "denial_reason": "string" } }
Tell us how we can improve this guide.