OTP & Notification SMS
Send one-time passwords, verify them, and deliver templated SMS notifications to your users.
Authentication
Include your API key on every request, along with a JSON content type. Requests without a valid key are rejected.
Header
Required
Description
key
yes
Your account API key.
Content-Type
yes
application/json
Missing or invalid key
An invalid
key header may return a generic 500 response instead of a JSON error body.
Country codes
Set country to a two-letter code such as "DZ". Do not use the dialing prefix — write "DZ", not "213" or "+213".
Which codes can I use?
- SMS OTP and SMS notifications — only Algeria (
DZ). The phone number must be an Algerian number (+213…). - WhatsApp OTP — any country from the list below, as long as the phone number is valid for that country.
- Verify OTP — use the same country code you used when the OTP was sent.
All countries (245)
Code
Country
Dialing prefix
AC
AC
+247AF
Afghanistan
+93AX
Aland
+358AL
Albania
+355DZ
Algeria
+213AS
American Samoa
+1AD
Andorra
+376AO
Angola
+244AI
Anguilla
+1AG
Antigua and Barbuda
+1AR
Argentina
+54AM
Armenia
+374AW
Aruba
+297AU
Australia
+61AT
Austria
+43AZ
Azerbaijan
+994BS
Bahamas
+1BH
Bahrain
+973BD
Bangladesh
+880BB
Barbados
+1BY
Belarus
+375BE
Belgium
+32BZ
Belize
+501BJ
Benin
+229BM
Bermuda
+1BT
Bhutan
+975BO
Bolivia
+591BQ
Bonaire
+599BA
Bosnia and Herzegovina
+387BW
Botswana
+267BR
Brazil
+55IO
British Indian Ocean Territory
+246VG
British Virgin Islands
+1BN
Brunei
+673BG
Bulgaria
+359BF
Burkina Faso
+226BI
Burundi
+257KH
Cambodia
+855CM
Cameroon
+237CA
Canada
+1CV
Cape Verde
+238KY
Cayman Islands
+1CF
Central African Republic
+236TD
Chad
+235CL
Chile
+56CN
China
+86CX
Christmas Island
+61CC
Cocos (Keeling) Islands
+61CO
Colombia
+57KM
Comoros
+269CK
Cook Islands
+682CR
Costa Rica
+506HR
Croatia
+385CU
Cuba
+53CW
Curacao
+599CY
Cyprus
+357CZ
Czech Republic
+420CD
Democratic Republic of the Congo
+243DK
Denmark
+45DJ
Djibouti
+253DM
Dominica
+1DO
Dominican Republic
+1TL
East Timor
+670EC
Ecuador
+593EG
Egypt
+20SV
El Salvador
+503GQ
Equatorial Guinea
+240ER
Eritrea
+291EE
Estonia
+372SZ
Eswatini
+268ET
Ethiopia
+251FK
Falkland Islands
+500FO
Faroe Islands
+298FJ
Fiji
+679FI
Finland
+358FR
France
+33GF
French Guiana
+594PF
French Polynesia
+689GA
Gabon
+241GM
Gambia
+220GE
Georgia
+995DE
Germany
+49GH
Ghana
+233GI
Gibraltar
+350GR
Greece
+30GL
Greenland
+299GD
Grenada
+1GP
Guadeloupe
+590GU
Guam
+1GT
Guatemala
+502GG
Guernsey
+44GN
Guinea
+224GW
Guinea-Bissau
+245GY
Guyana
+592HT
Haiti
+509HN
Honduras
+504HK
Hong Kong
+852HU
Hungary
+36IS
Iceland
+354IN
India
+91ID
Indonesia
+62IR
Iran
+98IQ
Iraq
+964IE
Ireland
+353IM
Isle of Man
+44IL
Israel
+972IT
Italy
+39CI
Ivory Coast
+225JM
Jamaica
+1JP
Japan
+81JE
Jersey
+44JO
Jordan
+962KZ
Kazakhstan
+7KE
Kenya
+254KI
Kiribati
+686XK
Kosovo
+383KW
Kuwait
+965KG
Kyrgyzstan
+996LA
Laos
+856LV
Latvia
+371LB
Lebanon
+961LS
Lesotho
+266LR
Liberia
+231LY
Libya
+218LI
Liechtenstein
+423LT
Lithuania
+370LU
Luxembourg
+352MO
Macao
+853MG
Madagascar
+261MW
Malawi
+265MY
Malaysia
+60MV
Maldives
+960ML
Mali
+223MT
Malta
+356MH
Marshall Islands
+692MQ
Martinique
+596MR
Mauritania
+222MU
Mauritius
+230YT
Mayotte
+262MX
Mexico
+52FM
Micronesia
+691MD
Moldova
+373MC
Monaco
+377MN
Mongolia
+976ME
Montenegro
+382MS
Montserrat
+1MA
Morocco
+212MZ
Mozambique
+258MM
Myanmar (Burma)
+95NA
Namibia
+264NR
Nauru
+674NP
Nepal
+977NL
Netherlands
+31NC
New Caledonia
+687NZ
New Zealand
+64NI
Nicaragua
+505NE
Niger
+227NG
Nigeria
+234NU
Niue
+683NF
Norfolk Island
+672KP
North Korea
+850MK
North Macedonia
+389MP
Northern Mariana Islands
+1NO
Norway
+47OM
Oman
+968PK
Pakistan
+92PW
Palau
+680PS
Palestine
+970PA
Panama
+507PG
Papua New Guinea
+675PY
Paraguay
+595PE
Peru
+51PH
Philippines
+63PL
Poland
+48PT
Portugal
+351PR
Puerto Rico
+1QA
Qatar
+974CG
Republic of the Congo
+242RE
Reunion
+262RO
Romania
+40RU
Russia
+7RW
Rwanda
+250BL
Saint Barthelemy
+590SH
Saint Helena
+290KN
Saint Kitts and Nevis
+1LC
Saint Lucia
+1MF
Saint Martin
+590PM
Saint Pierre and Miquelon
+508VC
Saint Vincent and the Grenadines
+1WS
Samoa
+685SM
San Marino
+378ST
Sao Tome and Principe
+239SA
Saudi Arabia
+966SN
Senegal
+221RS
Serbia
+381SC
Seychelles
+248SL
Sierra Leone
+232SG
Singapore
+65SX
Sint Maarten
+1SK
Slovakia
+421SI
Slovenia
+386SB
Solomon Islands
+677SO
Somalia
+252ZA
South Africa
+27KR
South Korea
+82SS
South Sudan
+211ES
Spain
+34LK
Sri Lanka
+94SD
Sudan
+249SR
Suriname
+597SJ
Svalbard and Jan Mayen
+47SE
Sweden
+46CH
Switzerland
+41SY
Syria
+963TA
TA
+290TW
Taiwan
+886TJ
Tajikistan
+992TZ
Tanzania
+255TH
Thailand
+66TG
Togo
+228TK
Tokelau
+690TO
Tonga
+676TT
Trinidad and Tobago
+1TN
Tunisia
+216TR
Turkey
+90TM
Turkmenistan
+993TC
Turks and Caicos Islands
+1TV
Tuvalu
+688VI
U.S. Virgin Islands
+1UG
Uganda
+256UA
Ukraine
+380AE
United Arab Emirates
+971GB
United Kingdom
+44US
United States
+1UY
Uruguay
+598UZ
Uzbekistan
+998VU
Vanuatu
+678VA
Vatican City
+39VE
Venezuela
+58VN
Vietnam
+84WF
Wallis and Futuna
+681EH
Western Sahara
+212YE
Yemen
+967ZM
Zambia
+260ZW
Zimbabwe
+263No countries match your filter.
Send OTP
Creates a one-time password and sends it by SMS or WhatsApp. The code is valid for 5 minutes. Confirm it with Verify OTP.
Request body
Field
Type
Description
phonerequired
string
Recipient phone number. For SMS, must be an Algerian number (
+213…).projectIdrequired
string
Your project ID. Used for the app name and billing.
typeoptional
string
Delivery channel:
"sms" or "whatsapp". Defaults to sms.lengthoptional
number | string
OTP length:
4 or 6 digits. Defaults to 4.langoptional
string
Message language for SMS:
en, fr, or ar. Defaults to en.Try it
Request
Response
— Waiting
Send a request to see the response.
Example response
200 OK Success
{ "success": "SMS sent successfully." }
Errors
Error codes 15
| Status | Message | Cause |
|---|---|---|
| 405 | Method Not Allowed | Not a POST request. |
| 400 | Invalid message type. Must be 'sms' or 'whatsapp'. | type is neither value. |
| 400 | Invalid request, missing parameters. | country or phone missing. |
| 400 | Invalid phone number. | Phone invalid for the country. |
| 400 | Only Algeria (DZ) country code is allowed for SMS type. | SMS was requested with a country other than Algeria. |
| 400 | Only Algeria (DZ) country code is allowed. | Phone number is not an Algerian number. |
| 401 | Unauthorized, missing Key. | API key missing or not recognized. |
| 402 | Insufficient funds to send SMS. | Account balance is too low. |
| 404 | Invalid API key. | API key does not match an account. |
| 404 | Project not found. | Project does not exist or is not yours. |
| 404 | User not found. | Account could not be found. |
| 404 | Country not found. | Country is not supported for billing. |
| 429 | Too many OTP requests. Please try again after an hour. | More than 3 requests in one hour for that phone. |
| 500 | Failed to send SMS. | Message could not be delivered. |
| 500 | An error occurred while processing the request. | Unexpected server error. |
Notes
- The OTP stays valid for 5 minutes.
- You can send at most 3 OTPs per phone number per hour (your own verified number is exempt).
Verify OTP
Checks the code the user entered. On success, returns the verified user and creates their record the first time.
Request body
Field
Type
Description
phonerequired
string
The phone number that received the OTP.
otprequired
string
The code the user entered.
projectIdrequired
string
Your project ID.
countryrequired
string
Same country code used when sending the OTP (see Country codes). Always include it.
Try it
Request
Response
— Waiting
Send a request to see the response.
Example response
200 OK Success
{
"user": {
"uid": "f1e2d3c4-...",
"identifier": "+213555123456",
"country": "DZ",
"createdAt": "2026-09-18T10:00:00.000Z",
"lastLogin": "2026-09-18T10:02:13.000Z",
"projectId": "my-project-id",
"customerId": "<userId>",
"type": "sms"
}
}
Errors
Error codes 10
| Status | Message | Cause |
|---|---|---|
| 405 | Method Not Allowed | Not a POST request. |
| 400 | Invalid request, missing parameters. | phone, otp, or projectId missing. |
| 400 | Invalid phone number. | Phone invalid for the country. |
| 400 | Invalid OTP. | Code does not match the stored OTP. |
| 400 | OTP has expired. | Past the 5-minute window. |
| 401 | Unauthorized, missing Key. | API key missing or not recognized. |
| 404 | Invalid API key. | API key does not match an account. |
| 404 | Project not found. | Project does not exist or is not yours. |
| 404 | OTP not found or expired. | No OTP was found for this phone number. |
| 500 | An error occurred while processing the request. | Unexpected server error. |
Notes
- Only the latest OTP for that phone number is checked.
- On first success, a user record is created for that phone. Later verifications update the last login time.
- A successful check does not invalidate the OTP early — it remains usable until it expires.
Always include the country
If
country is missing, the request may fail with a generic 500 instead of a clear error message.
Send notification
Sends an SMS notification using one of your approved templates and the values you provide for its placeholders.
Request body
Field
Type
Description
phonerequired
string
Recipient phone number (Algerian,
+213…).projectIdrequired
string
Your project ID.
templateIdrequired
string
ID of an approved template on your account.
fieldsoptional
object
Values for template placeholders, e.g.
{ "name": "Ali" }. Up to 5 fields; each value max 40 characters.Try it
Request
Response
— Waiting
Send a request to see the response.
Example response
200 OK Success
{
"success": "SMS sent successfully.",
"encoding": "GSM-7",
"smsLength": 47,
"pduCount": 1,
"cost": 7.5
}
Errors
Error codes 16
| Status | Message | Cause |
|---|---|---|
| 405 | Method Not Allowed | Not a POST request. |
| 400 | Invalid request, missing parameters. | Missing country, phone, projectId, or templateId. |
| 400 | Only Algeria (DZ) country code is allowed. | Country is not Algeria. |
| 400 | Invalid phone number. | Phone invalid. |
| 400 | Missing template fields. | Empty/missing placeholder values. Body includes missing[]. |
| 400 | Invalid template fields. (too_many_fields) | More than 5 fields. Includes details. |
| 400 | Invalid template fields. (field_value_too_long) | A value exceeds 40 chars. Includes details. |
| 400 | Rendered message is empty. | Body blank after substitution. |
| 402 | Insufficient funds to send SMS. | Account balance is too low. |
| 403 | Template not approved. | Template is not approved yet. Response includes status. |
| 404 | Invalid API key. | API key does not match an account. |
| 404 | Project not found. | Project does not exist or is not yours. |
| 404 | Template not found. | Template does not exist or is not yours. |
| 404 | User not found. | Account could not be found. |
| 404 | Country not found. | Country is not supported for billing. |
| 500 | Failed to send SMS. | Message could not be delivered. |
Notes
- The template must be approved before you can send it.
- Placeholders look like
{{name}}. Every required placeholder must have a non-empty value. - You can send at most 5 fields; each value can be up to 40 characters.
- Cost is based on SMS segments. The response includes encoding, length, segment count, and cost.
Unexpected errors
Some failures may return a generic
500 instead of a JSON error body.
No endpoints match your search.