v34

latestOpenAPI 3.1.0raw.githubusercontent.com2025-05-1961327.8 KB
OTP

Send a code

Send an OTP code to a user's phone number.

post/authentication

Request body

customer_uuidstring uuid required

Your customer UUID, which can be found in the API settings in the dashboard.

phone_numberstring phone_number required

An E.164 formatted phone number to send the OTP to.

ipstring ipv4

The IP address of the user's device.

device_idstring

Unique identifier for the user's device. For Android, this corresponds to the ANDROID_ID and for iOS, this corresponds to the identifierForVendor.

device_type'IOS' | 'ANDROID' | 'WEB'

The type of device the user is using.

app_versionstring

The version of your application.

sender_idstring

The Sender ID to use when sending the message.

callback_urlstring url

A webhook URL to which delivery statuses will be sent.

app_realmstring

The Android SMS Retriever API hash code that identifies your app. This allows you to automatically retrieve and fill the OTP code on Android devices.

os_versionstring

The version of the user's device operating system.

device_modelstring

The model of the user's device.

is_returning_userboolean

This signal should do more than just confirm if a user is returning to your app; it should provide a higher level of trust, indicating that the user is genuine.

template_idstring

The template id associated with the message content variant to be sent.

correlation_idstring

A unique, user-defined identifier that will be included in webhook events

localestring BCP-47

A BCP-47 locale indicating the language the SMS should be sent to; if this is not set, the SMS will be sent to the language specified by the country code of the message. If we don't support the language set, the message will be sent in US English (en-US).

Example request

{
  "phone_number": "+1234567890",
  "locale": "en-US"
}

Response

OK

authentication_uuidstring uuid

A unique identifier for the authentication that you can use on the /check and /retry endpoints.

status'pending' | 'rate_limited' | 'spam_detected'

The status of the authentication. Possible values are:

  • pending - The OTP code is being sent.
  • rate_limited - This user is rate-limited and cannot receive another code.
  • spam_detected - This attempt is flagged as spam. Go to the dashboard for more details.
created_atstring date-time
expires_atstring date-time

The time at which the authentication expires and can no longer be checked or retried.

All 6 operations