For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SDKsHelp CenterLog inSign up
    • Overview
  • Getting Started
    • API Mechanics
    • Quickstart
  • Guides
    • Communications API
    • Troubleshooting
    • Events
    • Changelog
  • Comms API Reference
      • Summary
      • POSTSend Messages
      • GETList Messages
      • GETFetch a Message
      • GETFetch a Message Operation
      • GETList Message Operations
      • GETSeek a Message by an Identifier
LogoLogo
SDKsHelp CenterLog inSign up
Comms API ReferenceMessages

Fetch a Message Operation

GET
https://comms.twilio.com/v1/Messages/Operations/:operationId
GET
/v1/Messages/Operations/:operationId
1import { TwilioClient } from "twilio-comms";
2
3async function main() {
4 const client = new TwilioClient({
5 accountId: "YOUR_ACCOUNTID_HERE",
6 authToken: "YOUR_AUTHTOKEN_HERE",
7 });
8 await client.messages.fetchOperation("operationId");
9}
10main();
1{
2 "id": "comms_operation_01h9krwprkeee8fzqspvwy6nq8",
3 "status": "COMPLETED",
4 "stats": {
5 "total": 1,
6 "recipients": 1,
7 "queued": 0,
8 "sent": 0,
9 "scheduled": 0,
10 "delivered": 1,
11 "read": 0,
12 "undelivered": 0,
13 "unaddressable": 0,
14 "failed": 0,
15 "canceled": 0,
16 "attempts": 1
17 },
18 "createdAt": "2024-04-05T06:20:00Z",
19 "updatedAt": "2024-04-05T06:20:00Z"
20}

This operation fetches a single Message Operation using its ID.

Data retention: Records are available for 7 days after creation. Requests for data older than 7 days may return incomplete results.

Was this page helpful?
Previous

List Message Operations

Next
Built with

Authentication

AuthorizationBasic

Basic authentication of the form Basic <account_id:auth_token>.

OR
AuthorizationBasic

Basic authentication of the form Basic <api_key:api_key_secret>.

Path parameters

operationIdstringRequired

Response

OK
idstringformat: "^comms_operation_[0-7][a-hjkmnpqrstv-z0-9]{25,34}"
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.
statusenum
The status of an Operation.
Allowed values:
statsobject

Represents the stats of a sending operation of one or many communications resources, such as Messages and Emails.

  • total is the total number of Messages in the Operation.

    • To get the status for each individual Message, fetch the resource with: GET /Messages/{messageId}.

    • For group communications, where there is more than one recipient per communication resource use Receipts e.g. GET /Messages/{messageId}/Receipts.

  • recipients is the total number of recipients targeted in an Operation.

  • attempts is the total number of sending attempts made by Twilio.

  • unaddressable is the number of recipients to which no sending attempts were made because a valid match could not be found between the available addresses for the recipient (to) and sender (from).

  • scheduled is the number of Messages that are scheduled to be sent by Twilio in the future.

  • queued is the number of Messages that are queued in Twilio for sending.

  • sent is the number of Messages that have been sent by Twilio.

  • delivered is the number of Messages that have been successfully delivered to recipients.

  • read is the number of Messages that have been read by recipients.

  • undelivered is the number of Messages that were successfully sent by Twilio but have not been delivered to the recipient.

  • failed is the number of Messages that failed during processing by Twilio. Get Errors with GET /Messages/Operations/{operationId}/Errors fore more detail.

  • canceled is the number of Messages that were canceled via API request.

createdAtstringformat: "date-time"
updatedAtstringformat: "date-time"

Errors

400
Bad Request Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error