Messaging API guide
Connect
In Integrations, create a key for your application and select its permissions. Copy the account ID and key to your server and append this path to your HTTPS site address.
Use Send SMS for messages and campaigns, Send OTP for verification codes, Read balance for the account balance, and Read reports for message status, campaign reports and usage.
/api/v2
X-Client-Id: <account-id>
Authorization: Bearer <api-key>
Accept: application/json
When creating a campaign or sending an OTP, generate and save a new UUID for the Idempotency-Key header. After a timeout, retry the same request with that same key. Use a new key for different content.
Send a campaign
- Request a preview
POST /campaignsProvide up to 500,000 entries as JSON strings or upload a TXT or CSV file. JSON or file limit is 32 MiB. If a file or delimited input exceeds the recipient limit, its status changes to Failed with bulk_recipient_limit during import. For a larger audience, split it into campaigns and remove duplicates across batches before submission.
{ "sender": "YourBrand", "body": "Your order is ready.", "recipients": ["+447700900123", "+447700900124"] } - Review recipients and cost
GET /campaigns/{id}Save data.id from the 202 response. Poll according to Retry-After. When phase is Ready and confirmable is true, review eligible, parts, currentBalance, expectedCost, projectedBalance and currency.
- Confirm and send
POST /campaigns/{id}/confirmReturn to the same status URL after confirming. transport.accepted counts recipients whose messages the gateway accepted. Handset receipts update when available. For per-number results, use the recipients endpoint below.
File uploads, scheduling, reports and cancellation
For uploads use multipart/form-data with recipientsFile, sender and body. Add country (for example EG) to interpret national numbers. To schedule, provide scheduledUtc with Z or a numeric UTC offset. onlyNew applies the account and sender's new-recipient filter.
GET /campaigns/{id}/recipients?filter=all&page=1
POST /campaigns/{id}/cancel
Request cancellation while canCancel is true, before the scheduling cut-off. Increase page to retrieve more report rows.
Send one message
POST /messages
Send the sender, message body and one destination with an Idempotency-Key header. Use an international number or add country to interpret a national number. An 11-digit Egyptian number starting with 01 also works when country is omitted.
{"sender":"YourBrand","destination":"01012345678","country":"EG","body":"Your order is ready."}
Send an OTP
POST /otp
Your application generates and verifies the code. Send an approved sender, one international mobile number starting with +, a template language and a code as a string of 1–8 ASCII letters or digits. The fixed, single-part message is prioritized for the next dispatch.
Request
{
"sender": "YourBrand",
"to": "+447700900123",
"language": "en",
"code": "0K839378"
}Message on the phone
202 acknowledges admission. Use the returned message ID to track it below. On 429, wait for Retry-After before trying again. An expired queue wait or stopped dispatch can appear as data.reason (otp_dispatch_expired or otp_dispatch_stopped).
GET /messages/{id}
All 20 language templates
ar- رمز التحقق (OTP) الخاص بك: 0K839378 لا تشارك هذا الرمز مع أي شخص.
bn- আপনার যাচাইকরণ কোড: 0K839378 কাউকে এই কোড জানাবেন না।
de- Ihr Einmalcode: 0K839378 Geben Sie ihn nicht weiter.
el- Κωδικός επαλήθευσης: 0K839378 Μην τον δώσετε σε κανέναν.
en- Your OTP code: 0K839378 Do not share this OTP with anyone.
es- Tu código de verificación: 0K839378 No lo compartas con nadie.
fa- کد تأیید شما: 0K839378 این کد را به کسی ندهید.
fr- Votre code : 0K839378 Ne le communiquez à personne.
he- קוד האימות שלך: 0K839378 אין לשתף את הקוד עם איש.
hi- आपका सत्यापन कोड: 0K839378 इसे किसी को न बताएं।
it- Il tuo codice di verifica: 0K839378 Non condividerlo con nessuno.
ja- 認証コード:0K839378 このコードを他人に教えないでください。
nl- Uw verificatiecode: 0K839378 Deel deze code met niemand.
pl- Twój kod: 0K839378 Nie udostępniaj go nikomu.
pt- Seu código de verificação: 0K839378 Não o compartilhe com ninguém.
ru- Ваш код: 0K839378 Никому не сообщайте этот код.
tr- Doğrulama kodunuz: 0K839378 Bu kodu kimseyle paylaşmayın.
uk- Ваш код: 0K839378 Нікому не повідомляйте цей код.
ur- آپ کا تصدیقی کوڈ: 0K839378 یہ کوڈ کسی کو نہ بتائیں۔
zh- 您的验证码:0K839378 请勿将此验证码告知他人。
Integration examples
Download the server examples or import the API description and supply your own credentials locally. The examples cover preview, confirmation, status, OTP submission and message tracking.
Responses and errors
Responses contain ok, data, error and reference. Keep the reference for support. X-Request-Id carries the same value. On 405 check Allow. Check input on 400, credentials on 401 and permissions on 403. On 409, inspect the request state or an idempotency conflict.