Switch the active Application in an authenticated session
/v1/auth/switch-applicationRe-issues tokens bound to a different Application within the caller's currently selected Account β the dashboard's App switcher β without re-authentication. Guarded by UserJwtGuard, accepting application_id; the target App must belong to the token's Account and the caller must be an active member, otherwise 401. Cross-Account switching is refused (a fresh login is required), preventing privilege escalation. Returns a new access and refresh token (Bearer, 900s) and rotates the refresh and session-marker cookies.
Request body
application/json
application_idstring Required Application ID to switch to
Responses
application/json
data *AuthTokenResponseDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X POST "https://auth.canopy-io.com/v1/auth/switch-application" \ -H "Content-Type: application/json" \ -d '{ "application_id": "string" }'
{ "data": { "access_token": "string", "token_type": "string", "expires_in": 0, "user": { "id": "string", "email": "string", "first_name": "string", "last_name": "string" }, "default_environment_slug": "string" } }
Tell us how we can improve this guide.