SMS error codes are sent at each stage of the delivery process. Depending on the message_state returned, an accompanying error_code may be given. That is, if delivery is unsuccessful when we tried to deliver the SMS to the carrier, the message_state would update from “queued” directly to “failed” and an accompanying error_code will be given. If the message has been successfully sent to the carrier, it can still hit roadblocks that can cause the SMS to fail. In this scenario, the message_state would change from “queued” to “sent”, then to either “undelivered”, which will also be accompanied by an error_code. In essence, SMS error codes can help you supplement your diagnosis of the delivery issues. Below is an illustration of the delivery success path and the message_states that can occur.

Click here for the comprehensive list Plivo error codes returned by Plivo for outgoing and incoming messages.