Text messages
Sign-in with a code texted to a phone number the account verified (TWILIO_* set), and adding one.
POST
Use this endpoint to send OTP to phone number
application/json- body
phoneNumber*stringPhone number to send OTP. Eg: "+1234567890"
Success
application/json- response
message?stringcurl -X POST 'https://auth.example.com/api/auth/phone-number/send-otp' \ -H 'Content-Type: application/json' \ -d '{ "phoneNumber": "string"}'Example Response
{ "message": "string"}POST
Use this endpoint to verify phone number
application/json- body
phoneNumber*stringPhone number to verify. Eg: "+1234567890"
code*stringOTP code. Eg: "123456"
disableSession?booleanDisable session creation after verification. Eg: false
updatePhoneNumber?booleanCheck if there is a session and update the phone number. Eg: true
[key: string]?unknownPhone number verified successfully
application/json- response
status*trueIndicates if the verification was successful
Value in
truetoken?stringSession token if session is created, null if disableSession is true or no session is created
user?User object with phone number details, null if no user is created or found
curl -X POST 'https://auth.example.com/api/auth/phone-number/verify' \ -H 'Content-Type: application/json' \ -d '{ "phoneNumber": "string", "code": "string", "property1": null, "property2": null}'Example Response
{ "status": true, "token": "string", "user": { "id": "string", "email": "user@example.com", "emailVerified": true, "name": "string", "image": "http://example.com", "phoneNumber": "string", "phoneNumberVerified": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z" }}