2, 4, and 5.
The messageStatus field contains one of:
Event name:
messageDeliveredOrFailed
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: "messageDeliveredOrFailed" 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.number
The new status - see the status codes table above.
string | null
Error message - only present when status is
4 or 5, otherwise null.number
When the status changed (Unix epoch milliseconds).
string[]
Unique IDs assigned to the message(s) by the external provider.
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.