All URLs in the reference documentation use the following base URL:
_10https://conversations.twilio.com/v1
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.
_10GET /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:
_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
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
index
type: integerThe index of the message within the Conversation. Indices may skip numbers, but will always be in order of when the message was received.
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/Conversations/{ConversationSid}/Messages
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
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/Conversations/{ConversationSid}/Messages/{Sid}
Sid
type: SID<IM>A 34 character string that uniquely identifies this resource.
^IM[0-9a-fA-F]{32}$
34
34
Fetch a Conversation Message by SID
GET https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Messages
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
List all messages in a Conversation
POST https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Messages/{Sid}
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
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/Conversations/{ConversationSid}/Messages/{Sid}
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
Sid
type: SID<IM>A 34 character string that uniquely identifies this resource.
^IM[0-9a-fA-F]{32}$
34
34