Send a message
Changed onCreate and queue an outbound message for delivery. The channel is determined by the from number:
- SMS/MMS when from is a purchased SignalWire phone number or shortcode. The message is MMS when media is present or send_as_mms is set, otherwise SMS.
- WhatsApp when from is a whatsapp:-prefixed WhatsApp number. Set message_type for a content message, or template_id for an approved template. Free-form WhatsApp content is only allowed within the 24-hour customer service window.
Use this SignalWire REST operation for JSON requests. Integrations built around form-encoded requests and Message SIDs can use the Compatibility API's Create message operation instead.
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.
Request
- Base URLhttps://{Your_Space_Name}.signalwire.com
- URLhttps://{Your_Space_Name}.signalwire.com/api/messaging/messages
- AuthHTTP basic
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"
}Changes
- breaking
the request's body type changed from
objectto no type - warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
added the new
whatsappenum value to the////response property for the response status - info
added to the request body
anyOflist - info
removed 'unevaluatedProperties' constraint from the request body
- breaking
- breaking
added the new required request property
- breaking
added the new required request property
- breaking
removed from the request body
anyOflist - breaking
the request's body type changed from no type to
object - breaking
added 'unevaluatedProperties' constraint to the request body
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
removed the
whatsappenum value from the////response property for the response status
- breaking
Some revisions have not been checked yet.