SMS
Fetch Messages

Fetch Messages

Retrieve a paginated list of outbound SMS messages sent by your organisation. Filter by status, recipient number, sender ID, or source.


Endpoint

GET /v1/bulk-sms/messages/

Authentication: Bearer API key


Query Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number (default: 1)
page_sizeintegerNoResults per page (default: 100, max: 500)
statusstringNoFilter by status — see Status values below
mobilestringNoFilter by recipient phone number (partial match)
sender_idstringNoFilter by sender ID name (exact, case-insensitive)
sourcestringNoapi or web

Request

curl https://api.talkntalk.africa/v1/bulk-sms/messages/ \
  -H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

With filters:

curl "https://api.talkntalk.africa/v1/bulk-sms/messages/?status=delivered&page=1&page_size=50" \
  -H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Response

200 OK

{
  "total": 1248,
  "page": 1,
  "page_size": 100,
  "total_pages": 13,
  "next": "https://api.talkntalk.africa/v1/bulk-sms/messages/?page=2&page_size=100",
  "previous": null,
  "results": [
    {
      "id": "018f3a2b-7c4d-7e1a-b3f2-9d8e2c1a4b5f",
      "mobile": "254712345678",
      "sender_id": "TALKNTALK",
      "message": "Your OTP is 847291. Valid for 5 minutes.",
      "status": "delivered",
      "network": "safaricom",
      "source": "api",
      "scheduled_at": null,
      "created_at": "2026-05-20T11:30:00+03:00",
      "updated_at": "2026-05-20T11:30:04+03:00"
    }
  ]
}

Response Fields

FieldTypeDescription
idUUID stringUnique message identifier
mobilestringRecipient phone number in international format (254XXXXXXXXX)
sender_idstringSender name shown on the recipient's device
messagestringThe full message body
statusstringCurrent delivery status — see below
networkstringDetected recipient network (safaricom, airtel, telkom)
sourcestringapi — sent via API key · web — sent via the dashboard
scheduled_atstring|nullISO 8601 timestamp if the message was scheduled, otherwise null
created_atstringWhen the message was created (ISO 8601, Africa/Nairobi)
updated_atstringLast status update timestamp

Status Values

StatusMeaning
queuedAccepted and waiting to be dispatched
sentSubmitted to the SMS provider
deliveredConfirmed delivered to the handset
failedSubmission to the provider failed
undeliveredProvider could not deliver to the handset
cancelledMessage was cancelled before sending
heldWaiting — provider credits depleted, will send when topped up
blockedBlocked (DND registry or network policy)

Code Examples

Node.js

const response = await fetch(
  'https://api.talkntalk.africa/v1/bulk-sms/messages/?status=delivered&page_size=50',
  { headers: { Authorization: 'Bearer tk_live_xxxx' } }
);
const { results, total, total_pages } = await response.json();
console.log(`${total} messages across ${total_pages} pages`);

Python

import requests
 
r = requests.get(
    'https://api.talkntalk.africa/v1/bulk-sms/messages/',
    headers={'Authorization': 'Bearer tk_live_xxxx'},
    params={'status': 'delivered', 'page_size': 50},
)
data = r.json()
for msg in data['results']:
    print(msg['mobile'], msg['status'])

PHP

$ch = curl_init('https://api.talkntalk.africa/v1/bulk-sms/messages/?page_size=50');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer tk_live_xxxx']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = json_decode(curl_exec($ch), true);
foreach ($data['results'] as $msg) {
    echo $msg['mobile'] . ' — ' . $msg['status'] . PHP_EOL;
}

Error Responses

StatusCodeDescription
401 Unauthorizedauthentication_failedMissing or invalid API key
403 Forbiddenpermission_deniedAPI key does not have read access