1. Docs
  2. API Reference
  3. Select an Application from a pre-auth session (post-login picker)

Select an Application from a pre-auth session (post-login picker)

POST/v1/auth/select-application

Request body

  • account_idstring*

    Account ID the Application belongs to

  • application_idstring*

    Application ID to bind the new access token to

Code samples

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

Responses

200 Tokens returned bound to the selected Account + 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
POSTSwitch the active Application in an authenticated session
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