1. Docs
  2. API Reference
  3. Update the admin's resume-state for this Application

Update the admin's resume-state for this Application

PUT/portal/v1/accounts/{accountSlug}/applications/{appSlug}/me/state

Writes through the calling admin's last-visited Environment for the active Application, given an environment_slug in the body, so the dashboard can resume there on the next sign-in. The Environment must belong to this Application — an unknown slug returns 400 rather than poisoning the resume state. Returns 200 echoing the stored environment_slug.

Authentication

Bearer TokenAuthorization

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

Requires capability applications.viewDeveloper Console

View the Account's Applications and Environments. Granted through an administrator role in the Admin Workspace; a valid token without it is refused with 403.

Request body

application/json

environment_slugstring Required

Slug of the env the admin is now active in. Must be a real env in this Application.

Responses

application/json

  • dataUserAppStateResponseDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Errors

When the request can't be completed, the response body includes a stable error code you can branch on.

403account.capability_requiredForbidden
When it happens

The signed-in user's administrator roles do not grant the capability this endpoint requires.

Remediation

Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.

Returned object

Request
curl -X PUT "https://auth.canopy-io.com/portal/v1/accounts/{accountSlug}/applications/{appSlug}/me/state" \
  -H "Authorization: Bearer $CANOPY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "environment_slug": "string"
  }'
Response
{
  "data": {
    "environment_slug": "string"
  }
}
Related endpoints
GETGet the current Application
PATCHUpdate the Application name or settings
DELETEDelete an Application
PUTSet the App's default Environment
GETGet the admin's resume-state for this Application
Was this page helpful?

Tell us how we can improve this guide.