Webhooks
Handle Sinch SMS delivery receipt
Status callback posted by Sinch for outbound SMS batches. An SMS stored as a conversation Message carries that Message id as client_reference when it goes out through Sinch (on each batch of a send split for media). Each status is applied to the one Message it is about, and a socket event is broadcast so the org's connected clients see the new status. The Message is found by client_reference when it names a Message of the batch, then by batch_id when one Message has it, then by batch_id and recipient (matched through the contact's phone). A report that still matches more than one Message is logged and skipped, and a report without batch_id is ignored.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
A Sinch SMS delivery report. Batch reports (delivery_report_sms, summary or full) carry statuses; full reports list recipients on each status. Per-recipient reports (recipient_delivery_report_sms) are flat and carry recipient, status and code instead. Either kind may carry client_reference: when it is the id of a Message of this batch, and the report covers one message and one recipient, that Message is updated. Other fields are accepted as sent.
Response Body
application/json
application/json
curl -X POST "https://example.com/api/webhook/sinch/delivery-receipt" \ -H "Content-Type: application/json" \ -d '{ "batch_id": "01FC66621XXXXX119Z8PMV1QPQ", "statuses": [ { "code": 0, "status": "Delivered", "count": 1, "recipients": [ "14165550100" ] } ] }'{ "message": "Delivery receipt received", "batch_id": "01K608PQBF3H41EQS64AH7CE11"}