1. Docs
  2. API Reference
  3. List the identity roles the caller may grant

List the identity roles the caller may grant

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

The active identity roles the caller may grant in this Environment, sorted by name, for choosing a role when assigning or inviting. System roles are never included, since they cannot be assigned. Requires access.assign or workspace_identity.invite somewhere in the Environment, and returns 403 when the caller holds neither. The set is the union of the grantable-role allowlists of every administrator role the caller holds here; for the account owner or a holder of workspace.administer_all, it is every active custom role in the Environment. The response is an unpaginated { items } array.

Authentication

Bearer TokenAuthorization

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

Path Parameters

accountSlugstring Required

The Account's slug. An unknown one answers 404.

appSlugstring Required

The Application's slug within the Account.

envSlugstring Required

The Environment's slug within the Application.

Responses

application/json

  • itemsWorkspaceAssignableRoleDto[]*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
curl -X GET "https://auth.canopy-io.com/portal/v1/accounts/value/applications/value/environments/value/workspace/assignable-roles" \
  -H "Authorization: Bearer $CANOPY_TOKEN"
Response
{
  "items": [
    {
      "id": "string",
      "name": "string",
      "description": "string"
    }
  ]
}
Related endpoints
GETResolve the caller's operational authority in the Environment
GETList identities within the caller's operational scope
GETList an identity's responsibilities within the caller's scope
GETList the hierarchy locations the caller may assign at
GETList the hierarchy nodes the caller can see in this Environment
GETList identity invitations within the caller's scope
POSTInvite an identity into a location with a role
GETList scoped operational activity within the caller's scope
GETDownload the scoped activity feed as CSV
GETHow long activity history is kept for this Account
POSTResend a scoped invitation
DELETERevoke a scoped invitation
POSTGrant an identity a role at a hierarchy node
PATCHMove or re-role an existing assignment
DELETERemove an identity's role assignment
Was this page helpful?

Tell us how we can improve this guide.