Send a message
Authentication
Request
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.
Your own key/value string pairs to attach to the message — for example, an order or case number you want to recognize later. When you also set status_callback, SignalWire includes these pairs as a custom_variables object in every status callback it sends to that URL, so you can match each callback to a record in your own system. If you don’t set status_callback, there is nowhere for the variables to be delivered.
Each value must be a non-empty string of at most 1024 bytes. You can send at most 20 pairs. Each key must start with a letter or underscore and contain only letters, numbers, and underscores, and cannot begin with the reserved prefixes signalwire_, sw_, rtc_, or internal_ (case-insensitive). Keys are case-sensitive.
Response
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.