Skip to main content

Overview

Verifies a passwordless authentication code and completes the sign-in process. Creates a new user if one doesn’t exist.

Request Body

Required:
  • preAuthSessionId (string): The session identifier from code creation
One of the following:
  • linkCode (string): The magic link code
  • deviceId + userInputCode: For manual code entry
    • deviceId (string): The device identifier
    • userInputCode (string): The code entered by the user

Response

Success Response (200)

Response Fields:
  • createdNewUser: Whether a new user was created
  • user: The authenticated user object
  • recipeUserId: Recipe-specific user ID (CDI >= 4.0)
  • consumedDevice: Information about the device that was verified

Error Responses

RESTART_FLOW_ERROR (200)

The authentication flow must be restarted. This can happen if:
  • The device was used for too many failed attempts
  • The preAuthSessionId is invalid

EXPIRED_USER_INPUT_CODE_ERROR (200)

The code has expired.

INCORRECT_USER_INPUT_CODE_ERROR (200)

The code is incorrect.

Examples

Consume with user input code

Notes

  • You must provide exactly one of: linkCode OR (deviceId + userInputCode)
  • Failed attempts are tracked per device
  • After maximum failed attempts, the flow must be restarted
  • Email verification status is set automatically (CDI >= 4.0)
  • The API automatically handles user ID mapping for external user IDs
  • Active user tracking is updated upon successful authentication