Handle Sinch SMS delivery receipt
curl --request POST \
--url https://your-instance.example.com/api/webhook/sinch/delivery-receipt \
--header 'Content-Type: application/json' \
--data '
{
"batch_id": "01FC66621XXXXX119Z8PMV1QPQ",
"statuses": [
{
"code": 0,
"status": "Delivered",
"count": 1,
"recipients": [
"14165550100"
]
}
]
}
'import requests
url = "https://your-instance.example.com/api/webhook/sinch/delivery-receipt"
payload = {
"batch_id": "01FC66621XXXXX119Z8PMV1QPQ",
"statuses": [
{
"code": 0,
"status": "Delivered",
"count": 1,
"recipients": ["14165550100"]
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
batch_id: '01FC66621XXXXX119Z8PMV1QPQ',
statuses: [{code: 0, status: 'Delivered', count: 1, recipients: ['14165550100']}]
})
};
fetch('https://your-instance.example.com/api/webhook/sinch/delivery-receipt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-instance.example.com/api/webhook/sinch/delivery-receipt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'batch_id' => '01FC66621XXXXX119Z8PMV1QPQ',
'statuses' => [
[
'code' => 0,
'status' => 'Delivered',
'count' => 1,
'recipients' => [
'14165550100'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.example.com/api/webhook/sinch/delivery-receipt"
payload := strings.NewReader("{\n \"batch_id\": \"01FC66621XXXXX119Z8PMV1QPQ\",\n \"statuses\": [\n {\n \"code\": 0,\n \"status\": \"Delivered\",\n \"count\": 1,\n \"recipients\": [\n \"14165550100\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-instance.example.com/api/webhook/sinch/delivery-receipt")
.header("Content-Type", "application/json")
.body("{\n \"batch_id\": \"01FC66621XXXXX119Z8PMV1QPQ\",\n \"statuses\": [\n {\n \"code\": 0,\n \"status\": \"Delivered\",\n \"count\": 1,\n \"recipients\": [\n \"14165550100\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/webhook/sinch/delivery-receipt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"batch_id\": \"01FC66621XXXXX119Z8PMV1QPQ\",\n \"statuses\": [\n {\n \"code\": 0,\n \"status\": \"Delivered\",\n \"count\": 1,\n \"recipients\": [\n \"14165550100\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Delivery receipt received",
"batch_id": "01K608PQBF3H41EQS64AH7CE11"
}{
"error": "Webhook processing failed"
}Webhooks
Handle Sinch SMS delivery receipt
Status callback posted by Sinch for outbound SMS batches. Updates the matching Message documents with the latest delivery state (Delivered / Failed / Expired) and broadcasts a socket event so the org’s connected clients see the new status.
POST
/
api
/
webhook
/
sinch
/
delivery-receipt
Handle Sinch SMS delivery receipt
curl --request POST \
--url https://your-instance.example.com/api/webhook/sinch/delivery-receipt \
--header 'Content-Type: application/json' \
--data '
{
"batch_id": "01FC66621XXXXX119Z8PMV1QPQ",
"statuses": [
{
"code": 0,
"status": "Delivered",
"count": 1,
"recipients": [
"14165550100"
]
}
]
}
'import requests
url = "https://your-instance.example.com/api/webhook/sinch/delivery-receipt"
payload = {
"batch_id": "01FC66621XXXXX119Z8PMV1QPQ",
"statuses": [
{
"code": 0,
"status": "Delivered",
"count": 1,
"recipients": ["14165550100"]
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
batch_id: '01FC66621XXXXX119Z8PMV1QPQ',
statuses: [{code: 0, status: 'Delivered', count: 1, recipients: ['14165550100']}]
})
};
fetch('https://your-instance.example.com/api/webhook/sinch/delivery-receipt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-instance.example.com/api/webhook/sinch/delivery-receipt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'batch_id' => '01FC66621XXXXX119Z8PMV1QPQ',
'statuses' => [
[
'code' => 0,
'status' => 'Delivered',
'count' => 1,
'recipients' => [
'14165550100'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.example.com/api/webhook/sinch/delivery-receipt"
payload := strings.NewReader("{\n \"batch_id\": \"01FC66621XXXXX119Z8PMV1QPQ\",\n \"statuses\": [\n {\n \"code\": 0,\n \"status\": \"Delivered\",\n \"count\": 1,\n \"recipients\": [\n \"14165550100\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-instance.example.com/api/webhook/sinch/delivery-receipt")
.header("Content-Type", "application/json")
.body("{\n \"batch_id\": \"01FC66621XXXXX119Z8PMV1QPQ\",\n \"statuses\": [\n {\n \"code\": 0,\n \"status\": \"Delivered\",\n \"count\": 1,\n \"recipients\": [\n \"14165550100\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/webhook/sinch/delivery-receipt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"batch_id\": \"01FC66621XXXXX119Z8PMV1QPQ\",\n \"statuses\": [\n {\n \"code\": 0,\n \"status\": \"Delivered\",\n \"count\": 1,\n \"recipients\": [\n \"14165550100\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "Delivery receipt received",
"batch_id": "01K608PQBF3H41EQS64AH7CE11"
}{
"error": "Webhook processing failed"
}Body
application/json
⌘I