A Conversation is a unique message thread that contains Participants and the Messages they have sent.
Do not use Personally Identifiable Information (PII) for the friendlyName field.
Avoid using a person's name, home address, email, phone number, or other PII in the friendlyName
field. Use some form of pseudonymized identifier, instead.
You can learn more about how we process your data in our privacy policy.
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 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
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
account_sid
type: SID<AC>The unique ID of the Account responsible for this conversation.
^AC[0-9a-fA-F]{32}$
34
34
chat_service_sid
type: SID<IS>The unique ID of the Conversation Service this conversation belongs to.
^IS[0-9a-fA-F]{32}$
34
34
messaging_service_sid
type: SID<MG>The unique ID of the Messaging Service this conversation belongs to.
^MG[0-9a-fA-F]{32}$
34
34
sid
type: SID<CH>A 34 character string that uniquely identifies this resource.
^CH[0-9a-fA-F]{32}$
34
34
friendly_name
type: stringThe human-readable name of this conversation, limited to 256 characters. Optional.
unique_name
type: stringAn application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's sid
in the URL.
attributes
type: stringAn optional 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.
state
type: enum<string>Current state of this conversation. Can be either active
, inactive
or closed
and defaults to active
inactive
active
closed
links
type: object<uri-map>Contains absolute URLs to access the participants, messages and webhooks of this conversation.
bindings
type: nullPOST https://conversations.twilio.com/v1/Conversations
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
FriendlyName
type: stringThe human-readable name of this conversation, limited to 256 characters. Optional.
UniqueName
type: stringAn application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's sid
in the URL.
MessagingServiceSid
type: SID<MG>The unique ID of the Messaging Service this conversation belongs to.
^MG[0-9a-fA-F]{32}$
34
34
Attributes
type: stringAn optional 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.
State
type: enum<string>Current state of this conversation. Can be either active
, inactive
or closed
and defaults to active
inactive
active
closed
Timers.Inactive
type: stringISO8601 duration when conversation will be switched to inactive
state. Minimum value for this timer is 1 minute.
Timers.Closed
type: stringISO8601 duration when conversation will be switched to closed
state. Minimum value for this timer is 10 minutes.
Bindings.Email.Address
type: stringThe default email address that will be used when sending outbound emails in this conversation.
Bindings.Email.Name
type: stringThe default name that will be used when sending outbound emails in this conversation.
GET https://conversations.twilio.com/v1/Conversations/{Sid}
You can fetch a Conversation by providing your account credentials and the conversation SID (provided when the Conversation is created).
The most valuable part of the Conversation resource itself is the attributes
key, which includes metadata attached to the conversation from the moment of its creation.
The other relevant parts of a Conversation include its Participants (the entities who are currently conversing) and the Messages they've sent. Both of these are linked directly from the top-level url
key.
Sid
type: stringA 34 character string that uniquely identifies this resource. Can also be the unique_name
of the Conversation.
Fetch Conversation by SID
GET https://conversations.twilio.com/v1/Conversations
Returns a list of conversations sorted by recent message activity.
StartDate
type: stringSpecifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order.
EndDate
type: stringDefines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order.
State
type: enum<string>State for sorting and filtering list of Conversations. Can be active
, inactive
or closed
inactive
active
closed
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/Conversations/{Sid}
The core definition of any Conversation can be modified on the fly. Update a Conversation to attach metadata that you extract on the fly (e.g. "customer-loyalty-status": "gold", or "aml-risk-level": "heightened"), or to correct mistakes manually.
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
Sid
type: stringA 34 character string that uniquely identifies this resource. Can also be the unique_name
of the Conversation.
FriendlyName
type: stringThe human-readable name of this conversation, limited to 256 characters. Optional.
Attributes
type: stringAn optional 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.
MessagingServiceSid
type: SID<MG>The unique ID of the Messaging Service this conversation belongs to.
^MG[0-9a-fA-F]{32}$
34
34
State
type: enum<string>Current state of this conversation. Can be either active
, inactive
or closed
and defaults to active
inactive
active
closed
Timers.Inactive
type: stringISO8601 duration when conversation will be switched to inactive
state. Minimum value for this timer is 1 minute.
Timers.Closed
type: stringISO8601 duration when conversation will be switched to closed
state. Minimum value for this timer is 10 minutes.
UniqueName
type: stringAn application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's sid
in the URL.
Bindings.Email.Address
type: stringThe default email address that will be used when sending outbound emails in this conversation.
Bindings.Email.Name
type: stringThe default name that will be used when sending outbound emails in this conversation.
Update a Conversation's property
DELETE https://conversations.twilio.com/v1/Conversations/{Sid}
X-Twilio-Webhook-Enabled
type: enum<string>The X-Twilio-Webhook-Enabled HTTP request header
true
false
Sid
type: stringA 34 character string that uniquely identifies this resource. Can also be the unique_name
of the Conversation.