1. Docs
  2. API Reference
  3. Switch the active Application in an authenticated session

Switch the active Application in an authenticated session

POST/v1/auth/switch-application

Request body

  • application_idstring*

    Application ID to switch to

Code samples

cURLJavaScriptPythonGo
curl -X POST "https://api.canopy.dev/v1/auth/switch-application" \
  -H "Content-Type: application/json" \
  -d '{
    "application_id": "string"
  }'

Responses

200 Fresh access + refresh tokens issued for the new Application
{
  "access_token": "string",
  "token_type": "string",
  "expires_in": 0,
  "user": {
    "id": "string",
    "email": "string",
    "first_name": "string",
    "last_name": "string"
  },
  "default_environment_slug": "string"
}

application/json

  • access_tokenstring*
  • token_typestring*
  • expires_innumber*
  • userAuthUserDto
  • default_environment_slugstring
401 Invalid or expired token
403 This token is not authorized for this endpoint (wrong principal type — e.g., admin token on identity-only endpoint, or vice versa)

Returned object

On this page

Related endpoints

POSTRegister a new user
POSTLook up invite details by token
POSTAccept an invite
POSTAuthenticate and receive tokens
POSTSelect an Application from a pre-auth session (post-login picker)
POSTRefresh access token
POSTLogout and revoke tokens
GETVerify email address
POSTResend verification email
POSTRequest password reset
POSTReset password with token
POSTChange password (authenticated)
GETGet current user profile
GETGet current user permissions
GETList the Accounts the current user belongs to
GETList active sessions
DELETERevoke all sessions
DELETERevoke a specific session