Conversation Participant Resource
Each Participant in a Conversation represents one real (probably human) participant in a Conversation.
Creating a Participant joins them with the conversation, and the connected person will receive all subsequent messages.
Deleting a participant removes them from the conversation. They will receive no new messages after that point, but their previous messages will remain in the conversation.
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 Participant 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/Participants
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/Participants
Resource properties
conversation_sid
type: SID<CH>
sid
type: SID<MB>
A 34 character string that uniquely identifies this resource.
Pattern:
^MB[0-9a-fA-F]{32}$
attributes
type: string
An 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.
messaging_binding
type: object
Information about how this participant exchanges messages with the conversation. A JSON parameter consisting of type and address fields of the participant.
date_created
type: string<date-time>
The date that this resource was created.
date_updated
type: string<date-time>
The date that this resource was last updated.
url
type: string<uri>
An absolute API resource URL for this participant.
last_read_message_index
type: integer
last_read_timestamp
type: string
POST https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants
Adding a new participant to an ongoing conversation immediately allows them to see all subsequent communications. The same person (i.e., a single personal phone number) can be part of any number of conversations concurrently, as long as the address they are in contact with (the ProxyAddress
) is unique.
To create a Conversation Participant by SMS, you must enter:
-
Their phone number as the
messagingbinding.address
-
Your Twilio number as the
messagingbinding.proxyaddress
.
To create a Conversation Participant by Chat, you must enter the Chat User Identity as the identity
parameter.
We recommend following the standard URI specification and avoid the following reserved characters ! * ' ( ) ; : @ & = + $ , / ? % # [ ]
for values such as identity and friendly name.
Request headers
X-Twilio-Webhook-Enabled
type: enum<string>
The X-Twilio-Webhook-Enabled HTTP request header
Possible values:
true
false
URI parameters
ConversationSid
type: string
Request body parameters
MessagingBinding.Address
type: string
The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field).
MessagingBinding.ProxyAddress
type: string
The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field).
DateCreated
type: string<date-time>
The date that this resource was created.
DateUpdated
type: string<date-time>
The date that this resource was last updated.
Attributes
type: string
An 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.
MessagingBinding.ProjectedAddress
type: string
The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity.
Connect someone to a Conversation over SMS
_14// Download the helper library from https://www.twilio.com/docs/node/install
_14// Find your Account SID and Auth Token at twilio.com/console
_14// and set the environment variables. See http://twil.io/secure
_14const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14const authToken = process.env.TWILIO_AUTH_TOKEN;
_14const client = require('twilio')(accountSid, authToken);
_14client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_14 'messagingBinding.address': '+15558675310',
_14 'messagingBinding.proxyAddress': '<Your Twilio Number>'
_14 .then(participant => console.log(participant.sid));
_20 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "messaging_binding": {
_20 "address": "+15558675310",
_20 "proxy_address": "+15017122661"
_20 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "date_created": "2015-12-16T22:18:37Z",
_20 "date_updated": "2015-12-16T22:18:38Z",
_20 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "last_read_message_index": null,
_20 "last_read_timestamp": null
Connect someone to a Conversation over Chat
_11// Download the helper library from https://www.twilio.com/docs/node/install
_11// Find your Account SID and Auth Token at twilio.com/console
_11// and set the environment variables. See http://twil.io/secure
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .create({identity: '<Chat User Identity>'})
_11 .then(participant => console.log(participant.sid));
_16 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_16 "conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_16 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_16 "identity": "<Chat User Identity>",
_16 "messaging_binding": null,
_16 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_16 "date_created": "2015-12-16T22:18:37Z",
_16 "date_updated": "2015-12-16T22:18:38Z",
_16 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_16 "last_read_message_index": null,
_16 "last_read_timestamp": null
GET https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants/{Sid}
URI parameters
ConversationSid
type: string
Sid
type: string
A 34 character string that uniquely identifies this resource. Alternatively, you can pass a Participant's identity
rather than the SID.
Fetch a Conversation Participant by SID
_11// Download the helper library from https://www.twilio.com/docs/node/install
_11// Find your Account SID and Auth Token at twilio.com/console
_11// and set the environment variables. See http://twil.io/secure
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(participant => console.log(participant.conversationSid));
_20 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "messaging_binding": {
_20 "address": "+15558675310",
_20 "proxy_address": "+15017122661"
_20 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "date_created": "2016-03-24T21:05:50Z",
_20 "date_updated": "2016-03-24T21:05:50Z",
_20 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "last_read_message_index": null,
_20 "last_read_timestamp": null
You can also fetch a Conversation Participant by their identity
. Pass their identity
as the value for the sid
argument.
Fetch a Conversation Participant by identity
_11// Download the helper library from https://www.twilio.com/docs/node/install
_11// Find your Account SID and Auth Token at twilio.com/console
_11// and set the environment variables. See http://twil.io/secure
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .participants('alice')
_11 .then(participant => console.log(participant.conversationSid));
_20 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "messaging_binding": {
_20 "address": "+15558675310",
_20 "proxy_address": "+15017122661"
_20 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "date_created": "2016-03-24T21:05:50Z",
_20 "date_updated": "2016-03-24T21:05:50Z",
_20 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "last_read_message_index": null,
_20 "last_read_timestamp": null
GET https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants
URI parameters
ConversationSid
type: string
PageSize
type: integer
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Page
type: integer
The page index. This value is simply for client state.
PageToken
type: string
The page token. This is provided by the API.
_11// Download the helper library from https://www.twilio.com/docs/node/install
_11// Find your Account SID and Auth Token at twilio.com/console
_11// and set the environment variables. See http://twil.io/secure
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .then(participants => participants.forEach(p => console.log(p.sid)));
_49 "first_page_url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants?PageSize=50&Page=0",
_49 "previous_page_url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants?PageSize=50&Page=0",
_49 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants?PageSize=50&Page=0",
_49 "next_page_url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants?PageSize=50&Page=1",
_49 "key": "participants"
_49 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "messaging_binding": {
_49 "address": "+15558675310",
_49 "proxy_address": "+15017122661"
_49 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "date_created": "2016-03-24T21:05:50Z",
_49 "date_updated": "2016-03-24T21:05:50Z",
_49 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "last_read_message_index": null,
_49 "last_read_timestamp": null
_49 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "identity": "IDENTITY",
_49 "messaging_binding": null,
_49 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "date_created": "2016-03-24T21:05:50Z",
_49 "date_updated": "2016-03-24T21:05:50Z",
_49 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_49 "last_read_message_index": null,
_49 "last_read_timestamp": null
POST https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants/{Sid}
Request headers
X-Twilio-Webhook-Enabled
type: enum<string>
The X-Twilio-Webhook-Enabled HTTP request header
Possible values:
true
false
URI parameters
ConversationSid
type: string
Sid
type: string
A 34 character string that uniquely identifies this resource.
Request body parameters
DateCreated
type: string<date-time>
The date that this resource was created.
DateUpdated
type: string<date-time>
The date that this resource was last updated.
Attributes
type: string
An 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.
MessagingBinding.ProxyAddress
type: string
The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it.
MessagingBinding.ProjectedAddress
type: string
The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it.
LastReadMessageIndex
type: integer
LastReadTimestamp
type: string
Update Conversation Participant by SID
_11// Download the helper library from https://www.twilio.com/docs/node/install
_11// Find your Account SID and Auth Token at twilio.com/console
_11// and set the environment variables. See http://twil.io/secure
_11const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11const authToken = process.env.TWILIO_AUTH_TOKEN;
_11const client = require('twilio')(accountSid, authToken);
_11client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11 .update({dateUpdated: new Date(Date.UTC(2019, 4, 15, 13, 37, 35))})
_11 .then(participant => console.log(participant.conversationSid));
_20 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "messaging_binding": {
_20 "address": "+15558675310",
_20 "proxy_address": "+15017122661"
_20 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "date_created": "2015-12-16T22:18:37Z",
_20 "date_updated": "2019-05-15T13:37:35Z",
_20 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "last_read_message_index": null,
_20 "last_read_timestamp": null
_13// Download the helper library from https://www.twilio.com/docs/node/install
_13// Find your Account SID and Auth Token at twilio.com/console
_13// and set the environment variables. See http://twil.io/secure
_13const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13const authToken = process.env.TWILIO_AUTH_TOKEN;
_13const client = require('twilio')(accountSid, authToken);
_13client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_13 .participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_13 .update({attributes: JSON.stringify({
_13 .then(participant => console.log(participant.conversationSid));
_20 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "conversation_sid": "CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "sid": "MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "messaging_binding": {
_20 "address": "+15558675310",
_20 "proxy_address": "+15017122661"
_20 "role_sid": "RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "date_created": "2015-12-16T22:18:37Z",
_20 "date_updated": "2015-12-16T22:18:38Z",
_20 "url": "https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "last_read_message_index": null,
_20 "last_read_timestamp": null
DELETE https://conversations.twilio.com/v1/Conversations/{ConversationSid}/Participants/{Sid}
Request headers
X-Twilio-Webhook-Enabled
type: enum<string>
The X-Twilio-Webhook-Enabled HTTP request header
Possible values:
true
false
URI parameters
ConversationSid
type: string
Sid
type: string
A 34 character string that uniquely identifies this resource.
Delete a Conversation Participant by SID
_10// Download the helper library from https://www.twilio.com/docs/node/install
_10// Find your Account SID and Auth Token at twilio.com/console
_10// and set the environment variables. See http://twil.io/secure
_10const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10const authToken = process.env.TWILIO_AUTH_TOKEN;
_10const client = require('twilio')(accountSid, authToken);
_10client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')