إرسال
SMS

Get Message Details

Get the delivery status and details of a specific message

Endpoint

GET /api/sms/messages/{message_id}

Path parameters

FieldTypeDescription
message_idstring (UUID)The message_id returned when the message was sent

Example

curl "https://sms.lamah.com/api/sms/messages/a3a7b9a2-9d3f-4a7e-9b4e-13b1e9b1f2aa" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

The endpoint returns an array containing the message object:

[
  {
    "short_message": "Your appointment is confirmed for Tuesday at 4:30 PM.",
    "message_type": "sms",
    "send_type": "single",
    "contact_group_id": null,
    "message_consumption": 1,
    "request_id": "b9e8a1f2-4c60-4b0b-9f51-0c4f2f6c9e7a",
    "status": "approved",
    "receiver": [
      {
        "number": "00218912345678",
        "sent_at": "2024-01-15T10:30:02Z",
        "delivered_at": "2024-01-15T10:30:15Z",
        "status": "delivered",
        "delivery_report": null,
        "provider_id": "0198faa2-8ddd-72c7-afce-32d980bd60fe",
        "consumption": 1,
        "smpp_message_ids": ["4f2a91c0"],
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:15Z"
      }
    ]
  }
]

Response array item fields

FieldTypeDescription
short_messagestringThe message content
message_typestringAlways sms for SMS messages
send_typestringsingle or multiple
contact_group_idstring|nullContact group UUID if applicable
message_consumptionintegerSMS parts consumed for this message
request_idstring|nullThe ingest request this message came from
statusstringApproval status: pending, approved, or rejected
receiverarrayList of receipt objects (one per recipient)

The top-level status is the approval status — whether the message cleared moderation. Per-recipient delivery status lives on each receiver entry.

Receipt object fields

FieldTypeDescription
numberstringRecipient phone number
sent_atstring|nullISO 8601 timestamp when message was sent
delivered_atstring|nullISO 8601 timestamp when message was delivered
statusstringDelivery status for this recipient
delivery_reportstring|nullRaw delivery report if available
provider_idstringUUID of the network operator used
consumptionintegerSMS parts charged for this recipient
smpp_message_idsarray|nullOperator-side message identifiers
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp

Messages still in the queue

Sends are ingested asynchronously, so a message_id returned seconds ago may not have a stored message yet. In that window the endpoint returns a reduced object with an empty receiver array:

[
  {
    "short_message": "Your appointment is confirmed for Tuesday at 4:30 PM.",
    "message_type": "sms",
    "send_type": "single",
    "contact_group_id": null,
    "message_consumption": 1,
    "status": "queued",
    "receiver": []
  }
]
statusMeaning
queuedAccepted and waiting to be processed
processingCurrently being processed
failedIngest failed — balance is refunded

Queued state is retained for 24 hours. After that, a request that was never processed returns 404.

Delivery statuses

Values that can appear in a receipt's status:

StatusDescription
pendingStored, not yet dispatched
queuedQueued for dispatch to the operator
enrouteAccepted by the operator and in transit
acceptedAccepted by the operator
sentHanded to the network
deliveredConfirmed delivery to recipient
scheduledScheduled for later delivery
failedFailed due to a technical issue
rejectedRejected by the network
undeliverableRecipient unreachable
expiredNot delivered before the message's deadline. The charge for this recipient has been refunded — see Message validity
deletedCancelled at the operator
unknownOperator reported an unrecognised state

Error responses

404 Not Found

Returned both when the ID does not exist and when it belongs to another project — the API does not distinguish the two.

{ "message": "Message not found" }

422 Unprocessable Entity — Malformed ID

{
  "message": "The message id field must be a valid UUID.",
  "errors": {
    "message_id": ["The message id field must be a valid UUID."]
  }
}

401 Unauthorized

{ "message": "Invalid or missing token." }

On this page