MobileSasaDocs

Inbound messages

Every text your customers send to your shortcodes is stored — pull them over the API with filters on shortcode, keyword, routing outcome and time window.

This is the pull counterpart to the push-style inbound webhooks. Use the webhook for real-time handling and this API for backfills, audits, dashboards, or when you'd rather poll than host an endpoint.

List inbound messages

GET/api/v1/inbound

Query parameters

FieldTypeRequiredDescription
shortcodestringNoOnly messages to this shortcode.
keywordstringNoOnly messages that matched this keyword.
statusstringNoFilter by routing_status — see the table below.
from / toRFC 3339 timestampNoReceived-at window, e.g. from=2026-07-01T00:00:00Z.
page / page_sizeintNoStandard pagination.
curl "https://api.mobilesasa.com/api/v1/inbound?shortcode=40404&keyword=BALANCE&from=2026-07-01T00:00:00Z&page=1" \
  -H "Authorization: Bearer $MOBILESASA_TOKEN"
Response — 200
{
  "success": true,
  "data": [
    {
      "uuid": "b8d3…",
      "msisdn": "254712345678",
      "message": "BALANCE 4471",
      "shortcode": "40404",
      "keyword": "BALANCE",
      "provider": "safaricom",
      "routing_status": "callback",
      "received_at": "2026-07-11T13:22:08Z",
      "created_at": "2026-07-11T13:22:09Z"
    }
  ],
  "meta": { "page": 1, "page_size": 20, "total": 1284 }
}

What routing_status tells you

Parameters

FieldTypeRequiredDescription
directdedicatedNoArrived on your own shortcode — no keyword needed, it's all yours.
matchedsharedNoMatched one of your keywords on the shared shortcode.
callbackforwardedNoDelivered to the keyword's callback URL successfully.
surveyroutedNoOpened or continued a survey session — the reply lives in the survey's responses.
unmatcheddroppedNoShared-shortcode message that matched none of your keywords — you only see these on your own shortcodes.

Reconciling webhook deliveries

Webhooks are at-least-once and your endpoint can be down. A periodic sweep of this API filtered to status=matched (received but not confirmed forwarded) is a cheap way to catch anything your webhook missed.