1. Docs
  2. API Reference
  3. Replace permissions on a role

Replace permissions on a role

PUT/api/v1/roles/{id}/permissions

Authentication

  • Bearer Token Authorization

    JWT access token

  • API Key X-API-Key

    API key for management-tier access

Path Parameters

Name Required Type Description
idRequiredstring

Request body

  • permission_keysstring[]*

Code samples

cURLJavaScriptPythonGo
curl -X PUT "https://api.canopy.dev/api/v1/roles/value/permissions" \
  -H "X-API-Key: $CANOPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "permission_keys": [
      "string"
    ]
  }'

Responses

200 Permissions updated
{
  "message": "string"
}

application/json

  • messagestring*
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)
404 Role not found

Returned object

On this page

Related endpoints

GETList roles
POSTCreate a custom role
GETGet a role
PATCHUpdate a role
DELETEDelete a role
GETGet permissions for a role