Create an authentication challenge
Issue an authentication challenge for a user.
The response type depends on the authentication method:
- OTP: Returns a Challenge with ID and expiration. The one-time passcode is sent to the user’s email or phone.
- Passkey: Returns PasskeyAuthenticationOptions with WebAuthn challenge for authentication.
For OTP, either phoneNumber or emailAddress is required. For passkey, phoneNumber or emailAddress is optional (enables usernameless flow when omitted).
Challenges may only be issued on a fixed time interval.
Body
The request body for issuing a new authentication challenge.
For OTP authentication, either phoneNumber or emailAddress is required. For passkey authentication, phoneNumber or emailAddress is optional (enables usernameless flow when omitted).
The authentication method to use. Defaults to "otp" for backward compatibility.
otp, passkey The phone number of a user.
- For OTP: Required (unless emailAddress is provided) to send the one-time passcode.
- For passkey: Optional. When provided, enables username-first authentication flow.
6 - 32^\+?[0-9]{1,3}?[ .-]?\(?[0-9]{1,4}?\)?[ .-]?[0-9]{1,4}?[ .-]?[0-9]{1,4}?[ .-]?[0-9]{1,9}$The email address of a user.
- For OTP: Required (unless phoneNumber is provided) to send the one-time passcode.
- For passkey: Optional. When provided, enables username-first authentication flow.
6 - 100Response
Created.
- Option 1
- Option 2
Response from creating an authentication challenge.
The response type depends on the authentication method specified in the request:
- For OTP method: Returns a Challenge with ID and expiration
- For passkey method: Returns PasskeyAuthenticationOptions with WebAuthn challenge
The unique, opaque system identifier for a resource. This case-sensitive ID is also used as path parameters in URLs or in other properties or parameters that reference a resource by ID rather than URL.
The expiration datetime of the challenge in the ISO-8601 format.