1. Docs
  2. API Reference
  3. List the Environments the caller may operate in

List the Environments the caller may operate in

GET/portal/v1/accounts/{accountSlug}/workspace-environments

The Environments in this Account where the caller may work in the Admin Workspace, for the environment switcher. Each one carries the Environment's id, slug and name and its Application's slug and name, sorted by Application name and then Environment name. No capability is required, since the result only ever describes the caller's own reach. That reach is the Environments where they hold a live, unrevoked assignment within its effective window, or every Environment in the Account for the owner or a holder of workspace.administer_all. 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.

Responses

application/json

  • itemsWorkspaceEnvironmentResponseDto[]*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Returned object

Request
curl -X GET "https://auth.canopy-io.com/portal/v1/accounts/value/workspace-environments" \
  -H "Authorization: Bearer $CANOPY_TOKEN"
Response
{
  "items": [
    {
      "environment_id": "string",
      "environment_slug": "string",
      "environment_name": "string",
      "application_slug": "string",
      "application_name": "string"
    }
  ]
}
Related endpoints Was this page helpful?

Tell us how we can improve this guide.