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.
All URLs in the reference documentation use the following base URL:
_10https://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:
_10GET /v1/Services/ISxx/Conversations/CHxx/Messages
account_sid
type: SID<AC>The unique ID of the Account responsible for this message.
^AC[0-9a-fA-F]{32}$
34
34
chat_service_sid
type: SID<IS>The SID of the Conversation Service the Participant resource is associated with.
^IS[0-9a-fA-F]{32}$
34
34
conversation_sid
type: SID<CH>The unique ID of the Conversation for this message.
^CH[0-9a-fA-F]{32}$
34
34
sid
type: SID<IM>A 34 character string that uniquely identifies this resource.
^IM[0-9a-fA-F]{32}$
34
34
author
type: stringThe channel specific identifier of the message's author. Defaults to system
.
media
type: arrayAn 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
.
attributes
type: stringA 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_sid
type: SID<MB>The unique ID of messages's author participant. Null in case of system
sent message.
^MB[0-9a-fA-F]{32}$
34
34
date_updated
type: string<date-time>The date that this resource was last updated. null
if the message has not been edited.
delivery
type: objectAn object that contains the summary of delivery statuses for the message to non-chat participants.
links
type: object<uri-map>Contains an absolute API resource URL to access the delivery & read receipts of this message.
content_sid
type: SID<HX>The unique ID of the multi-channel Rich Content template.
^HX[0-9a-fA-F]{32}$
34
34
POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
ChatServiceSid
type: SID<IS>The SID of the Conversation Service the Participant resource is associated with.
^IS[0-9a-fA-F]{32}$
34
34
Author
type: stringThe channel specific identifier of the message's author. Defaults to system
.
DateUpdated
type: string<date-time>The date that this resource was last updated. null
if the message has not been edited.
Attributes
type: stringA 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.
MediaSid
type: SID<ME>The Media SID to be attached to the new Message.
^ME[0-9a-fA-F]{32}$
34
34
ContentSid
type: SID<HX>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.
^HX[0-9a-fA-F]{32}$
34
34
ContentVariables
type: stringA structurally valid JSON string that contains values to resolve Rich Content template variables.
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages/{Sid}
ChatServiceSid
type: SID<IS>The SID of the Conversation Service the Participant resource is associated with.
^IS[0-9a-fA-F]{32}$
34
34
Sid
type: SID<IM>A 34 character string that uniquely identifies this resource.
^IM[0-9a-fA-F]{32}$
34
34
GET https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages
ChatServiceSid
type: SID<IS>The SID of the Conversation Service the Participant resource is associated with.
^IS[0-9a-fA-F]{32}$
34
34
Order
type: enum<string>The sort order of the returned messages. Can be: asc
(ascending) or desc
(descending), with asc
as the default.
asc
desc
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Page
type: integerThe page index. This value is simply for client state.
0
POST https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages/{Sid}
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
ChatServiceSid
type: SID<IS>The SID of the Conversation Service the Participant resource is associated with.
^IS[0-9a-fA-F]{32}$
34
34
Sid
type: SID<IM>A 34 character string that uniquely identifies this resource.
^IM[0-9a-fA-F]{32}$
34
34
Author
type: stringThe channel specific identifier of the message's author. Defaults to system
.
DateUpdated
type: string<date-time>The date that this resource was last updated. null
if the message has not been edited.
Attributes
type: stringA 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.
DELETE https://conversations.twilio.com/v1/Services/{ChatServiceSid}/Conversations/{ConversationSid}/Messages/{Sid}
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
ChatServiceSid
type: SID<IS>The SID of the Conversation Service the Participant resource is associated with.
^IS[0-9a-fA-F]{32}$
34
34
Sid
type: SID<IM>A 34 character string that uniquely identifies this resource.
^IM[0-9a-fA-F]{32}$
34
34