Credentials
Every smssak API call needs your API key and usually your Project ID. Get both from your project Settings on smssak.com.
What every API needs
key header.application/json.Where to find them on smssak.com
- Open your project in the smssak console.
- In the left sidebar, open Settings.
- Copy Project ID and API Key with the copy buttons (see screenshots below).
Project ID
Use this value as projectId in the JSON body of your API requests.
API key
Send this value in the key HTTP header on every request. Keep it private — do not put it in public client-side code.
key header may return a generic 500 response instead of a JSON error body.
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
+213…)."sms" or "whatsapp". Defaults to sms.4 or 6 digits. Defaults to 4.en, fr, or ar. Defaults to en.Try it
Send a request to see the response.
Example response
{ "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
Try it
Send a request to see the response.
Example response
{
"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.
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
+213…).{ "name": "Ali" }. Up to 5 fields; each value max 40 characters.Try it
Send a request to see the response.
Example response
{
"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. See SMS segments (PDU).
500 instead of a JSON error body.
Send WhatsApp message
Sends an approved WhatsApp message template to a number in any country. Pick a template below, fill its parameters, and test it — you only need your API key and Project ID. Copy the cURL to use it in your own code.
Request body
"DZ", "SA", "ES". WhatsApp templates can be sent to any country.0612345678 or +212612345678. Validated against the country code.payment_confirmation.booking_confirmation). A value starting with http:// or https:// is sent as an image.parameters automatically.Available WhatsApp templates
These approved templates are ready to send. Click Try this template to load it in the console below and test it.
Try it
Send a request to see the response.
Example response
{ "success": "WhatsApp message sent successfully." }
Errors
Error codes 12
| Status | Message | Cause |
|---|---|---|
| 405 | Method Not Allowed | Not a POST request. |
| 400 | Invalid request, missing parameters. | country, phone, templateName, or parameters missing or empty. |
| 400 | headerParameters must be an array. | headerParameters provided but not an array. |
| 400 | Invalid phone number. | Phone invalid for the given country. |
| 400 | Parameter count mismatch… | parameters.length differs from the template's placeholder count. The message lists the expected placeholders. |
| 400 | Button values mismatch… | Template has URL buttons but buttons count differs. |
| 401 | Unauthorized, missing Key. | API key missing or not recognized. |
| 402 | Insufficient funds to send SMS. | Account balance is below the 4 message cost (ignored for pro users). |
| 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 WhatsApp not found. | Template name does not exist. |
| 500 | Failed to send Whatsapp message. | WhatsApp (Meta) rejected the send or an unexpected error occurred. May include details. |
Notes
- The template must be approved before it can be sent — every template listed on this page is approved.
- Sending requires an API key, a Project ID that belongs to your account, and enough balance (
4per message, unlesspro). parametersmaps to the template body placeholders in order;headerParameters(when present) maps to the header.- Copy-code buttons (OTP templates) automatically use the first value you pass in
parameters. - The account API key is sent as the
keyheader. Keep it private — never expose it in client-side code.
SMS segments (PDU)
Segment count depends on encoding and length. Type a message below to see the result instantly.
Calculator
Type a message to see encoding, length, and segment count.
How it works
-
1
Encoding
All characters in the GSM 7-bit alphabet → GSM-7. Any other character (Arabic, emoji, …) → Unicode for the whole message.
-
2
Length
GSM-7: basic = 1 septet, extended
^ { } \ [ ] ~ | €= 2. Unicode: UTF-16 code units (emoji often count as 2). -
3
Segments
GSM-7: 1 if ≤ 160, else
ceil(length / 153). Unicode: 1 if ≤ 70, elseceil(length / 67).
Limits
Examples
€ ×2 → 11 → 1GSM characters
Click a character to insert it into the calculator. Anything outside this set forces Unicode.
1 septet each
Escape + character — 2 septets each
References
Country codes
Use a two-letter code like "DZ" — not the dialing prefix ("213" / "+213").
Usage
Algeria (DZ) only for OTP and notifications. Phone must be +213….
Any country in the list, for OTP and message templates, if the number is valid for that country.
Use the same country code you sent with.
All countries
+247+93+358+355+213+1+376+244+1+1+54+374+297+61+43+994+1+973+880+1+375+32+501+229+1+975+591+599+387+267+55+246+1+673+359+226+257+855+237+1+238+1+236+235+56+86+61+61+57+269+682+506+385+53+599+357+420+243+45+253+1+1+670+593+20+503+240+291+372+268+251+500+298+679+358+33+594+689+241+220+995+49+233+350+30+299+1+590+1+502+44+224+245+592+509+504+852+36+354+91+62+98+964+353+44+972+39+225+1+81+44+962+7+254+686+383+965+996+856+371+961+266+231+218+423+370+352+853+261+265+60+960+223+356+692+596+222+230+262+52+691+373+377+976+382+1+212+258+95+264+674+977+31+687+64+505+227+234+683+672+850+389+1+47+968+92+680+970+507+675+595+51+63+48+351+1+974+242+262+40+7+250+590+290+1+1+590+508+1+685+378+239+966+221+381+248+232+65+1+421+386+677+252+27+82+211+34+94+249+597+47+46+41+963+290+886+992+255+66+228+690+676+1+216+90+993+1+688+1+256+380+971+44+1+598+998+678+39+58+84+681+212+967+260+263No countries match your filter.
Privacy policy
How smssak collects, uses, and protects data when you use smssak.com, the console, this documentation, and the smssak APIs.
Who this policy covers
- Customers — developers and businesses who create a smssak account and projects, and call the API. For your account data, smssak decides how it is used.
- End users — the people whose phone numbers you send OTPs and messages to. For this data, you are responsible for having a lawful reason to contact them; smssak only processes it on your behalf to deliver and verify your messages.
Data we collect
How we use data
- Deliver OTPs, SMS notifications, and WhatsApp messages you request, and verify the codes your users enter.
- Authenticate API requests, calculate usage, charge your balance, and show reports and statistics in the console.
- Send you service emails: email verification, password reset, and low-balance alerts.
- Prevent fraud, spam, and abuse, and keep the platform secure and reliable.
- Comply with legal obligations and requests from telecom operators and authorities.
Who we share data with
This documentation site
- The docs site sets no tracking or advertising cookies.
- Your theme preference is saved in your browser's local storage.
- If you use a Try it console, the API key you type is saved in your browser's local storage so you don't have to re-enter it. It is sent only to the smssak API when you press Send request. Clear your browser's site data to remove it.
- Fonts are loaded from Google Fonts, which receives your IP address and browser details when the page loads.
Retention
- OTP codes are valid for 5 minutes and cannot be used after they expire.
- Message, usage, and payment records are kept for as long as your account is active and as needed for billing, dispute resolution, and legal obligations.
- Account and project data is kept until you ask us to delete your account.
Security
- All API and console traffic is encrypted in transit with HTTPS.
- API access requires your secret API key. Keep it server-side, and regenerate it from console Settings if it may have leaked.
- Access to production data is limited to the people who need it to operate the service.
Your responsibilities as a customer
- Only send messages to people who have a relationship with you or have agreed to receive them.
- Tell your users in your own privacy policy that their phone number is shared with smssak to deliver and verify messages.
- Do not put sensitive data (passwords, health, or financial details) in message templates or fields.
Your rights
You can ask to access, correct, or delete your personal data, or object to how it is used. If you are an end user who received a message through smssak, contact the business that sent it first; we will help them respond to your request.
- Email info@smssak.com from the address linked to your account.
- We may ask you to confirm your identity before acting on a request.
Changes to this policy
We may update this policy as the service changes. The "Last updated" date at the top shows the latest version; significant changes are announced by email or in the console.