Messaging

Send SMS, WhatsApp, email and USSD with one consistent API. Learn the request format for each channel, what to watch for, and how to follow every message through to delivery.

How messaging works

Every channel follows the same pattern. You send a POST request with a JSON body and your API key in the x-api-key header. AvenoLink accepts the request, queues the message and returns a batch_id you can use to follow it. Because the shape is the same everywhere, adding a second channel is mostly a change of endpoint and a couple of fields.

  1. 1

    Authenticate

    Pass your channel API key in the x-api-key header. No tokens to refresh and no OAuth steps.

  2. 2

    Send

    POST to /api/v1/send/{channel} with recipients and content. You get a queued response straight away.

  3. 3

    Track

    Receive delivery callbacks on your webhook endpoint, so your system always knows what reached the customer.

Choose a channel

ChannelEndpointBest forReaches
SMSPOST /api/v1/send/smsOne-time codes, alerts, reminders, campaignsAny mobile phone
WhatsAppPOST /api/v1/send/whatsappConfirmations, updates, customer supportCustomers who use WhatsApp
EmailPOST /api/v1/send/emailInvoices, receipts, newslettersAny inbox
USSDYour endpoint, called by AvenoLinkMenus, balance checks, registrationsAny phone, no data needed
Phone numbers use international format without a plus sign or spaces, for example 265XXXXXXXXX. You can send to many recipients in a single request.

SMS

SMS is the most universal channel: it works on every phone, with no app and no internet connection. Use it for anything time-sensitive, like verification codes and payment alerts. The example below is available in 11 languages: pick one from the tabs, or open the menu for the rest.

FieldRequiredDescription
recipientsYesArray of phone numbers in international format.
sender_idYesThe name customers see as the sender, such as your brand.
messageYesThe text to send.

POST /api/v1/send/sms

curl -X POST https://api.avenolink.com/api/v1/send/sms \
  -H "x-api-key: YOUR_SMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipients": [
      "265XXXXXXXXX",
      "265YYYYYYYYY"
    ],
    "sender_id": "AVENOLINK",
    "message": "Your verification code is 482913. It expires in 5 minutes."
  }'
200 OK — Response
{
  "success": true,
  "batch_id": "bat_xk9m2p4q",
  "status": "queued",
  "recipients_count": 2,
  "credits_used": 2,
  "credits_remaining": 998,
  "package": "Starter"
}
  • A standard (GSM-7) SMS part holds 160 characters. Longer messages are joined from parts of 153 characters each.
  • Messages with emoji or non-Latin characters use Unicode, which holds 70 characters per part (67 when joined).
  • Each part uses credit, so keep codes and alerts short.

WhatsApp

WhatsApp suits conversations that benefit from a richer, more personal feel: order updates, booking confirmations and support follow-ups. The request is the same as SMS, without a sender_id.

POST /api/v1/send/whatsapp

curl -X POST https://api.avenolink.com/api/v1/send/whatsapp \
  -H "x-api-key: YOUR_WA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipients": [
      "265XXXXXXXXX",
      "265YYYYYYYYY"
    ],
    "message": "Hi! Your appointment is confirmed for tomorrow at 10 AM."
  }'
200 OK — Response
{
  "success": true,
  "batch_id": "bat_xk9m2p4q",
  "status": "queued",
  "recipients_count": 2,
  "credits_used": 2,
  "credits_remaining": 998,
  "package": "Starter"
}
  • Only message customers who have agreed to hear from you on WhatsApp.
  • WhatsApp's own business messaging policies apply in addition to ours.
  • Use SMS as a fallback for time-critical messages if a customer is not on WhatsApp.

Email

Email carries longer content such as invoices, receipts and newsletters. You can send HTML and a plain-text version together so every mail app displays it properly.

FieldDescription
toArray of recipient email addresses.
fromThe sending address, on a domain you own.
display_nameThe sender name shown in the inbox.
subjectThe subject line.
htmlThe HTML body.
textThe plain-text body, shown when HTML is unavailable.
reply_toWhere replies should go.

POST /api/v1/send/email

curl -X POST https://api.avenolink.com/api/v1/send/email \
  -H "x-api-key: YOUR_EMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": [
      "customer@example.com"
    ],
    "display_name": "YourBrand",
    "from": "hello@yourdomain.com",
    "subject": "Your invoice is ready",
    "html": "<p>Hi, your invoice <strong>#1042</strong> is attached.</p>",
    "text": "Hi, your invoice #1042 is ready.",
    "reply_to": "support@yourdomain.com"
  }'
200 OK — Response
{
  "success": true,
  "batch_id": "bat_xk9m2p4q",
  "status": "queued",
  "recipients_count": 2,
  "credits_used": 2,
  "credits_remaining": 998,
  "package": "Starter"
}
To keep mail out of spam folders, send from a domain you control and set up SPF and DKIM records for it. Always include a plain-text version alongside the HTML.

USSD

USSD runs menu sessions on any phone when a customer dials a short code such as *123#. Unlike the other channels, AvenoLink calls your server: you host an endpoint, and for every step we send the session details and show your reply on the customer's screen.

  • Each request includes session_id, phone_number and text.
  • text holds the choices made so far, joined by *. It is empty on the first request.
  • Start your reply with CON to keep the session open and show another menu.
  • Start your reply with END to show a final message and close the session.
Your endpoint (Next.js)
export async function POST(request) {
  const { text } = await request.json();
  const steps = text ? text.split("*") : [];

  if (steps.length === 0) {
    return new Response("CON Welcome to AvenoLink\n1. Check balance\n2. Buy airtime");
  }
  if (steps[0] === "1") {
    return new Response("END Your balance is MWK 12,500");
  }
  return new Response("END Thank you");
}

Respond quickly. USSD sessions time out fast, and customers expect each screen to appear almost instantly.

Track delivery

A successful send only means the message was queued. To know what happened next, register a webhook endpoint. We send an event for each status change, with the message_id and batch_id so you can match it to your own records.

StatusMeaning
queuedAccepted by AvenoLink and waiting to be sent.
deliveredConfirmed as received by the recipient's network or app.
failedCould not be delivered, for example an invalid number.
Example webhook event
{
  "id": "evt_7h2k9p1x",
  "type": "message.delivered",
  "created_at": "2026-11-11T09:41:12Z",
  "data": {
    "message_id": "msg_4f8a2c91",
    "batch_id": "bat_xk9m2p4q",
    "channel": "sms",
    "recipient": "265XXXXXXXXX",
    "status": "delivered"
  }
}

Best practices

  • Keep each API key on your server. Never put keys in a mobile app or in browser code.
  • Validate and normalise phone numbers before sending, so you do not pay for messages that cannot arrive.
  • Store the batch_id with each send so you can reconcile delivery events later.
  • Test every flow in the sandbox before sending to real customers.
  • Give people a clear way to opt out of marketing messages.