Skip to content

Read messages ​

Needs a key with the sms:read permission. Cancelling and retrying need sms:send.

One message ​

http
GET /api/v1/sms/{messageId}
json
{
  "messageId": "8f2a1c0e-4b7d-4e2a-9c31-5d0f6a7b8c90",
  "status": "DELIVERED",
  "recipient": "+250788123456",
  "message": "Your order has been confirmed.",
  "reference": "ORDER-10001",
  "priority": 5,
  "encoding": "GSM_7",
  "segments": 1,
  "deviceId": "59967c2f-79c3-42c3-b739-beb27e6afc9c",
  "createdAt": "2026-12-01T08:30:00Z",
  "submittedAt": "2026-12-01T08:30:09Z",
  "deliveredAt": "2026-12-01T08:30:14Z",
  "events": [
    { "eventType": "sms.queued", "newStatus": "QUEUED", "description": "Message accepted and queued", "createdAt": "2026-12-01T08:30:00Z" },
    { "eventType": "sms.delivered", "oldStatus": "SENT", "newStatus": "DELIVERED", "description": "Delivery confirmed by the mobile network", "createdAt": "2026-12-01T08:30:14Z" }
  ]
}

Fields without a value are left out: deliveredAt appears only once the message is delivered, failureReason only if it failed, scheduledAt only if it was scheduled.

The statuses are explained in Follow a message. GET /api/v1/sms/{messageId}/events returns the events alone.

A list ​

http
GET /api/v1/sms

Newest first. All filters are optional and combine:

ParameterMeaning
statusOne status, for example FAILED
recipientA phone number
deviceIdThe device that sent them
batchIdThe bulk send they belong to
from, toCreated at or after from, and before to. ISO 8601 dates.
pageThe page, starting at 0
sizeMessages per page: 20 by default, 100 at most
sh
curl "https://yoursms.ngwije.cloud/api/v1/sms?status=FAILED&from=2026-12-01T00:00:00Z&size=50" \
  -H "Authorization: Bearer $YOURSMS_API_KEY"
json
{
  "items": [ ],
  "page": 0,
  "size": 50,
  "totalElements": 132,
  "totalPages": 3
}

Messages in a list come without their events.

Polling or webhooks ​

To learn the outcome of a message you can ask for it again after a while. If you send more than a few, use webhooks instead: the server tells you, and you make no extra requests.

Cancel a message ​

http
POST /api/v1/sms/{messageId}/cancel

Works while the message is SCHEDULED or QUEUED. Once a phone has it, it is too late, and the answer is 409 MESSAGE_NOT_CANCELLABLE.

Retry a message ​

http
POST /api/v1/sms/{messageId}/retry

Works on a message that is FAILED, DELIVERY_FAILED or UNKNOWN. It returns to the queue as a new attempt. Otherwise the answer is 409 MESSAGE_NOT_RETRYABLE.

Retrying an unknown message can send it twice

UNKNOWN means the phone could not tell whether the message left. The server never retries these by itself. Retry one only when a duplicate is acceptable, or after checking with the recipient.