Prompt
I'm building an app and need SMS delivery receipts and error codes
Latest observation
Oct 27, 2026
OpenAI APIWeb search: off
To get SMS delivery receipts and error codes, you typically need an SMS provider that supports webhooks/callbacks for message status updates.
What you need
- Delivery receipts (DLRs): status updates like
queued,sent,delivered,failed,undelivered - Error codes: provider-specific or carrier-specific failure reasons
- Webhook endpoint: your app receives status callbacks from the SMS provider
- Message ID correlation: store the provider’s message ID so you can match receipts to messages
Common statuses
accepted/queued— provider received the messagesent— handed off to carrierdelivered— handset confirmed delivery (when available)failed/undelivered— message could not be delivered
Error code examples
These vary by provider, but often include:
- invalid number
- unreachable destination
- blocked by carrier
- throttled / rate limited
- expired message
- spam/suspicious content
If you use Twilio
Twilio supports:
- Status callbacks for delivery receipts
- Error codes on failed message records
- Message fields like
status,error_code, anderror_message
If you use Vonage / MessageBird / AWS SNS / Plivo
They also support similar webhook-based delivery reports, though the exact fields and codes differ.
Recommended implementation
- Send SMS through provider API
- Save returned message SID/ID in your DB
- Register a webhook for delivery status
- Update message record when webhook arrives
- Map provider error codes into app-friendly reasons
Example webhook flow
- Send message → get
message_id - Provider calls your webhook:
{ message_id: "...", status: "delivered" }- or
{ message_id: "...", status: "failed", error_code: "1234" }
- Your app updates the message record
If you want, I can give you:
- a provider comparison for delivery receipts and error codes, or
- a sample webhook implementation in Node.js, Python, or PHP.