Skip to main content
POST
Validate a magic link token

Authorizations

x-portal-auth-environment-id
string
header
required

The Auth Environment ID for the environment you are authenticating against. Find it in the Portal dashboard under Authentication > Configure.

Body

application/json
token
string
required

The single-use token query parameter Portal appended to your redirect URL.

Response

Token validated successfully

data
object

The outcome of a sign-in. Which fields are set depends on whether the environment requires two-factor authentication:

  • Two-factor not required. clientId, clientSessionToken and isAccountAbstracted are set, userJwt and totpLink are null. The sign-in is complete.
  • Two-factor required, user already enrolled. userJwt is set, clientId, clientSessionToken, isAccountAbstracted and totpLink are null. Prompt for a code and call POST /totps/validations.
  • Two-factor required, first sign-in. userJwt and totpLink are both set, clientId, clientSessionToken and isAccountAbstracted are null. Render totpLink as a QR code for the user to scan, then prompt for a code and call POST /totps/validations.

Branch on clientSessionToken being non-null to decide whether the sign-in is finished. The client fields are only populated once the sign-in completes, so on the two-factor branches they arrive with the POST /totps/validations response instead.

metadata
object | null

Always null for this endpoint.