smssak API

OTP & Notification SMS

Send one-time passwords, verify them, and deliver templated SMS notifications to your users.

Auth key header Content-Type application/json Method POST

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
+247
AF
Afghanistan
+93
AX
Aland
+358
AL
Albania
+355
DZ
Algeria
+213
AS
American Samoa
+1
AD
Andorra
+376
AO
Angola
+244
AI
Anguilla
+1
AG
Antigua and Barbuda
+1
AR
Argentina
+54
AM
Armenia
+374
AW
Aruba
+297
AU
Australia
+61
AT
Austria
+43
AZ
Azerbaijan
+994
BS
Bahamas
+1
BH
Bahrain
+973
BD
Bangladesh
+880
BB
Barbados
+1
BY
Belarus
+375
BE
Belgium
+32
BZ
Belize
+501
BJ
Benin
+229
BM
Bermuda
+1
BT
Bhutan
+975
BO
Bolivia
+591
BQ
Bonaire
+599
BA
Bosnia and Herzegovina
+387
BW
Botswana
+267
BR
Brazil
+55
IO
British Indian Ocean Territory
+246
VG
British Virgin Islands
+1
BN
Brunei
+673
BG
Bulgaria
+359
BF
Burkina Faso
+226
BI
Burundi
+257
KH
Cambodia
+855
CM
Cameroon
+237
CA
Canada
+1
CV
Cape Verde
+238
KY
Cayman Islands
+1
CF
Central African Republic
+236
TD
Chad
+235
CL
Chile
+56
CN
China
+86
CX
Christmas Island
+61
CC
Cocos (Keeling) Islands
+61
CO
Colombia
+57
KM
Comoros
+269
CK
Cook Islands
+682
CR
Costa Rica
+506
HR
Croatia
+385
CU
Cuba
+53
CW
Curacao
+599
CY
Cyprus
+357
CZ
Czech Republic
+420
CD
Democratic Republic of the Congo
+243
DK
Denmark
+45
DJ
Djibouti
+253
DM
Dominica
+1
DO
Dominican Republic
+1
TL
East Timor
+670
EC
Ecuador
+593
EG
Egypt
+20
SV
El Salvador
+503
GQ
Equatorial Guinea
+240
ER
Eritrea
+291
EE
Estonia
+372
SZ
Eswatini
+268
ET
Ethiopia
+251
FK
Falkland Islands
+500
FO
Faroe Islands
+298
FJ
Fiji
+679
FI
Finland
+358
FR
France
+33
GF
French Guiana
+594
PF
French Polynesia
+689
GA
Gabon
+241
GM
Gambia
+220
GE
Georgia
+995
DE
Germany
+49
GH
Ghana
+233
GI
Gibraltar
+350
GR
Greece
+30
GL
Greenland
+299
GD
Grenada
+1
GP
Guadeloupe
+590
GU
Guam
+1
GT
Guatemala
+502
GG
Guernsey
+44
GN
Guinea
+224
GW
Guinea-Bissau
+245
GY
Guyana
+592
HT
Haiti
+509
HN
Honduras
+504
HK
Hong Kong
+852
HU
Hungary
+36
IS
Iceland
+354
IN
India
+91
ID
Indonesia
+62
IR
Iran
+98
IQ
Iraq
+964
IE
Ireland
+353
IM
Isle of Man
+44
IL
Israel
+972
IT
Italy
+39
CI
Ivory Coast
+225
JM
Jamaica
+1
JP
Japan
+81
JE
Jersey
+44
JO
Jordan
+962
KZ
Kazakhstan
+7
KE
Kenya
+254
KI
Kiribati
+686
XK
Kosovo
+383
KW
Kuwait
+965
KG
Kyrgyzstan
+996
LA
Laos
+856
LV
Latvia
+371
LB
Lebanon
+961
LS
Lesotho
+266
LR
Liberia
+231
LY
Libya
+218
LI
Liechtenstein
+423
LT
Lithuania
+370
LU
Luxembourg
+352
MO
Macao
+853
MG
Madagascar
+261
MW
Malawi
+265
MY
Malaysia
+60
MV
Maldives
+960
ML
Mali
+223
MT
Malta
+356
MH
Marshall Islands
+692
MQ
Martinique
+596
MR
Mauritania
+222
MU
Mauritius
+230
YT
Mayotte
+262
MX
Mexico
+52
FM
Micronesia
+691
MD
Moldova
+373
MC
Monaco
+377
MN
Mongolia
+976
ME
Montenegro
+382
MS
Montserrat
+1
MA
Morocco
+212
MZ
Mozambique
+258
MM
Myanmar (Burma)
+95
NA
Namibia
+264
NR
Nauru
+674
NP
Nepal
+977
NL
Netherlands
+31
NC
New Caledonia
+687
NZ
New Zealand
+64
NI
Nicaragua
+505
NE
Niger
+227
NG
Nigeria
+234
NU
Niue
+683
NF
Norfolk Island
+672
KP
North Korea
+850
MK
North Macedonia
+389
MP
Northern Mariana Islands
+1
NO
Norway
+47
OM
Oman
+968
PK
Pakistan
+92
PW
Palau
+680
PS
Palestine
+970
PA
Panama
+507
PG
Papua New Guinea
+675
PY
Paraguay
+595
PE
Peru
+51
PH
Philippines
+63
PL
Poland
+48
PT
Portugal
+351
PR
Puerto Rico
+1
QA
Qatar
+974
CG
Republic of the Congo
+242
RE
Reunion
+262
RO
Romania
+40
RU
Russia
+7
RW
Rwanda
+250
BL
Saint Barthelemy
+590
SH
Saint Helena
+290
KN
Saint Kitts and Nevis
+1
LC
Saint Lucia
+1
MF
Saint Martin
+590
PM
Saint Pierre and Miquelon
+508
VC
Saint Vincent and the Grenadines
+1
WS
Samoa
+685
SM
San Marino
+378
ST
Sao Tome and Principe
+239
SA
Saudi Arabia
+966
SN
Senegal
+221
RS
Serbia
+381
SC
Seychelles
+248
SL
Sierra Leone
+232
SG
Singapore
+65
SX
Sint Maarten
+1
SK
Slovakia
+421
SI
Slovenia
+386
SB
Solomon Islands
+677
SO
Somalia
+252
ZA
South Africa
+27
KR
South Korea
+82
SS
South Sudan
+211
ES
Spain
+34
LK
Sri Lanka
+94
SD
Sudan
+249
SR
Suriname
+597
SJ
Svalbard and Jan Mayen
+47
SE
Sweden
+46
CH
Switzerland
+41
SY
Syria
+963
TA
TA
+290
TW
Taiwan
+886
TJ
Tajikistan
+992
TZ
Tanzania
+255
TH
Thailand
+66
TG
Togo
+228
TK
Tokelau
+690
TO
Tonga
+676
TT
Trinidad and Tobago
+1
TN
Tunisia
+216
TR
Turkey
+90
TM
Turkmenistan
+993
TC
Turks and Caicos Islands
+1
TV
Tuvalu
+688
VI
U.S. Virgin Islands
+1
UG
Uganda
+256
UA
Ukraine
+380
AE
United Arab Emirates
+971
GB
United Kingdom
+44
US
United States
+1
UY
Uruguay
+598
UZ
Uzbekistan
+998
VU
Vanuatu
+678
VA
Vatican City
+39
VE
Venezuela
+58
VN
Vietnam
+84
WF
Wallis and Futuna
+681
EH
Western Sahara
+212
YE
Yemen
+967
ZM
Zambia
+260
ZW
Zimbabwe
+263
POSThttps://sendotp-47lvvvrp4a-uc.a.run.app

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
countryrequired
string
Two-letter country code (see Country codes). For SMS, must be "DZ".
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

Live call to the API
Request
Response
Waiting
Send a request to see the response.

Example response

200 OK Success
{ "success": "SMS sent successfully." }

Errors

Error codes 15
StatusMessageCause
405Method Not AllowedNot a POST request.
400Invalid message type. Must be 'sms' or 'whatsapp'.type is neither value.
400Invalid request, missing parameters.country or phone missing.
400Invalid phone number.Phone invalid for the country.
400Only Algeria (DZ) country code is allowed for SMS type.SMS was requested with a country other than Algeria.
400Only Algeria (DZ) country code is allowed.Phone number is not an Algerian number.
401Unauthorized, missing Key.API key missing or not recognized.
402Insufficient funds to send SMS.Account balance is too low.
404Invalid API key.API key does not match an account.
404Project not found.Project does not exist or is not yours.
404User not found.Account could not be found.
404Country not found.Country is not supported for billing.
429Too many OTP requests. Please try again after an hour.More than 3 requests in one hour for that phone.
500Failed to send SMS.Message could not be delivered.
500An 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).
POSThttps://verifyotp-47lvvvrp4a-uc.a.run.app

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

Live call to the API
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
StatusMessageCause
405Method Not AllowedNot a POST request.
400Invalid request, missing parameters.phone, otp, or projectId missing.
400Invalid phone number.Phone invalid for the country.
400Invalid OTP.Code does not match the stored OTP.
400OTP has expired.Past the 5-minute window.
401Unauthorized, missing Key.API key missing or not recognized.
404Invalid API key.API key does not match an account.
404Project not found.Project does not exist or is not yours.
404OTP not found or expired.No OTP was found for this phone number.
500An 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.
POSThttps://sendmessagewithtemplate-47lvvvrp4a-uc.a.run.app

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
countryrequired
string
Must be "DZ" (Algeria). See Country codes.
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

Live call to the API
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
StatusMessageCause
405Method Not AllowedNot a POST request.
400Invalid request, missing parameters.Missing country, phone, projectId, or templateId.
400Only Algeria (DZ) country code is allowed.Country is not Algeria.
400Invalid phone number.Phone invalid.
400Missing template fields.Empty/missing placeholder values. Body includes missing[].
400Invalid template fields. (too_many_fields)More than 5 fields. Includes details.
400Invalid template fields. (field_value_too_long)A value exceeds 40 chars. Includes details.
400Rendered message is empty.Body blank after substitution.
402Insufficient funds to send SMS.Account balance is too low.
403Template not approved.Template is not approved yet. Response includes status.
404Invalid API key.API key does not match an account.
404Project not found.Project does not exist or is not yours.
404Template not found.Template does not exist or is not yours.
404User not found.Account could not be found.
404Country not found.Country is not supported for billing.
500Failed 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.