Send a message
Create 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 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
Changed in 10 of the 137 revisions of this API.132621
- ▲
the request's body type/format changed from
object/to/request-body-type-changed
- ●
removed the request property
bodyrequest-property-removed
- ●
removed the request property
custom_variablesrequest-property-removed
- ●
removed the request property
fromrequest-property-removed
- ●
removed the request property
mediarequest-property-removed
- ●
removed the request property
send_as_mmsrequest-property-removed
- ●
removed the request property
status_callbackrequest-property-removed
- ●
removed the request property
torequest-property-removed
- ●
added the new
whatsappenum value to thekind/allOf[Message.MessageKind]/response property for the response status201response-property-enum-value-added
- ○
added
Message.CreateMessageRequestMessage.WhatsAppContentMessageRequestMessage.WhatsAppTemplateMessageRequestto the request bodyanyOflistrequest-body-any-of-added
- ○
removed 'unevaluatedProperties' constraint from the request body
request-body-unevaluated-properties-removed
- ▲
- ▲
added the new required request property
fromnew-required-request-property
- ▲
added the new required request property
tonew-required-request-property
- ▲
removed
Message.CreateMessageRequestMessage.WhatsAppContentMessageRequestMessage.WhatsAppTemplateMessageRequestfrom the request bodyanyOflistrequest-body-any-of-removed
- ▲
the request's body type/format changed from
/toobject/request-body-type-changed
- ▲
added 'unevaluatedProperties' constraint to the request body
request-body-unevaluated-properties-added
- ○
added the new optional request property
bodynew-optional-request-property
- ○
added the new optional request property
custom_variablesnew-optional-request-property
- ○
added the new optional request property
medianew-optional-request-property
- ○
added the new optional request property
send_as_mmsnew-optional-request-property
- ○
added the new optional request property
status_callbacknew-optional-request-property
- ○
removed the
whatsappenum value from thekind/allOf[Message.MessageKind]/response property for the response status201response-property-enum-value-removed
This revision also has 42 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
the request's body type/format changed from
object/to/request-body-type-changed
- ●
removed the request property
bodyrequest-property-removed
- ●
removed the request property
custom_variablesrequest-property-removed
- ●
removed the request property
fromrequest-property-removed
- ●
removed the request property
mediarequest-property-removed
- ●
removed the request property
send_as_mmsrequest-property-removed
- ●
removed the request property
status_callbackrequest-property-removed
- ●
removed the request property
torequest-property-removed
- ●
added the new
whatsappenum value to thekind/allOf[Message.MessageKind]/response property for the response status201response-property-enum-value-added
- ○
added
Message.CreateMessageRequestMessage.WhatsAppContentMessageRequestMessage.WhatsAppTemplateMessageRequestto the request bodyanyOflistrequest-body-any-of-added
- ○
removed 'unevaluatedProperties' constraint from the request body
request-body-unevaluated-properties-removed
- ▲
- ▲
added the new required request property
fromnew-required-request-property
- ▲
added the new required request property
tonew-required-request-property
- ▲
removed
Message.CreateMessageRequestMessage.WhatsAppContentMessageRequestMessage.WhatsAppTemplateMessageRequestfrom the request bodyanyOflistrequest-body-any-of-removed
- ▲
the request's body type/format changed from
/toobject/request-body-type-changed
- ▲
added 'unevaluatedProperties' constraint to the request body
request-body-unevaluated-properties-added
- ○
added the new optional request property
bodynew-optional-request-property
- ○
added the new optional request property
custom_variablesnew-optional-request-property
- ○
added the new optional request property
medianew-optional-request-property
- ○
added the new optional request property
send_as_mmsnew-optional-request-property
- ○
added the new optional request property
status_callbacknew-optional-request-property
- ○
removed the
whatsappenum value from thekind/allOf[Message.MessageKind]/response property for the response status201response-property-enum-value-removed
This revision also has 42 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ▲
the request's body type/format changed from
object/to/request-body-type-changed
- ●
removed the request property
bodyrequest-property-removed
- ●
removed the request property
custom_variablesrequest-property-removed
- ●
removed the request property
fromrequest-property-removed
- ●
removed the request property
mediarequest-property-removed
- ●
removed the request property
send_as_mmsrequest-property-removed
- ●
removed the request property
status_callbackrequest-property-removed
- ●
removed the request property
torequest-property-removed
- ●
added the new
whatsappenum value to thekind/allOf[Message.MessageKind]/response property for the response status201response-property-enum-value-added
- ○
added
Message.CreateMessageRequestMessage.WhatsAppContentMessageRequestMessage.WhatsAppTemplateMessageRequestto the request bodyanyOflistrequest-body-any-of-added
- ○
removed 'unevaluatedProperties' constraint from the request body
request-body-unevaluated-properties-removed
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲
- ○
added the new optional request property
custom_variablesnew-optional-request-property
- ○
- ●
removed the request property
custom_variablesrequest-property-removed
This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ●
- ○
added the new optional request property
custom_variablesnew-optional-request-property
- ○
- ●
removed the request property
custom_variablesrequest-property-removed
This revision also has 3 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ●
- ○
added the new optional request property
custom_variablesnew-optional-request-property
This revision also has 21 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
Of the 137 revisions, 3 have a changelog that could not be searched.