Skip to content

[Docs Update] Add error_code and error_message to api/messaging/logs response #255

@cassieemb

Description

@cassieemb

Request Kind

We would like to update the serialized body in the api/messaging/logs endpoint.
https://signalwire.com/docs/apis/rest/message-logs/get-message-log
https://signalwire.com/docs/apis/rest/message-logs/list-message-logs

What changed?

We added two new params to the body - error_message, and error_code. These are null unless the message failed and was marked with an error code and error message.

Note

Some RELAY messages may have an error_message, but not an error_code. The error_code is a newer pattern that is not used in all RELAY areas.

Why?

This information is available in the LaML API, but not this endpoint, which is the only way for RELAY messages to be viewed. We want to give our customers easy visibility into their messages, and transparency about what went wrong.

Examples

LaML Message
LaML codes/messages will use the error schema documented in https://signalwire.com/docs/compatibility-api/rest/error-codes

        {
            "id": "25ea0d36-ad38-4e8c-aefd-ac16f6ff2604",
            "from": "+12223334444",
            "to": "+12224443333",
            "status": "failed",
            "direction": "outbound-api",
            "kind": "sms",
            "source": "laml",
            "type": "laml_message",
            "url": "https://YOURSPACE.signalwire.com/api/laml/2010-04-01/Accounts/d18764c8-a5f4-43ad-a2bc-716f878345ac/Messages/25ea0d36-ad38-4e8c-aefd-ac16f6ff2604",
            "number_of_segments": 1,
            "charge": 0.0,
            "created_at": "2025-06-02T16:51:13.277Z",
            "error_message": "From number is not a SMS-capable phone number.",
            "error_code": "21601",
            "charge_details": []
        },

Relay Message

        {
            "id": "6680e46f-ef5e-43ff-9308-eb46ef13ee97",
            "from": "+12223334444",
            "to": "+12224443333",
            "status": "failed",
            "direction": "outbound",
            "kind": "sms",
            "source": "realtime_api",
            "type": "relay_message",
            "url": null,
            "number_of_segments": 1,
            "charge": 0.00955,
            "created_at": "2025-07-01T18:02:24.553Z",
            "error_message": "Unable to deliver message to carrier.",
            "error_code": null,
            "charge_details": [
                {
                    "description": "Outbound SMS",
                    "charge": 0.0065
                },
                {
                    "description": "SMS Outbound Carrier Fee",
                    "charge": 0.00305
                }
            ]
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions