Get where a permission is used
/api/v1/permissions/{id}/usageReturns 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
Authorization Option A JWT access token
X-API-Key Option B API key for management-tier access
Path Parameters
idstring Required Responses
application/json
data *PermissionUsageDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X GET "https://auth.canopy-io.com/api/v1/permissions/value/usage" \ -H "X-API-Key: $CANOPY_API_KEY"
{ "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 } ] } }
Tell us how we can improve this guide.