Before you begin, ensure you have the following:
The API uses basic authentication, just like our existing APIs. To authenticate, include the Basic Authentication header whose username:password pair is one of the following:
For this Private Beta release, the base URI for this API is https://comms.twilio.com/preview/. The API accepts JSON requests and returns JSON responses.
Now that you’re authenticated, let’s send your first message.
You can deliver the same message to up to 10,000 recipients in a single API request by adding more entries to the to array.
channelWhen describing who you are sending to, the possible values are:
WHATSAPPPHONE: The phone represents the text messaging app on a user’s device. This is the same identifier for both RCS and SMS/MMS messages.When describing what numbers and addresses you are sending from, we split RCS and SMS, so that it is possible to specify when you want to use RCS, text message, or both. The possible values in those scenarios are:
SMSRCSWHATSAPPSee the Messages API reference for more details.
After sending a message, especially to many recipients, retrieving the operation lets you monitor and manage the outcome, providing transparency and control over message delivery.
When you send a message with the Create Message endpoint, the response headers include an operationId. Use this value to track the delivery status of the message by sending a GET request to the Operations endpoint.
Request sample:
Sample response:
For more details, see the Fetch a Message Operation API reference.