Select an Account from a pre-auth session (multi-Account login)
/v1/auth/select-accountSecond step of multi-Account login: exchanges the pre-auth session for an access token bound to the chosen Account's first Application. Guarded by UserJwtGuard with @AllowPreAuth, accepting account_id; the caller must be an active member of that Account or 401 is returned. Issues a fresh access and refresh token (Bearer, 900s), sets the refresh and session-marker cookies, and clears the pre-auth cookie. There is no Application picker — switching Apps happens later via switch-application.
Request body
application/json
account_idstring Required Account ID to bind the new access token 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/select-account" \ -H "Content-Type: application/json" \ -d '{ "account_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.