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

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
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
const message = await client.conversations.v1
_17
.conversations("CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_17
.messages.create({
_17
author: "smee",
_17
body: "Ahoy there!",
_17
});
_17
_17
console.log(message.sid);

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

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

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

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

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

_17
// Download the helper library from https://www.twilio.com/docs/node/install
_17
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
const messages = await client.conversations.v1
_17
.conversations("ConversationSid")
_17
.messages.list({
_17
order: "desc",
_17
limit: 20,
_17
});
_17
_17
messages.forEach((m) => console.log(m.accountSid));

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

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
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
const message = await client.conversations.v1
_18
.conversations("ConversationSid")
_18
.messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.update({
_18
author: "regretfulUser",
_18
body: "I take back what I said",
_18
});
_18
_18
console.log(message.accountSid);

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

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


Rate this page: