Skip to contentSkip to navigationSkip to topbar
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.


Feedback Properties

feedback-properties page anchor
Property nameTypeRequiredDescriptionChild properties
account_sidSID<AC>

Optional

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>

Optional

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>

Optional

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>

Optional


date_updatedstring<date-time-rfc-2822>

Optional

The date and time in GMT when this MessageFeedback resource was last updated, specified in RFC 2822(link takes you to an external page) format.


uristring

Optional

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
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

create-a-messagefeedback-resource page anchor
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

path-parameters page anchor
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
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
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 actionLink to code sample: Create Message Feedback to confirm the performance of the tracked user action
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createMessageFeedback() {
11
const feedback = await client
12
.messages("SMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.feedback.create({ outcome: "confirmed" });
14
15
console.log(feedback.accountSid);
16
}
17
18
createMessageFeedback();

Output

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:

  • View your reported Message Feedback information in the Console(link takes you to an external page) to help you monitor and understand your message deliverability.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.