Skip to main content
Endpoint: https://BASE_URL/api/sms/otp/send Request Type: POST Sample Response:
OptionsRequiredDescription
api*keyyes_string*
Your API key (It can be found on your Termii dashboard).
message*typeyesEnum: "NUMERIC" "ALPHANUMERIC" Type of message that will be generated and sent as part of the OTP message. You can set message type to numeric or alphanumeric
toyes_string*
Represents the email address if the channel is set to email (Example: [email protected]). It represents the destination phone number if other channels are selected. Phone number must be in the international format (Example: 23490126727)
fromyesstring
Represents the configuration ID if the channel is set to email (Example: 0a53c416-uocj-95af-ab3c306aellc). It can be found on your Termii dashboard. If other channels are selected, it represents a sender ID which can be alphanumeric or numeric. Alphanumeric sender ID length should be between 3 and 11 characters (Example: CompanyName)
channelyesstring
This is the route through which the message is sent. It is either dnd, WhatsApp, or generic or email
pin*attemptsyes_integer*
Example: 3 Represents the number of times the PIN can be attempted before expiration. It has a minimum of one attempt
pin*times_to_liveyes_integer*
Example: 1 Represents how long the PIN is valid before expiration. The time is in minutes. The minimum time value is 0 and the maximum time value is 60
pin*lengthyes_integer*
Example: 4 The length of the PIN code. It has a minimum of 4 and maximum of 8.
pin*placeholderyes_string*
Example: "< 1234 >" PIN placeholder. Right before sending the message, PIN code placeholder will be replaced with generate PIN code.
message*textyes_string*
Text of a message that would be sent to the destination phone number
{
 "api_key" : "Your API key",
 "message_type" : "NUMERIC",
 "to" : "eg. 2348109077743",
 "from" : "Approved Sender ID or Configuration ID",
 "channel" : "dnd",
 "pin_attempts" : 10,
 "pin_time_to_live" :  5,
 "pin_length" : 6,
 "pin_placeholder" : "< 1234 >",
 "message_text" : "Your pin is < 1234 >",
 "pin_type" : "NUMERIC"
}
Sample Response:
  {
    "pinId": "29ae67c2-c8e1-4165-8a51-8d3d7c298081",
    "to": "2348109077743",
    "smsStatus": "Message Sent"
  }