Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

MessageFeedback Resource


The MessageFeedback subresource of a Message resource represents the reported outcome of tracking the performance of a user action taken by the recipient of the message.

You can use the MessageFeedback subresource to create Message Feedback confirming that the recipient of the associated Message performed a tracked user action.

(information)

Info

For more information on why, when and how to send Message Feedback, see our guide How to Optimize Message Deliverability with Message Feedback. It explains what suitable tracked user actions of message recipients are and how they relate to the Message Insights One-time Password (OTP) Conversion Report.

(information)

Info

Looking for step-by-step instructions on tracking the delivery of your sent messages based on Twilio- and carrier-captured status data? Follow our guide to Tracking the Message Status of Outbound Messages in the programming language of your choice.


MessageFeedback Properties

Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The SID of the Account associated with this MessageFeedback resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

message_sidSID<SM|MM>

The SID of the Message resource associated with this MessageFeedback resource.

Pattern: ^(SM|MM)[0-9a-fA-F]{32}$Min length: 34Max length: 34

outcomeenum<string>

Reported outcome indicating whether there is confirmation that the Message recipient performed a tracked user action. Can be: unconfirmed or confirmed. For more details see How to Optimize Message Deliverability with Message Feedback.

Possible values:
confirmedunconfirmed

date_createdstring<date-time-rfc-2822>

date_updatedstring<date-time-rfc-2822>

The date and time in GMT when this MessageFeedback resource was last updated, specified in RFC 2822 format.


uristring

The URI of the resource, relative to https://api.twilio.com.


Outcome Values

The following are the possible values for the Outcome parameter:

ENUM:OUTCOME possible values in REST API format
confirmedThe recipient of a Message performed a tracked user action and confirmation was reported by creating a MessageFeedback subresource with the outcome set to confirmed. For more details see How to Optimize Message Deliverability with Message Feedback.
unconfirmedThe initial value for a Message created with ProvideFeedback=True. The reported outcome is unconfirmed until a MessageFeedback resource is created with an outcome property of confirmed.

Create a MessageFeedback resource

POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Feedback.json

(warning)

Warning

To track and provide Message Feedback for a Message, you must set the ProvideFeedback parameter to true when you first create the Message. Upon Message creation, the outcome of the Message Feedback will then initially be treated as unconfirmed.

For more information on why, when and how to send Message Feedback, see our guide How to Optimize Message Deliverability with Message Feedback.

You can use this action to create Message Feedback confirming the performance of a tracked user action.

Pass the Outcome parameter with value confirmed to update the Message Feedback once the associated Message was received and the message recipient performed the tracked user action based on the received message.

(information)

Info

Update the Message Feedback even if the Message is received with a delay once the conditions for confirmation are met. This ensures the Messaging Insights are current and message delivery optimizations are based on complete information.

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account associated with the Message resource for which to create MessageFeedback.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

MessageSidSID<SM|MM>required

The SID of the Message resource for which to create MessageFeedback.

Pattern: ^(SM|MM)[0-9a-fA-F]{32}$Min length: 34Max length: 34

Request body parameters

Property nameTypeRequiredPIIDescription
Outcomeenum<string>Optional

The outcome to report. Use confirmed to indicate that the Message recipient performed the tracked user action. Set ProvideFeedback=true when creating a new Message to track Message Feedback. Do not pass unconfirmed as the value of the Outcome parameter, since it is already the initial value for the MessageFeedback of a newly created Message.

Possible values:
confirmedunconfirmed

Create Message Feedback to confirm the performance of the tracked user action

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function createMessageFeedback() {
_18
const feedback = await client
_18
.messages("SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_18
.feedback.create({ outcome: "confirmed" });
_18
_18
console.log(feedback.accountSid);
_18
}
_18
_18
createMessageFeedback();

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
_10
"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
_10
"message_sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"outcome": "confirmed",
_10
"uri": "uri"
_10
}


What's next?

Now that you know how to work with the MessageFeedback resource, you should check out the following:

  • View your reported Message Feedback information in the Console to help you monitor and understand your message deliverability.

Rate this page: