Update the admin's resume-state for this Application
/portal/v1/accounts/{accountSlug}/applications/{appSlug}/me/stateWrites 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
AuthorizationJWT access token. Never send alongside X-API-Key: a request carrying both is refused.
applications.viewDeveloper ConsoleView the Account's Applications and Environments. Granted through an administrator role in the Admin Workspace; a valid token without it is refused with 403.
Path Parameters
accountSlugstring Required The Account's slug. An unknown one answers 404.
appSlugstring Required The Application's slug within the Account.
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
data *UserAppStateResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Errors
When the request can't be completed, the response body includes a stable error code you can branch on, and a correlation_id (also sent as the X-Correlation-Id header). Quote the correlation id when you contact support: it identifies the exact request in Canopy's logs.
account.capability_requiredForbiddenThe signed-in user's administrator roles do not grant the capability this endpoint requires.
Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.
Returned object
curl -X PUT "https://auth.canopy-io.com/portal/v1/accounts/value/applications/value/me/state" \ -H "Authorization: Bearer $CANOPY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "environment_slug": "string" }'
{ "data": { "environment_slug": "string" } }
Tell us how we can improve this guide.