List the Environments the caller may operate in
/portal/v1/accounts/{accountSlug}/workspace-environmentsThe 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
AuthorizationJWT 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
items *WorkspaceEnvironmentResponseDto[]
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X GET "https://auth.canopy-io.com/portal/v1/accounts/value/workspace-environments" \ -H "Authorization: Bearer $CANOPY_TOKEN"
{ "items": [ { "environment_id": "string", "environment_slug": "string", "environment_name": "string", "application_slug": "string", "application_name": "string" } ] }
Tell us how we can improve this guide.