1. Docs
  2. API Reference
  3. Get where a permission is used

Get where a permission is used

GET/api/v1/permissions/{id}/usage

Returns the roles that grant a permission, each with the number of distinct identities holding that role, plus role_count and the distinct identity_count the permission reaches overall. Because a permission is only ever held through a role, this is the full blast radius of deleting it — the listed roles are exactly the ones a delete would strip it from. Deactivated roles are included; identity_count is not the sum of the per-role counts, since one identity may hold several granting roles. Returns 404 when no permission with that id exists in the Environment. Requires the rbac.view_roles permission.

Authentication

Bearer TokenAuthorization Option A

JWT access token

API KeyX-API-Key Option B

API key for management-tier access

Path Parameters

idstring Required

Responses

application/json

  • dataPermissionUsageDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
curl -X GET "https://auth.canopy-io.com/api/v1/permissions/value/usage" \
  -H "X-API-Key: $CANOPY_API_KEY"
Response
{
  "data": {
    "permission_id": "string",
    "role_count": 0,
    "identity_count": 0,
    "roles": [
      {
        "id": "string",
        "name": "string",
        "description": "string",
        "is_system_role": false,
        "is_active": false,
        "member_count": 0
      }
    ]
  }
}
Related endpoints
GETList permission catalog
POSTRegister new permission(s)
GETGet a permission
PATCHUpdate permission metadata
DELETERemove a permission
POSTEvaluate authorization
POSTBulk evaluate authorization
POSTExplain a node-scoped authorization decision
Was this page helpful?

Tell us how we can improve this guide.