messageFailed
Required token scopes:
Create scenariosManage scenarios on behalf of user
Subscribe
Send the body below to Import Subscription. You only need to change:url(required) - Located underdata.actions[0].params.url. Replace{{yourWebhookURL}}with the destination URL that should receive the events.asStatus- Keep"active"to enable the subscription immediately, or"inactive"to save it as an inactive revision.
Import body
A
201 response returns your new subscription - save its _id to manage it later. You can also add an optional authorUid root field (a Texter user UID) to attribute the subscription to a specific user.Payload
When the event fires, your URL receives an HTTPPOST with eventName: "messageFailed" and the following eventData:
Chat
The chat associated with the message, excluding
crmData and previousBotSession. See the Chat object for the remaining fields.string | null
The Texter message
_id matched to externalId[0]. This is the same messageId returned by Send Template Message. Returns null when no match is found among the latest 5 outgoing messages.string
The error message or code received from the provider.
number
When the failure occurred (Unix epoch milliseconds).
string[]
Unique IDs assigned to the message(s) by the external provider (e.g. WhatsApp
wamid...).Example payload
How to identify the message
UsemessageId to match this event to the messageId returned by Send Template Message.
The subscription searches the latest 5 outgoing messages in the chat. It selects the message whose channelInfo.id equals the first value in externalId. If no match exists, messageId is null; the status webhook is still sent.
externalId keeps all provider IDs from the event. The single messageId identifies only externalId[0]. For older messages or additional IDs, use Get Messages of a Chat, page through the results, and match each channelInfo.id.
Existing subscriptions keep their saved scenario. Update your subscription to use this template before expecting the
messageId field and the chat-field omissions.