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.
The API token used to authenticate must have the following scope(s) enabled to make a successful request: Messaging.
Destination phone number in E.164 format (+ followed by 5-17 digits). Also accepts passthrough numbers like 988/+988.
Source phone number. Must be a purchased SignalWire phone number on the project in E.164 format, or a shortcode (5-6 digits). Verified caller IDs are not permitted.
Message body text. Required if media is not provided. Subject to provider-specific character limits.
A valid URL to receive message status callback events at each state change. See the Message status callback webhook for the payload your URL will receive.
The unique ID of the message. This is the MessageSegment ID, consistent with the dashboard and the /api/messaging/logs endpoint.
Provider-specific error code if delivery failed. Null when no error occurred.
Human-readable error message if delivery failed. Null when no error occurred.
Relative URL for retrieving the message via the /api/messaging/logs endpoint.
SignalWire Basic Authentication using Project ID and API Token.
The client sends HTTP requests with the Authorization header containing the word Basic followed by a space and a base64-encoded string of project_id:token. The project ID will be used as the username and the API token as the password.
Example: