Skip to content

Incoming Message Webhook

Webhooks

SMS

When a switch has been configured to use an HTTP webhook, incoming SMS messages will be delivered to it. Webhooks only include authentication details if the switch has been configured to use it.

The endpoint should respond with a 200-level HTTP success status code.

SMS Webhook Schema

NameTypeDescription
bodyStringThe content of the SMS message.
fromStringThe originating number for the SMS.
idString(format:ulid)The assigned ID for the SMS request.
timestampString(format:date-time)ISO 8601 timestamp indicating when the SMS was first received by the SMS system.
toStringThe destination number for the SMS.
typeEnum:StringThe type of webhook event. Always sms for this schema.

SMS Webhook Example

Swift’s request:

POST https://example.com/sms_webhook
Content-Type: application/json
Content-Length: 177
{
"body": "Hello, World",
"from": "12003004000",
"id": "01JDQ0MDBE0YMVD9E96EGRCCV4",
"timestamp": "2024-06-14T00:00:00.000000Z",
"to": "12003004001",
"type": "sms"
}

User’s endpoint response:

HTTP/1.1 204

MMS

When a switch has been configured to use an HTTP webhook, incoming MMS messages will be delivered to it. Webhooks only include Authorization details if the switch has been configured to use it.

The endpoint should respond with a 200-level HTTP success status code.

MMS Webhook Schema

NameTypeDescription
dataMMS PartContains part of the content of the MMS message.
fromStringThe originating number for the MMS.
idStringThe unique identifier for the MMS message.
timestampString(format:date-time)ISO 8601 timestamp indicating when the MMS was created.
toStringThe destination number for the MMS.
typeEnum:StringThe type of webhook event. Always mms for this schema.

MMS Webhook Example

Swift’s request:

POST /mms_webhook HTTP/1.1
Content-Type: application/json
Content-Length: 314
{
"data": {
"body": "Hello, World",
"encoding": "identity",
"headers": {
"*": "string"
},
"is_multipart": true,
"parts": [
{}
]
},
"from": "string",
"id": "01JDP0GJEGZZC1ZNCA3YJ662HN",
"timestamp": "2024-06-14T00:00:00.000000Z",
"to": "string",
"type": "mms"
}

User’s endpoint response:

HTTP/1.1 204