Skip to main content
Endpoint: https://BASE_URL/api/sms/otp/generate Request Type: POST Sample Response:
OptionsRequiredDescription
api*keyyes_string*
Your API key (It can be found on your Termii dashboard).
pin*typeyesEnum: "NUMERIC" "ALPHANUMERIC"
Type of PIN code that will be generated and sent as part of the OTP message. You can set PIN type to numeric or alphanumeric
phone_numberyes_string*
Represents the destination phone number.Phone number must be in the international format (Example: 23490126727)
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*time_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.
{
"api_key": "Your API Key",
"pin_type": "NUMERIC",
"phone_number": "2348109477743",
"pin_attempts": 3,
"pin_time_to_live": 0,
"pin_length": 4
}
Sample Response:
{
       "status": "success",
       "data":
     {
         "pin_id": "db34d5ce-9bd4-4f10-b8ec-8ee402ccd0",
         "otp": "522726",
         "phone_number": "2348109077743",
         "phone_number_other": "Termii"
     }
  }