Messages resource
A Message resource represents a message sent or received through the Twilio Bulk Messaging API. You can send messages to up to 10,000 recipients in a single API request across SMS, MMS, RCS, and WhatsApp channels.
When you send messages, the API responds with a 202 Accepted status code and an operationId header. Use the Operations resource to track the status of your request.
A reference to a Message.
comms_message_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_message_[0-7][a-hjkmnpqrstv-z0-9]{25,34}The list of recipient(s) that the Message was directed to.
- This list is always of size 1, except for Group Messaging usage, where the number of recipients plus the sender will match the group size.
The status of a Message. The status can be one of the following:
-
SCHEDULEDTheMessageis scheduled to be sent by Twilio in the future. -
QUEUEDTheMessageis queued in Twilio for sending. -
SENTTheMessagehas been sent by Twilio. -
DELIVEREDTheMessagehas been successfully delivered to the recipient. -
READTheMessagehas been read by the recipient. -
UNDELIVEREDTheMessagewas successfully sent by Twilio but have not been delivered to the recipient. -
FAILEDTheMessageprocessing failed inside Twilio. UseGET /Messages/Operations/{operationId}/Errorsfor more details. -
CANCELEDTheMessagewas canceled via API request. -
GROUPTheMessageis part of a group communication. To get the status for each Recipient of the group communication, use theReceiptsendpoint e.g. GET/Messages/comms_message_01h2xcejqtf2nbrexx3vqjhp41/Receipts -
INBOUNDTheMessagewas received by Twilio from an external source.
QUEUEDSENTSCHEDULEDDELIVEREDREADFAILEDUNDELIVEREDCANCELEDGROUPINBOUNDA list of resources that are associated with the Message.
Custom metadata in the form of key-value pairs. Maximum size of a tag key is 128 characters. Maximum size of a tag value is 256 characters. There can be a maximum of 10 key-value pairs.
This field can be templated with Liquid.
Specify variables with each recipient for personalization.
10The scheduled send time of the Message.
This field is only present if the Message was created with a schedule.
POST https://comms.twilio.com/v1/Messages
Create and send messages to the specified recipients.
The API responds with a 202 Accepted status code and an empty response body. The response headers include an operationId, which you can use to check the status of your request with the Operations resource.
application/jsonAn array of recipient objects to send the Message(s) to.
1Max items: 10000The content of the Message.
-
Use the Liquid templating language for personalization in any text-based field.
-
When using a templated content, use the
variablesfield on each recipient to specify the values to substitute. -
For each variable you specify in your template, you should have a matching key in each recipient's
variablesobject. -
When targeting
AudienceorProfilerecipients, you may specifyvariableswith values that reference stored traits on theProfile-- for example:${Twilio.Profile.firstName}or${Twilio.Profile.myCustomField}.
A schedule defines when a communication will be sent to a recipient.
1Custom metadata in the form of key-value pairs. Maximum size of a tag key is 128 characters. Maximum size of a tag value is 256 characters. There can be a maximum of 10 key-value pairs.
This field can be templated with Liquid.
Specify variables with each recipient for personalization.
10The request was accepted and an Operation was created to track its progress. The response body contains the ID and link to the Operation resource.
Optional
The Operation ID is an identifier that can be used to correlate all of the resources created in a request.
Issue a GET request to the resource list location, using the Operation ID as a query parameter to retrieve the resources that correlate with the Operation.
comms_operation_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_operation_[0-7][a-hjkmnpqrstv-z0-9]{25,34}Optional
The location (uri) of the Operation resource identified by operationId.
1import { TwilioClient } from "twilio-comms";23async function main() {4const client = new TwilioClient({5accountId: "TWILIO_ACCOUNT_SID",6authToken: "TWILIO_AUTH_TOKEN",7});8await client.messages.send({9to: [10{11address: "+12065558844",12channel: "PHONE",13},14],15content: {16text: "Hello, World!",17},18from: {19address: "+14153901002",20channel: "SMS",21},22});23}24main();
GET https://comms.twilio.com/v1/Messages/{messageId}
Retrieve a Message by its identifier. The response includes full details about the sender, recipients, delivery status, message content, and all delivery attempts.
comms_message_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_message_[0-7][a-hjkmnpqrstv-z0-9]{25,34}OK
Optional
A reference to a Message.
comms_message_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_message_[0-7][a-hjkmnpqrstv-z0-9]{25,34}Optional
The sender of the Message.
Optional
The list of recipient(s) that the Message was directed to.
- This list is always of size 1, except for Group Messaging usage, where the number of recipients plus the sender will match the group size.
Optional
The status of a Message. The status can be one of the following:
-
SCHEDULEDTheMessageis scheduled to be sent by Twilio in the future. -
QUEUEDTheMessageis queued in Twilio for sending. -
SENTTheMessagehas been sent by Twilio. -
DELIVEREDTheMessagehas been successfully delivered to the recipient. -
READTheMessagehas been read by the recipient. -
UNDELIVEREDTheMessagewas successfully sent by Twilio but have not been delivered to the recipient. -
FAILEDTheMessageprocessing failed inside Twilio. UseGET /Messages/Operations/{operationId}/Errorsfor more details. -
CANCELEDTheMessagewas canceled via API request. -
GROUPTheMessageis part of a group communication. To get the status for each Recipient of the group communication, use theReceiptsendpoint e.g. GET/Messages/comms_message_01h2xcejqtf2nbrexx3vqjhp41/Receipts -
INBOUNDTheMessagewas received by Twilio from an external source.
QUEUEDSENTSCHEDULEDDELIVEREDREADFAILEDUNDELIVEREDCANCELEDGROUPINBOUNDOptional
A list of resources that are associated with the Message.
Optional
Custom metadata in the form of key-value pairs. Maximum size of a tag key is 128 characters. Maximum size of a tag value is 256 characters. There can be a maximum of 10 key-value pairs.
This field can be templated with Liquid.
Specify variables with each recipient for personalization.
10Optional
The date and time when the entity was created.
Optional
The date and time when the entity was last updated.
Optional
The scheduled send time of the Message.
This field is only present if the Message was created with a schedule.
Optional
The resolved content of the Message.
Optional
The list of attempts Twilio executed to process the Message.
GET https://comms.twilio.com/v1/Messages
Retrieve a list of Messages. Use query parameters to filter results by operation, channel, status, date range, and more.
Filter Messages by Operation ID.
comms_operation_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_operation_[0-7][a-hjkmnpqrstv-z0-9]{25,34}Filter Messages by Session ID.
comms_session_01h9krwprkeee8fzqspvwy6nq8Pattern: ^comms_session_[a-hjkmnpqrstv-z0-9]{26,34}Filter to Messages created after the specified date and time in ISO 8601 format. The date is in RFC3339 format. (e.g., 2025-06-18T12:00:00Z)
Filter to Messages created before the specified date and time in ISO 8601 format. The date is in RFC3339 format and must be greater than startDate if provided. (e.g., 2025-06-18T12:00:00Z)
Filter Messages sent or received by Profile ID.
mem_profile_01h9krwprkeee8fzqspvwy6nq8Pattern: ^mem_profile_[0-7][a-hjkmnpqrstv-z0-9]{25,34}Filter Messages by channel.
SMSPossible values: SMSRCSWHATSAPPFilter Messages by Delivery Status.
QUEUEDSENTSCHEDULEDDELIVEREDREADFAILEDUNDELIVEREDCANCELEDGROUPINBOUNDMatch messages by one or many tags. If more than one tag is specified in the query, the search will return messages that have all the tags.
For Example: GET /Messages?tags=region:EMEA;campaign:BUY_STUFF;
key_1:value;key_2:value;Pattern: ^(?:[a-zA-Z0-9._~-]+:[a-zA-Z0-9._~-]+;){1,10}$The number of resources to return in a page.
50Example: 50Minimum: 1Maximum: 1000OK
Optional
A list of Messages.
Optional
Metadata for paginated results. This object contains two tokens to navigate through paginated results.
- Use
nextto retrieve the 'next' page in the result list. - Use
selfto retrieve the same page of the result list again. - Supply the token in the
pageTokenquery param.
1import { TwilioClient } from "twilio-comms";23async function main() {4const client = new TwilioClient({5accountId: "TWILIO_ACCOUNT_SID",6authToken: "TWILIO_AUTH_TOKEN",7});8await client.messages.list({9operationId: "comms_operation_01h9krwprkeee8fzqspvwy6nq8",10sessionId: "comms_session_01h9krwprkeee8fzqspvwy6nq8",11startDate: new Date("2024-01-15T09:30:00Z"),12endDate: new Date("2024-01-15T09:30:00Z"),13profile: "mem_profile_01h9krwprkeee8fzqspvwy6nq8",14channel: "SMS",15status: "QUEUED",16tags: "key_1:value;key_2:value;",17pageToken: "pageToken",18pageSize: 50,19});20}21main();