Send SMS verification code

Use this action to send an SMS with a verification code to a recipient phone number.

General requirements

  • Authentication: Basic (easiest to implement) or Digest
  • Encoding: Accepts only UTF-8 unicode characters as inputs.
  • Accepts: application/x-www-form-urlencoded
  • Responds with: application/json
  • Required headers: Content-Type - application/x-www-form-urlencoded
  • Rate limit: Default rate limits by product
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Form Data
string
required

The end user's phone number you want to send a message to, as digits without spaces or special characters, beginning with the country dialing code.

string

A code specifying the use case you are making the request for. Choices include:

  • ATCK - For use in a 2FA situation like updating an account or logging in.
  • BACF - For creating an account where the service may be vulnerable to bulk attacks and fraudsters.
  • BACS - For creating an account where the service may be vulnerable to bulk attacks or individual spammers.
  • CHBK - For use when someone is trying to buy something expensive or unusual and you want to verify it is really them.
  • CLDR - Calendar event.
  • LEAD - For use in a situation where you require a person to enter personal details to request information about a potential purchase (like a loan, real estate, or attending a school), and you want to check if they are legitimate.
  • OTHR - For a situation not addressed by other tags.
  • PWRT - For use in a situation where a password reset is required.
  • RESV - For use when you have end users making reservations, and you want to confirm they will show up.
  • RXPF - For use when you are trying to prevent prescription fraud.
  • SHIP - For use when you are sending a shipping notification.
  • THEF - For use when you are trying to prevent an end user from deactivating or redirecting a phone number for identity theft purposes.
  • TRVF - For use when you are transferring money and want to check if the transfer is approved by sending a text message to your end user. This is similar to CHBK, but is specifically for a money transaction.
  • UNKN - For a situation not addressed by other tags (same as OTHR).
string

Your end user's IP address (do not send your own IP address). This is used to help Telesign improve our services. IPv4 and IPv6 are supported. For IPv4, the value must be in the format defined by the Internet Engineering Task Force (IETF) in the Internet-Draft document titled Internet Protocol. For IPv6, the value must be in the format defined by the IETF in the Internet-Draft document titled IP Version 6 Addressing Architecture.

string

A code specifying the language of the predefined template you wish to use. For a complete list of codes, see SMS Verify API - Supported languages. If you provide overriding message text in the template parameter, this field is not used.

string
length between 3 and 7

The verification code used for the code challenge. By defauls, Telesign randomly generates a seven-digit numeric value for you. You can override the default behavior by including your own numeric code for this parameter, with a value between 000 and 9999999. Only numeric characters are supported. Either way, the verification code replaces the variable $$CODE$$ in the message template.

string

Text that overrides the contents of the predefined message templates. Include the $$CODE$$ variable to have the verification code automatically inserted. For payment transactions, include the $$AMOUNT$$ and $$PAYEE$$ variables to have those payment details from your other params automatically inserted. By default, the maximum length of this field is 160 characters. Telesign recommends that you keep your messages brief if possible, but if you want to send longer messages contact our Customer Support Team to have the maximum increased. A long message may be up to 1600 characters.

string
length ≤ 20

Specifies the sender ID to be displayed to the end user on the SMS message. Before using this, give any sender IDs you might want to use to our Customer Support Team, so we can add them to our allow list. If the sender ID in this field is not on this list, it is not used. We do not guarantee that the sender ID you specify will be used; Telesign may override this value to improve delivery quality or to follow the SMS regulations of particular countries. We recommend limiting values to 0-9 and A-Z, as support for other ASCII characters varies by carrier.

string
Defaults to true

Whether you are using this service as your primary provider to send this message (”true”) or"as a backup after your primary provider failed (”false”). We use this data to optimize message routing.

string
length ≤ 40

(India-local traffic only). The ID of the DLT template used for this message. See India DLT Update for more details on the relevant regulations.

string
length ≤ 40

(India-local traffic only). The ID of the entity sending this message. See India DLT Update for more details on the relevant regulations.

string
length ≤ 40

(Payment-transactions only) Replaces the $$AMOUNT$$ variable in the message template. Specifies the currency and amount for the payment that the end user is approving. This parameter is required if transaction_payee is included in the request.

string
length ≤ 40

(Payment-transactions only) Replaces the $$PAYEE$$ variable in the message template. Specifies the entity that the end user is approving a payment to.
This parameter is required if transaction_amount is included in the request.

string
length ≤ 40

Set a value of "true" to screen this transaction using a Telesign SIM Swap check. This only has an effect if we have enabled SIM Swap for your account and configured it to be toggled using this parameter. If your account is configured to perform the check on every transaction, set a value of "false" to suppress the check. Contact our Customer Support Team to turn on this feature.

string

A URL where you want delivery reports to be sent related to your request. This overrides any default callback URL that you’ve previously set. The override only lasts for this request.

Responses

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json