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

Conversation Message Resource



API Base URL

api-base-url page anchor

All URLs in the reference documentation use the following base URL:


_10
https://conversations.twilio.com/v1

Using the shortened base URL

using-the-shortened-base-url page anchor

Using the REST API, you can interact with Conversation Message resources in the default Conversation Service instance via a "shortened" URL that does not include the Conversation Service instance SID ("ISXXX..."). If you are only using one Conversation Service (the default), you do not need to include the Conversation Service SID in your URL, e.g.


_10
GET /v1/Conversations/CHxx/Messages

For Conversations applications that build on more than one Conversation Service instance, you will need to specify the Conversation Service SID in the REST API call:


_10
GET /v1/Services/ISxx/Conversations/CHxx/Messages


ConversationMessage Properties

conversationmessage-properties page anchor
Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The unique ID of the Account responsible for this message.

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

conversation_sidSID<CH>

The unique ID of the Conversation for this message.

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

sidSID<IM>

A 34 character string that uniquely identifies this resource.

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

indexinteger

The index of the message within the Conversation. Indices may skip numbers, but will always be in order of when the message was received.


authorstring
PII MTL: 30 days

The channel specific identifier of the message's author. Defaults to system.


The content of the message, can be up to 1,600 characters long.


An array of objects that describe the Message's media, if the message contains media. Each object contains these fields: content_type with the MIME type of the media, filename with the name of the media, sid with the SID of the Media resource, and size with the media object's file size in bytes. If the Message has no media, this value is null.


attributesstring

A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.


participant_sidSID<MB>

The unique ID of messages's author participant. Null in case of system sent message.

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

date_createdstring<date-time>

The date that this resource was created.


date_updatedstring<date-time>

The date that this resource was last updated. null if the message has not been edited.


urlstring<uri>

An absolute API resource API URL for this message.


deliveryobject

An object that contains the summary of delivery statuses for the message to non-chat participants.


linksobject<uri-map>

Contains an absolute API resource URL to access the delivery & read receipts of this message.


content_sidSID<HX>

The unique ID of the multi-channel Rich Content template.

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

Create a ConversationMessage resource

create-a-conversationmessage-resource page anchor
POST https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Messages

Property nameTypeRequiredPIIDescription
X-Twilio-Webhook-Enabledenum<string>Optional

The X-Twilio-Webhook-Enabled HTTP request header

Possible values:
truefalse
Property nameTypeRequiredPIIDescription
ConversationSidstringrequired

The unique ID of the Conversation for this message.

Property nameTypeRequiredPIIDescription
AuthorstringOptional

The channel specific identifier of the message's author. Defaults to system.


BodystringOptional

The content of the message, can be up to 1,600 characters long.


DateCreatedstring<date-time>Optional

The date that this resource was created.


DateUpdatedstring<date-time>Optional

The date that this resource was last updated. null if the message has not been edited.


AttributesstringOptional

A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.


MediaSidSID<ME>Optional

The Media SID to be attached to the new Message.

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

ContentSidSID<HX>Optional

The unique ID of the multi-channel Rich Content template, required for template-generated messages. Note that if this field is set, Body and MediaSid parameters are ignored.

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

ContentVariablesstringOptional

A structurally valid JSON string that contains values to resolve Rich Content template variables.


SubjectstringOptional

The subject of the message, can be up to 256 characters long.

Create a Conversation Message

create-a-conversation-message page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function createConversationMessage() {
_21
const message = await client.conversations.v1
_21
.conversations("CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_21
.messages.create({
_21
author: "smee",
_21
body: "Ahoy there!",
_21
});
_21
_21
console.log(message.sid);
_21
}
_21
_21
createConversationMessage();

Output

_27
{
_27
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27
"body": "Ahoy there!",
_27
"media": null,
_27
"author": "smee",
_27
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"attributes": "{ \"importance\": \"high\" }",
_27
"date_created": "2015-12-16T22:18:37Z",
_27
"date_updated": "2015-12-16T22:18:38Z",
_27
"index": 0,
_27
"delivery": {
_27
"total": 2,
_27
"sent": "all",
_27
"delivered": "some",
_27
"read": "some",
_27
"failed": "none",
_27
"undelivered": "none"
_27
},
_27
"content_sid": null,
_27
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"links": {
_27
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
_27
"channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
_27
}
_27
}


Fetch a ConversationMessage resource

fetch-a-conversationmessage-resource page anchor
GET https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Messages/{Sid}

Property nameTypeRequiredPIIDescription
ConversationSidstringrequired

The unique ID of the Conversation for this message.


SidSID<IM>required

A 34 character string that uniquely identifies this resource.

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

Fetch a Conversation Message

fetch-a-conversation-message page anchor

Fetch a Conversation Message by SID

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

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function fetchConversationMessage() {
_19
const message = await client.conversations.v1
_19
.conversations("ConversationSid")
_19
.messages("IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_19
.fetch();
_19
_19
console.log(message.accountSid);
_19
}
_19
_19
fetchConversationMessage();

Output

_27
{
_27
"sid": "IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"conversation_sid": "ConversationSid",
_27
"body": "Welcome!",
_27
"media": null,
_27
"author": "system",
_27
"participant_sid": null,
_27
"attributes": "{ \"importance\": \"high\" }",
_27
"date_created": "2016-03-24T20:37:57Z",
_27
"date_updated": "2016-03-24T20:37:57Z",
_27
"index": 0,
_27
"delivery": {
_27
"total": 2,
_27
"sent": "all",
_27
"delivered": "some",
_27
"read": "some",
_27
"failed": "none",
_27
"undelivered": "none"
_27
},
_27
"content_sid": null,
_27
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"links": {
_27
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
_27
"channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
_27
}
_27
}


List all Conversation Message(s)

list-all-conversation-messages page anchor
GET https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Messages

Property nameTypeRequiredPIIDescription
ConversationSidstringrequired

The unique ID of the Conversation for messages.

Property nameTypeRequiredPIIDescription
Orderenum<string>Optional

The sort order of the returned messages. Can be: asc (ascending) or desc (descending), with asc as the default.

Possible values:
ascdesc

PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

List all Conversation Messages

list-all-conversation-messages-1 page anchor

List all messages in a Conversation

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 listConversationMessage() {
_18
const messages = await client.conversations.v1
_18
.conversations("CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_18
.messages.list({ limit: 20 });
_18
_18
messages.forEach((m) => console.log(m.accountSid));
_18
}
_18
_18
listConversationMessage();

Output

_101
{
_101
"meta": {
_101
"page": 0,
_101
"page_size": 50,
_101
"first_page_url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0",
_101
"previous_page_url": null,
_101
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0",
_101
"next_page_url": null,
_101
"key": "messages"
_101
},
_101
"messages": [
_101
{
_101
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"body": "I like pie.",
_101
"media": null,
_101
"author": "pie_preferrer",
_101
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"attributes": "{ \"importance\": \"high\" }",
_101
"date_created": "2016-03-24T20:37:57Z",
_101
"date_updated": "2016-03-24T20:37:57Z",
_101
"index": 0,
_101
"delivery": {
_101
"total": 2,
_101
"sent": "all",
_101
"delivered": "some",
_101
"read": "some",
_101
"failed": "none",
_101
"undelivered": "none"
_101
},
_101
"content_sid": null,
_101
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"links": {
_101
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
_101
"channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
_101
}
_101
},
_101
{
_101
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"body": "Cake is my favorite!",
_101
"media": null,
_101
"author": "cake_lover",
_101
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"attributes": "{ \"importance\": \"high\" }",
_101
"date_created": "2016-03-24T20:38:21Z",
_101
"date_updated": "2016-03-24T20:38:21Z",
_101
"index": 5,
_101
"delivery": {
_101
"total": 2,
_101
"sent": "all",
_101
"delivered": "some",
_101
"read": "some",
_101
"failed": "none",
_101
"undelivered": "none"
_101
},
_101
"content_sid": null,
_101
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"links": {
_101
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
_101
"channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
_101
}
_101
},
_101
{
_101
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"body": null,
_101
"media": [
_101
{
_101
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"size": 42056,
_101
"content_type": "image/jpeg",
_101
"filename": "car.jpg"
_101
}
_101
],
_101
"author": "cake_lover",
_101
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"attributes": "{ \"importance\": \"high\" }",
_101
"date_created": "2016-03-24T20:38:21Z",
_101
"date_updated": "2016-03-24T20:38:21Z",
_101
"index": 9,
_101
"delivery": {
_101
"total": 2,
_101
"sent": "all",
_101
"delivered": "some",
_101
"read": "some",
_101
"failed": "none",
_101
"undelivered": "none"
_101
},
_101
"content_sid": null,
_101
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_101
"links": {
_101
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
_101
"channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
_101
}
_101
}
_101
]
_101
}

Fetch the latest Conversation Message

fetch-the-latest-conversation-message page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function listConversationMessage() {
_21
const messages = await client.conversations.v1
_21
.conversations("ConversationSid")
_21
.messages.list({
_21
order: "desc",
_21
limit: 20,
_21
});
_21
_21
messages.forEach((m) => console.log(m.accountSid));
_21
}
_21
_21
listConversationMessage();

Output

_47
{
_47
"meta": {
_47
"page": 0,
_47
"page_size": 1,
_47
"first_page_url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?Order=desc&PageSize=1&Page=0",
_47
"previous_page_url": null,
_47
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?Order=desc&PageSize=1&Page=0",
_47
"next_page_url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?Order=desc&PageSize=1&Page=1&PageToken=PAIMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_47
"key": "messages"
_47
},
_47
"messages": [
_47
{
_47
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_47
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_47
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_47
"body": null,
_47
"media": [
_47
{
_47
"sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_47
"size": 42056,
_47
"content_type": "image/jpeg",
_47
"filename": "car.jpg"
_47
}
_47
],
_47
"author": "cake_lover",
_47
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_47
"attributes": "{ \"importance\": \"high\" }",
_47
"date_created": "2016-03-24T20:38:21Z",
_47
"date_updated": "2016-03-24T20:38:21Z",
_47
"index": 9,
_47
"delivery": {
_47
"total": 2,
_47
"sent": "all",
_47
"delivered": "some",
_47
"read": "some",
_47
"failed": "none",
_47
"undelivered": "none"
_47
},
_47
"content_sid": null,
_47
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_47
"links": {
_47
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
_47
"channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
_47
}
_47
}
_47
]
_47
}


Update a ConversationMessage resource

update-a-conversationmessage-resource page anchor
POST https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Messages/{Sid}

Property nameTypeRequiredPIIDescription
X-Twilio-Webhook-Enabledenum<string>Optional

The X-Twilio-Webhook-Enabled HTTP request header

Possible values:
truefalse
Property nameTypeRequiredPIIDescription
ConversationSidstringrequired

The unique ID of the Conversation for this message.


SidSID<IM>required

A 34 character string that uniquely identifies this resource.

Pattern: ^IM[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
AuthorstringOptional

The channel specific identifier of the message's author. Defaults to system.


BodystringOptional

The content of the message, can be up to 1,600 characters long.


DateCreatedstring<date-time>Optional

The date that this resource was created.


DateUpdatedstring<date-time>Optional

The date that this resource was last updated. null if the message has not been edited.


AttributesstringOptional

A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.


SubjectstringOptional

The subject of the message, can be up to 256 characters long.

Update a Conversation Message

update-a-conversation-message page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_22
// Download the helper library from https://www.twilio.com/docs/node/install
_22
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_22
_22
// Find your Account SID and Auth Token at twilio.com/console
_22
// and set the environment variables. See http://twil.io/secure
_22
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_22
const authToken = process.env.TWILIO_AUTH_TOKEN;
_22
const client = twilio(accountSid, authToken);
_22
_22
async function updateConversationMessage() {
_22
const message = await client.conversations.v1
_22
.conversations("ConversationSid")
_22
.messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_22
.update({
_22
author: "regretfulUser",
_22
body: "I take back what I said",
_22
});
_22
_22
console.log(message.accountSid);
_22
}
_22
_22
updateConversationMessage();

Output

_27
{
_27
"sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"conversation_sid": "ConversationSid",
_27
"body": "I take back what I said",
_27
"media": null,
_27
"author": "regretfulUser",
_27
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"attributes": "{ \"importance\": \"high\" }",
_27
"date_created": "2015-12-16T22:18:37Z",
_27
"date_updated": "2015-12-16T22:18:38Z",
_27
"index": 0,
_27
"delivery": {
_27
"total": 2,
_27
"sent": "all",
_27
"delivered": "some",
_27
"read": "some",
_27
"failed": "none",
_27
"undelivered": "none"
_27
},
_27
"content_sid": null,
_27
"url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27
"links": {
_27
"delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",
_27
"channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"
_27
}
_27
}


Delete a ConversationMessage resource

delete-a-conversationmessage-resource page anchor
DELETE https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Messages/{Sid}

Property nameTypeRequiredPIIDescription
X-Twilio-Webhook-Enabledenum<string>Optional

The X-Twilio-Webhook-Enabled HTTP request header

Possible values:
truefalse
Property nameTypeRequiredPIIDescription
ConversationSidstringrequired

The unique ID of the Conversation for this message.


SidSID<IM>required

A 34 character string that uniquely identifies this resource.

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

Delete a Conversation Message

delete-a-conversation-message page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_17
_17
// Find your Account SID and Auth Token at twilio.com/console
_17
// and set the environment variables. See http://twil.io/secure
_17
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17
const authToken = process.env.TWILIO_AUTH_TOKEN;
_17
const client = twilio(accountSid, authToken);
_17
_17
async function deleteConversationMessage() {
_17
await client.conversations.v1
_17
.conversations("CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_17
.messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_17
.remove();
_17
}
_17
_17
deleteConversationMessage();


Rate this page: