Messages
Send a message
Create and queue an outbound SMS or MMS message for delivery. The system determines whether the message is SMS or MMS based on the presence of media or the send_as_mms flag. The from number must be a purchased SignalWire phone number on the authenticated project.
Permissions
The API token used to authenticate must have the following scope(s) enabled to make a successful request: Messaging.
Learn more about API scopes.
post/api/messaging/messages
Request body
Example request
{
"to": "+15551234567",
"from": "+15559876543",
"body": "Your order #12345 has shipped!",
"media": [
"https://example.com/tracking.png"
],
"status_callback": "https://example.com/webhooks/message-status",
"custom_variables": {
"id": "12345",
"case_number": "54321"
}
}Response
Response returned when a message is successfully created and queued for delivery.
Example response
{
"from": "+15559876543",
"to": "+15551234567",
"body": "Your order #12345 has shipped!",
"media": [],
"number_of_segments": 1,
"created_at": "2024-05-06T12:20:00Z",
"message_uri": "/api/messaging/logs/c2d3e4f5-a6b7-8901-cdef-234567890abc"
}