Skip to main content

Overview

To resend a passwordless code, use the Create Code endpoint with the deviceId parameter.

How It Works

When you call the Create Code endpoint with an existing deviceId, it generates a new code for that device while maintaining the same authentication session. This is the recommended way to implement code resend functionality.

Request

Request Body:

Response

Same as Create Code:

Example

Implementation Example

Notes

  • The deviceId must be from a valid, active authentication session
  • The preAuthSessionId remains the same across resends
  • Failed verification attempts are tracked across all codes for the device
  • If the device is invalid or expired, you’ll receive a RESTART_FLOW_ERROR
  • Each resend generates a new userInputCode and linkCode
  • The previous code is invalidated when a new one is created

Error Handling

If the device ID is invalid or the session has expired:
In this case, you should restart the authentication flow by creating a new code with the user’s email or phone number.