Skip to content
SMSRay

Messages

Look up any message you sent with this key. Use it for support tools and reconciliation; use webhooks for real-time updates.

GET/sms/messages/:id
https://api.smsray.in/api/sms/v1/sms/messages/:id

Fetch the current state of a message sent with this API key: status, encoding, segments, cost and timestamps.

Request

Headers

Retrieve a message request headers
NameTypeRequiredRules
x-api-keystringrequiredYour secret key, ls_live_ followed by 48 hex characters.

Path parameters

Retrieve a message path parameters
NameTypeRequiredRules
idstring (uuid)requiredThe messageId returned by /sms/send or /sms/otp/send.

Example request

curl https://api.smsray.in/api/sms/v1/sms/messages/2b1f6c1e-8d4f-4c55-9a51-0d2b0b7f3a11 \
  -H "x-api-key: $SMSRAY_API_KEY"

Response

200

200 application/json
{
  "_id": "2b1f6c1e-8d4f-4c55-9a51-0d2b0b7f3a11",
  "to": "9779801234567",
  "from": "SMSRay",
  "text": "Your order #1042 has shipped.",
  "type": "transactional",
  "encoding": "GSM7",
  "segments": 1,
  "cost": 1.0,
  "status": "delivered",
  "route": "device",
  "error": "",
  "attempts": 1,
  "submittedAt": "2026-10-10T04:15:01.000Z",
  "sentAt": "2026-10-10T04:15:03.000Z",
  "deliveredAt": "2026-10-10T04:15:07.000Z",
  "failedAt": null,
  "createdAt": "2026-10-10T04:15:00.000Z",
  "updatedAt": "2026-10-10T04:15:07.000Z"
}

404Unknown id

404 application/json
{ "error": "Message not found", "code": "not_found" }

Response fields

Retrieve a message response fields
NameTypeRequiredRules
statusstringrequiredqueued, submitting, submitted, sent, delivered, undelivered, failed or rejected.
textstringrequiredThe message body, or (OTP hidden) for messages created by /sms/otp/send.
routestring | nullrequiredThe route that carried the message (for example device), or null before routing.
attemptsintegerrequiredHow many route attempts were made.
errorstringrequiredFailure reason when one is known, otherwise empty.
dlrobjectoptionalCarrier delivery receipt { status, code, raw, at }, present only when a carrier receipt exists.
submittedAt · sentAt · deliveredAt · failedAtstring | nullrequiredISO 8601 UTC timestamps for each transition.

Errors

Every error uses the same shape: { "error", "code", "details"? }. Branch on code, not on the message.

Retrieve a message errors
HTTPcodeWhen
401unauthorizedThe x-api-key header is missing ("Missing x-api-key") or the key is unknown ("Invalid API key").
403client_disabledThe API client that owns this key has been disabled in the dashboard.
404not_foundNo message with this id was sent by this API key. Messages from other keys — even in the same workspace — are not visible.
429rate_limitedYou exceeded your per-client request rate (default 20 requests per second). Honour Retry-After.
500server_errorSomething went wrong on our side. The body never contains a stack trace.

Notes

  • Polling works, but webhooks are cheaper and faster. If you poll, back off (for example 2 s, 5 s, 15 s, 60 s) and stop at a final status: delivered, undelivered, failed or rejected.
  • Pool internals such as the SIM, device and carrier IDs are never returned.