1. Docs
  2. API Reference
  3. List roles

List roles

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

Authentication

  • Bearer Token Authorization

    JWT access token

Query Parameters

Name Required Type Description
include_inactiveRequiredstring
typeRequiredstring

Code samples

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

Responses

200 Roles returned
{
  "items": [
    {
      "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

  • itemsRoleResponseDto[]*
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)

Returned object

On this page

Related endpoints

POSTCreate a custom role
GETGet a role
PATCHUpdate a role
DELETEDelete a role
GETGet permissions for a role
PUTReplace permissions on a role