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

Participant Conversation Resource


The ParticipantConversation resource lists all the Conversations for a specific participant. It performs the lookup using an exact match to the participant identifier.
This resource supports the lookup of conversations for a specific participant based on two types of query parameters:

  • Identity: for Chat users,
  • Address: for non-Chat members, e.g., SMS or WhatsApp addresses.

Users can provide only one parameter at a time, i.e. either identity or address. The returned data will be sorted by the conversationSid alphabetically.


ParticipantConversation Properties

participantconversation-properties page anchor

Each Participant Conversation resource contains these properties.

Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The unique ID of the Account responsible for this conversation.

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

chat_service_sidSID<IS>

The unique ID of the Conversation Service this conversation belongs to.

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

participant_sidSID<MB>

The unique ID of the Participant.

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

participant_user_sidSID<US>

The unique string that identifies the conversation participant as Conversation User.

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

participant_identitystring
PII MTL: 30 days

A unique string identifier for the conversation participant as Conversation User. This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters.


participant_messaging_bindingobject

Information about how this participant exchanges messages with the conversation. A JSON parameter consisting of type and address fields of the participant.


conversation_sidSID<CH>

The unique ID of the Conversation this Participant belongs to.

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

conversation_unique_namestring

An application-defined string that uniquely identifies the Conversation resource.


conversation_friendly_namestring

The human-readable name of this conversation, limited to 256 characters. Optional.


conversation_attributesstring

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.


conversation_date_createdstring<date-time>

The date that this conversation was created, given in ISO 8601 format.


conversation_date_updatedstring<date-time>

The date that this conversation was last updated, given in ISO 8601 format.


conversation_created_bystring

Identity of the creator of this Conversation.


conversation_stateenum<string>

The current state of this User Conversation. One of inactive, active or closed.

Possible values:
inactiveactiveclosed

conversation_timersobject

Timer date values representing state update for this conversation.


linksobject<uri-map>

Contains absolute URLs to access the participant and conversation of this conversation.


List All of a Participant's Conversations

list-all-of-a-participants-conversations page anchor
GET https://conversations.twilio.com/v1/ParticipantConversations

The ParticipantConversation resource also supports pagination via additional parameters like: PageSize and PageToken.

(information)

Info

It's expected that you will encode the url for the ParticipantConversations endpoint, for example, if a phone number is passed as an address parameter the + character should be encoded as %2B.

(warning)

Warning

In the Group MMS use case, it may happen that the participant might not have an identifier (no address and no identity). So, this endpoint will not return conversations for this participant. Similarly if the identity of this participant with Projected Address is created later then this endpoint will not return conversations to which this participant was added when it was without identity.

Query parameters

query-parameters page anchor
Property nameTypeRequiredPIIDescription
IdentitystringOptional

A unique string identifier for the conversation participant as Conversation User. This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters.


AddressstringOptional

A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded.


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 All of a Participant's Conversations

list-all-of-a-participants-conversations-1 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 listParticipantConversation() {
_20
const participantConversations =
_20
await client.conversations.v1.participantConversations.list({
_20
address: "+375255555555",
_20
limit: 20,
_20
});
_20
_20
participantConversations.forEach((p) => console.log(p.accountSid));
_20
}
_20
_20
listParticipantConversation();

Output

_44
{
_44
"conversations": [
_44
{
_44
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_44
"chat_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_44
"conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_44
"participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_44
"conversation_friendly_name": "friendly_name",
_44
"conversation_state": "inactive",
_44
"conversation_timers": {
_44
"date_inactive": "2015-12-16T22:19:38Z",
_44
"date_closed": "2015-12-16T22:28:38Z"
_44
},
_44
"conversation_attributes": "{}",
_44
"conversation_date_created": "2015-07-30T20:00:00Z",
_44
"conversation_date_updated": "2015-07-30T20:00:00Z",
_44
"conversation_created_by": "created_by",
_44
"conversation_unique_name": "unique_name",
_44
"participant_user_sid": null,
_44
"participant_identity": null,
_44
"participant_messaging_binding": {
_44
"address": "+375255555555",
_44
"proxy_address": "+12345678910",
_44
"type": "sms",
_44
"level": null,
_44
"name": null,
_44
"projected_address": null
_44
},
_44
"links": {
_44
"participant": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_44
"conversation": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_44
}
_44
}
_44
],
_44
"meta": {
_44
"page": 0,
_44
"page_size": 50,
_44
"first_page_url": "https://conversations.twilio.com/v1/ParticipantConversations?Address=%2B375255555555&PageSize=50&Page=0",
_44
"previous_page_url": null,
_44
"url": "https://conversations.twilio.com/v1/ParticipantConversations?Address=%2B375255555555&PageSize=50&Page=0",
_44
"next_page_url": null,
_44
"key": "conversations"
_44
}
_44
}


Rate this page: