1. Docs
  2. API Reference
  3. Get a role

Get a role

GET/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/roles/{id}

Authentication

  • Bearer Token Authorization

    JWT access token

Path Parameters

Name Required Type Description
idRequiredstring

Code samples

cURLJavaScriptPythonGo
curl -X GET "https://api.canopy.dev/portal/v1/accounts/{accountSlug}/applications/{appSlug}/environments/{envSlug}/roles/value" \
  -H "Authorization: Bearer $CANOPY_TOKEN"

Responses

200 Role returned
{
  "id": "string",
  "application_id": "string",
  "name": "string",
  "description": "string",
  "is_system_role": false,
  "system_key": "string",
  "is_active": false,
  "created_at": "2026-04-20T12:00:00.000Z",
  "updated_at": "2026-04-20T12:00:00.000Z",
  "version": 0,
  "permission_count": 0
}

application/json

  • idstring*
  • application_idstring*
  • namestring*
  • descriptionstring
  • is_system_roleboolean*
  • system_keystring
  • is_activeboolean*
  • created_atstring (date-time)*
  • updated_atstring (date-time)*
  • versionnumber*

    Optimistic-lock version. Send back as the `If-Match` header when updating to detect concurrent edits.

  • permission_countnumber

    Number of permissions currently assigned to this role. Populated on list responses; omitted on single-role responses where the join isn't computed.

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
PATCHUpdate a role
DELETEDelete a role
GETGet permissions for a role
PUTReplace permissions on a role