Authorization
Descope Project ID Project ID as bearer token.
In: header
Request Body
application/json
Sign-in end user (with automatic sign-up) by sending an OTP code via Voice
Initiate a process that implements both sign-in and sign-up using a single endpoint. Descope will generate and deliver the One-Time Password (OTP) to the end user via Voice. If the phone number is already registered (the end user exists) the user will be signed in. If the phone number is not registered (the end user is not yet registered) the user will be signed up. Sending multiple OTP codes (for example, when an end user tries to sign-up/sign-in a second or third time) will invalidate any OTP code that has already been sent.
This endpoint will return an empty response object when it completes successfully.
Next Steps
Verify the OTP code using the Verify OTP Code endpoint to complete the user sign-in process. After successfully verifying the code the end user will be signed-in.
See Also
- See The User Object for further details on how to identify users and their contact information such as email address and phone number.
- See User Login Options for further details on loginOptions.
- Use the Sign-Up endpoint if you want a sign-up flow that will fail if the end user is already registered.
- Use the Sign-In endpoint if you want a sign-in flow that will fail if the end user isn't yet registered.
curl -X POST "https://api.descope.com/v1/auth/otp/signup-in/voice" \ -H "Content-Type: application/json" \ -d '{}'{ "maskedPhone": "string", "verificationAttempts": 0}export interface Response {maskedPhone?: stringverificationAttempts?: number}Sign-In POST
### Sign-in existing end user by sending an OTP code via Voice Initiate a sign-in process by sending a One-Time Password (OTP) to an existing end user. Descope will generate and deliver the OTP code to the phone number specified. Sending multiple OTP codes (for example, when an end user tries to sign-in a second or third time) will invalidate any OTP code that has already been sent. This endpoint will return an empty response object when it completes successfully. The endpoint will return a failure code if the phone number is not yet registered. ### Next Steps Verify the OTP code using the [Verify OTP Code](/api/otp/phone/verify-otp) endpoint to complete the user sign-in process. After successfully verifying the code the end user will be signed-in. ### See Also - See [The User Object](/api/overview#the-user-object) for further details on how to identify users and their contact information such as email address and phone number. - See [User Login Options](/api/overview#user-login-options) for further details on loginOptions. - Use the [Sign-Up](/api/otp/phone/sign-up) endpoint to sign-up a new end user. - Use the [Sign-In with Auto Sign-up](/api/otp/phone/sign-in-auto-sign-up) endpoint to create a single sign-up and sign-in flow, which will create a new end user if they are not already registered.
Verify OTP Code POST
### Verify the validity of an OTP code via Voice Verify that the OTP code entered by the end user matches the OTP code that was sent. The Verify OTP code endpoint completes the OTP via Voice flow for: - [Sign-Up](/api/otp/phone/sign-up) - [Sign-In](/api/otp/phone/sign-in) - [Sign-In with Auto Sign-up](/api/otp/phone/sign-in-auto-sign-up) - [Update Phone](/api/otp/phone/update-phone) The response object includes the session JWT `sessionJwt` and refresh JWT `refreshJwt` when it completes successfully, and the end user will be signed in. For an update phone number flow, the new phone number will replace the original phone number. ### See Also - See [The User Object](/api/overview#the-user-object) for further details on how to identify users and their contact information such as email address and phone number.