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.
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.
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.
The SID of the Account associated with this MessageFeedback resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Message resource associated with this MessageFeedback resource.
^(SM|MM)[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
confirmed
unconfirmed
The date and time in GMT when this MessageFeedback resource was created, specified in RFC 2822 format.
The date and time in GMT when this MessageFeedback resource was last updated, specified in RFC 2822 format.
The URI of the resource, relative to https://api.twilio.com
.
The following are the possible values for the Outcome
parameter:
ENUM:OUTCOME possible values in REST API format | |
---|---|
confirmed | The 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. |
unconfirmed | The 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. |
POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages/{MessageSid}/Feedback.json
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.
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.
The SID of the Account associated with the Message resource for which to create MessageFeedback.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Message resource for which to create MessageFeedback.
^(SM|MM)[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
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.
confirmed
unconfirmed
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createMessageFeedback() {11const feedback = await client12.messages("SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.feedback.create({ outcome: "confirmed" });1415console.log(feedback.accountSid);16}1718createMessageFeedback();
1{2"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",3"date_created": "Thu, 30 Jul 2015 20:00:00 +0000",4"date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",5"message_sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",6"outcome": "confirmed",7"uri": "uri"8}
Now that you know how to work with the MessageFeedback resource, you should check out the following: