1. Docs
  2. API Reference
  3. Evaluate authorization

Evaluate authorization

POST/api/v1/permissions/evaluate

Evaluates 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

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 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.

one of "node" · "app_wide"

node_idstring Optional

Required when `scope` is `node`; must be omitted when `scope` is `app_wide`.

Responses

application/json

  • dataEvaluateResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
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"
  }'
Response
{
  "data": {
    "allowed": false,
    "permission": "string",
    "scope_evaluated": "node",
    "effective_node_id": "string",
    "granting_roles": [
      "string"
    ],
    "denial_reason": "string"
  }
}
Related endpoints
GETList permission catalog
POSTRegister new permission(s)
GETGet a permission
PATCHUpdate permission metadata
DELETERemove a permission
GETGet where a permission is used
POSTBulk evaluate authorization
POSTExplain a node-scoped authorization decision
Was this page helpful?

Tell us how we can improve this guide.