SendAfrica logoSendAfricaDocs

Notifications

In-app notifications for low balance alerts, payment confirmations, campaign completions, and platform announcements.


Notifications are the shared sink for platform events: low-balance alerts (deduplicated to one per 24 h per account below the threshold), payment confirmations, and broadcast announcements fanned out to every active account.

#Endpoints

MethodPathDescription
GET/v1/notifications/List notifications (paginated)
GET/v1/notifications/unread-countUnread badge count
PATCH/v1/notifications/{id}/readMark one read
POST/v1/notifications/read-allMark all read

#List & badge

bash
bash
curl -s https://api.sendafrica.online/v1/notifications/unread-count \
  -H "Authorization: Bearer $JWT_TOKEN"

# { "success": true, "data": { "count": 3 } }
GET /v1/notifications — 200 OK
json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": 91,
        "type": "payment_confirmed",
        "title": "Payment confirmed",
        "body": "Your top-up of 50,000 TZS added 5,000 credits.",
        "read": false,
        "created_at": "2026-06-11T16:24:05Z"
      },
      {
        "id": 90,
        "type": "low_balance",
        "title": "Low credit balance",
        "body": "Balance is 38 credits. Top up to avoid send failures.",
        "read": false,
        "created_at": "2026-06-11T08:00:00Z"
      }
    ],
    "total": 12,
    "page": 1,
    "per_page": 25,
    "total_pages": 1
  }
}

#Marking read

bash
bash
# One notification
curl -s -X PATCH https://api.sendafrica.online/v1/notifications/91/read \
  -H "Authorization: Bearer $JWT_TOKEN"

# Everything at once
curl -s -X POST https://api.sendafrica.online/v1/notifications/read-all \
  -H "Authorization: Bearer $JWT_TOKEN"
notifications.php
php
<?php
// Latest notifications
$page = $client->notifications->list();
foreach ($page["items"] as $n) {
    echo $n->title . ": " . $n->body . "\n";
}

$unread = $client->notifications->unreadCount();
echo "{$unread} unread\n";

$client->notifications->markRead($id);
$client->notifications->markAllRead();

Announcements are broadcast to every active account. The low-balance alert threshold defaults to 50 credits.