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
Authenticate
Pass your channel API key in the
x-api-keyheader. No tokens to refresh and no OAuth steps. - 2
Send
POST to
/api/v1/send/{channel}with recipients and content. You get aqueuedresponse straight away. - 3
Track
Receive delivery callbacks on your webhook endpoint, so your system always knows what reached the customer.
Choose a channel
| Channel | Endpoint | Best for | Reaches |
|---|---|---|---|
| SMS | POST /api/v1/send/sms | One-time codes, alerts, reminders, campaigns | Any mobile phone |
POST /api/v1/send/whatsapp | Confirmations, updates, customer support | Customers who use WhatsApp | |
POST /api/v1/send/email | Invoices, receipts, newsletters | Any inbox | |
| USSD | Your endpoint, called by AvenoLink | Menus, balance checks, registrations | Any phone, no data needed |
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.
| Field | Required | Description |
|---|---|---|
| recipients | Yes | Array of phone numbers in international format. |
| sender_id | Yes | The name customers see as the sender, such as your brand. |
| message | Yes | The 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."
}'{
"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 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."
}'{
"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 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.
| Field | Description |
|---|---|
| to | Array of recipient email addresses. |
| from | The sending address, on a domain you own. |
| display_name | The sender name shown in the inbox. |
| subject | The subject line. |
| html | The HTML body. |
| text | The plain-text body, shown when HTML is unavailable. |
| reply_to | Where 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"
}'{
"success": true,
"batch_id": "bat_xk9m2p4q",
"status": "queued",
"recipients_count": 2,
"credits_used": 2,
"credits_remaining": 998,
"package": "Starter"
}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_numberandtext. textholds the choices made so far, joined by*. It is empty on the first request.- Start your reply with
CONto keep the session open and show another menu. - Start your reply with
ENDto show a final message and close the session.
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.
| Status | Meaning |
|---|---|
| queued | Accepted by AvenoLink and waiting to be sent. |
| delivered | Confirmed as received by the recipient's network or app. |
| failed | Could not be delivered, for example an invalid number. |
{
"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_idwith 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.