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

Service-Scoped Conversation Message Resource


Use the Service-scoped Conversation Message resource to interact with messages in Conversations that belong to a non-default, service-scoped Conversation resource.

Please see the Conversation Message Resource API Reference page for Messages that belong to Conversations in the default Conversation Service.


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

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


Service-Scoped Conversation Message Properties

service-scoped-conversation-message-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

chat_service_sidSID<IS>

The SID of the Conversation Service the Participant resource is associated with.

Pattern: ^IS[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.


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.


deliveryobject

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


urlstring<uri>

An absolute API resource URL for this message.


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 Service-Scoped Conversation Message resource

create-a-service-scoped-conversation-message-resource page anchor
POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages

Headers

headers page anchor
Property nameTypeRequiredPIIDescription
X-Twilio-Webhook-Enabledenum<string>Optional

The X-Twilio-Webhook-Enabled HTTP request header

Possible values:
truefalse
Property nameTypeRequiredPIIDescription
ChatServiceSidSID<IS>required

The SID of the Conversation Service the Participant resource is associated with.

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

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 ServiceConversationMessage

create-a-serviceconversationmessage page anchor
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 createServiceConversationMessage() {
_19
const message = await client.conversations.v1
_19
.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19
.conversations("ConversationSid")
_19
.messages.create();
_19
_19
console.log(message.accountSid);
_19
}
_19
_19
createServiceConversationMessage();

Output

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


Fetch a Service-Scoped Conversation Message resource

fetch-a-service-scoped-conversation-message-resource page anchor
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages/{Sid}

Property nameTypeRequiredPIIDescription
ChatServiceSidSID<IS>required

The SID of the Conversation Service the Participant resource is associated with.

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

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 ServiceConversationMessage

fetch-a-serviceconversationmessage page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

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

Output

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


Read all Service-Scoped Conversation Message resources

read-all-service-scoped-conversation-message-resources page anchor
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages

Property nameTypeRequiredPIIDescription
ChatServiceSidSID<IS>required

The SID of the Conversation Service the Participant resource is associated with.

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

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

list-multiple-serviceconversationmessages page anchor
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 listServiceConversationMessage() {
_19
const messages = await client.conversations.v1
_19
.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19
.conversations("ConversationSid")
_19
.messages.list({ limit: 20 });
_19
_19
messages.forEach((m) => console.log(m.accountSid));
_19
}
_19
_19
listServiceConversationMessage();

Output

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


Update a Service-Scoped Conversation Message resource

update-a-service-scoped-conversation-message-resource page anchor
POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/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
ChatServiceSidSID<IS>required

The SID of the Conversation Service the Participant resource is associated with.

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

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 ServiceConversationMessage

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

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

Output

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


Delete a Service-Scoped Conversation Message resource

delete-a-service-scoped-conversation-message-resource page anchor
DELETE https://conversations.twilio.com/v1/Services/{ChatServiceSid}/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
ChatServiceSidSID<IS>required

The SID of the Conversation Service the Participant resource is associated with.

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

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 ServiceConversationMessage

delete-a-serviceconversationmessage 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
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 deleteServiceConversationMessage() {
_18
await client.conversations.v1
_18
.services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.conversations("ConversationSid")
_18
.messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.remove();
_18
}
_18
_18
deleteServiceConversationMessage();


Rate this page: