Handle inbound MMS webhook (Sinch)
curl --request POST \
--url https://your-instance.example.com/api/webhook/mms \
--header 'Content-Type: application/json' \
--data '
{
"id": "01K608PMMS001H41EQS64AH7CE",
"origin": "MMS_MO",
"from": "+14165550100",
"to": "+12362320246",
"body": "Photo of the issue",
"media": [
{
"url": "https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg",
"content_type": "image/jpeg",
"size": 184221
}
]
}
'import requests
url = "https://your-instance.example.com/api/webhook/mms"
payload = {
"id": "01K608PMMS001H41EQS64AH7CE",
"origin": "MMS_MO",
"from": "+14165550100",
"to": "+12362320246",
"body": "Photo of the issue",
"media": [
{
"url": "https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg",
"content_type": "image/jpeg",
"size": 184221
}
]
}
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({
id: '01K608PMMS001H41EQS64AH7CE',
origin: 'MMS_MO',
from: '+14165550100',
to: '+12362320246',
body: JSON.stringify('Photo of the issue'),
media: [
{
url: 'https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg',
content_type: 'image/jpeg',
size: 184221
}
]
})
};
fetch('https://your-instance.example.com/api/webhook/mms', 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/mms",
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([
'id' => '01K608PMMS001H41EQS64AH7CE',
'origin' => 'MMS_MO',
'from' => '+14165550100',
'to' => '+12362320246',
'body' => 'Photo of the issue',
'media' => [
[
'url' => 'https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg',
'content_type' => 'image/jpeg',
'size' => 184221
]
]
]),
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/mms"
payload := strings.NewReader("{\n \"id\": \"01K608PMMS001H41EQS64AH7CE\",\n \"origin\": \"MMS_MO\",\n \"from\": \"+14165550100\",\n \"to\": \"+12362320246\",\n \"body\": \"Photo of the issue\",\n \"media\": [\n {\n \"url\": \"https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184221\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/mms")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"01K608PMMS001H41EQS64AH7CE\",\n \"origin\": \"MMS_MO\",\n \"from\": \"+14165550100\",\n \"to\": \"+12362320246\",\n \"body\": \"Photo of the issue\",\n \"media\": [\n {\n \"url\": \"https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184221\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/webhook/mms")
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 \"id\": \"01K608PMMS001H41EQS64AH7CE\",\n \"origin\": \"MMS_MO\",\n \"from\": \"+14165550100\",\n \"to\": \"+12362320246\",\n \"body\": \"Photo of the issue\",\n \"media\": [\n {\n \"url\": \"https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184221\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "MMS MO webhook received",
"messageId": "01K608PMMS001H41EQS64AH7CE"
}{
"error": "Webhook processing failed"
}Webhooks
Handle inbound MMS webhook (Sinch)
Inbound webhook called by the Sinch MMS JSON API when an MMS is delivered to a Tether-provisioned number. Acknowledges within 10 seconds and processes asynchronously: media is downloaded and re-uploaded to R2, then the message is appended to the contact’s conversation.
POST
/
api
/
webhook
/
mms
Handle inbound MMS webhook (Sinch)
curl --request POST \
--url https://your-instance.example.com/api/webhook/mms \
--header 'Content-Type: application/json' \
--data '
{
"id": "01K608PMMS001H41EQS64AH7CE",
"origin": "MMS_MO",
"from": "+14165550100",
"to": "+12362320246",
"body": "Photo of the issue",
"media": [
{
"url": "https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg",
"content_type": "image/jpeg",
"size": 184221
}
]
}
'import requests
url = "https://your-instance.example.com/api/webhook/mms"
payload = {
"id": "01K608PMMS001H41EQS64AH7CE",
"origin": "MMS_MO",
"from": "+14165550100",
"to": "+12362320246",
"body": "Photo of the issue",
"media": [
{
"url": "https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg",
"content_type": "image/jpeg",
"size": 184221
}
]
}
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({
id: '01K608PMMS001H41EQS64AH7CE',
origin: 'MMS_MO',
from: '+14165550100',
to: '+12362320246',
body: JSON.stringify('Photo of the issue'),
media: [
{
url: 'https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg',
content_type: 'image/jpeg',
size: 184221
}
]
})
};
fetch('https://your-instance.example.com/api/webhook/mms', 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/mms",
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([
'id' => '01K608PMMS001H41EQS64AH7CE',
'origin' => 'MMS_MO',
'from' => '+14165550100',
'to' => '+12362320246',
'body' => 'Photo of the issue',
'media' => [
[
'url' => 'https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg',
'content_type' => 'image/jpeg',
'size' => 184221
]
]
]),
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/mms"
payload := strings.NewReader("{\n \"id\": \"01K608PMMS001H41EQS64AH7CE\",\n \"origin\": \"MMS_MO\",\n \"from\": \"+14165550100\",\n \"to\": \"+12362320246\",\n \"body\": \"Photo of the issue\",\n \"media\": [\n {\n \"url\": \"https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184221\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/mms")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"01K608PMMS001H41EQS64AH7CE\",\n \"origin\": \"MMS_MO\",\n \"from\": \"+14165550100\",\n \"to\": \"+12362320246\",\n \"body\": \"Photo of the issue\",\n \"media\": [\n {\n \"url\": \"https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184221\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/webhook/mms")
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 \"id\": \"01K608PMMS001H41EQS64AH7CE\",\n \"origin\": \"MMS_MO\",\n \"from\": \"+14165550100\",\n \"to\": \"+12362320246\",\n \"body\": \"Photo of the issue\",\n \"media\": [\n {\n \"url\": \"https://sinch-mms.s3.amazonaws.com/media/12345/image1.jpg\",\n \"content_type\": \"image/jpeg\",\n \"size\": 184221\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "MMS MO webhook received",
"messageId": "01K608PMMS001H41EQS64AH7CE"
}{
"error": "Webhook processing failed"
}Body
application/json
Sinch-assigned MMS message id; echoed back in the ack for log correlation.
Sinch traffic direction marker — MMS_MO for inbound (mobile-originated) MMS.
Sender phone number in E.164.
Tether-provisioned recipient number that received the MMS.
Optional text content sent alongside the media.
Attached media items. Each is downloaded from Sinch and re-uploaded to R2 before persistence.
Show child attributes
Show child attributes
⌘I