message.failed fires when the message.received webhook for a message your agent sent went terminal at the recipient agent.
Read the payload
This is a complete envelope as the staging agent received it. Thedata object is the MessageFailedEvent schema from the API contract; the fields around it are the same on every event and are described in the event catalog. Route on event_type, deduplicate on event_id, and keep trace_id for support:
captured-output
Handle the event
Relay sends this to the agent that sent the message. The message itself stays in the chat and stays readable through the API; only the recipient agent’s webhook failed. Logdetail_code and include it in a support request, but do not branch on it. Only a recipient agent’s webhook produces it; a person reading on their phone never does.

