Participant
A Participant is a single individual communicating in a Session . There is a limit of two Participants per Session.
You can create a Proxy Participant in two ways:
By specifying the private Phone Number of the Participant (Identifier) and relying on Proxy to select an appropriate Phone Number from the Proxy Number pool. The Proxy Number returned (Proxy Identifier) is the Phone Number that the Participant should call to reach the other party.
By specifying both the Identifier and the Proxy Identifier. In this case, Proxy will attempt to use the Twilio Phone Number provided.
Note:
The Twilio Phone Number specified must already be added to the Proxy Number pool in order to be accepted.
Property name Type PII Description
The unique string that we created to identify the Participant resource.
Pattern: ^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the parent Session resource.
Pattern: ^KC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the resource's parent Service resource.
Pattern: ^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Participant resource.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The string that you assigned to describe the participant. This value must be 255 characters or fewer. Supports UTF-8 characters. This value should not have PII.
The phone number or channel identifier of the Participant. This value must be 191 characters or fewer. Supports UTF-8 characters.
The phone number or short code (masked number) of the participant's partner. The participant will call or message the partner participant at this number.
proxy_identifier_sid SID<PN> The SID of the Proxy Identifier assigned to the Participant.
Pattern: ^PN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
date_deleted string<date-time> The ISO 8601 date when the Participant was removed from the session.
date_created string<date-time> The ISO 8601 date and time in GMT when the resource was created.
date_updated string<date-time> The ISO 8601 date and time in GMT when the resource was last updated.
The absolute URL of the Participant resource.
The URLs to resources related the participant.
Create a Participant resource POST https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants
Property name Type Required PII Description
ServiceSid SID<KS> required The SID of the parent Service resource.
Pattern: ^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
SessionSid SID<KC> required The SID of the parent Session resource.
Pattern: ^KC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property name Type Required PII Description
The phone number of the Participant.
FriendlyName string Optional The string that you assigned to describe the participant. This value must be 255 characters or fewer. This value should not have PII.
ProxyIdentifier string Optional The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool.
ProxyIdentifierSid SID<PN> Optional The SID of the Proxy Identifier to assign to the Participant.
Pattern: ^PN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_22 // Download the helper library from https://www.twilio.com/docs/node/install
_22 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_22 // Find your Account SID and Auth Token at twilio.com/console
_22 // and set the environment variables. See http://twil.io/secure
_22 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_22 const authToken = process.env.TWILIO_AUTH_TOKEN;
_22 const client = twilio(accountSid, authToken);
_22 async function createParticipant() {
_22 const participant = await client.proxy.v1
_22 .services("KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_22 .sessions("KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_22 .participants.create({
_22 friendlyName: "Alice",
_22 identifier: "+15558675310",
_22 console.log(participant.proxyIdentifier);
_17 "sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "session_sid": "KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_17 "service_sid": "KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_17 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "identifier": "+15558675310",
_17 "proxy_identifier": "+14155559999",
_17 "proxy_identifier_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "friendly_name": "Alice",
_17 "date_deleted": "2015-07-30T20:00:00Z",
_17 "date_updated": "2015-07-30T20:00:00Z",
_17 "date_created": "2015-07-30T20:00:00Z",
_17 "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "message_interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions"
Fetch a Participant resource GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{Sid}
Property name Type Required PII Description
ServiceSid SID<KS> required The SID of the parent Service of the resource to fetch.
Pattern: ^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
SessionSid SID<KC> required The SID of the parent Session of the resource to fetch.
Pattern: ^KC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Participant resource to fetch.
Pattern: ^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_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 // 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 async function fetchParticipant() {
_20 const participant = await client.proxy.v1
_20 .services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_20 .sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_20 .participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_20 console.log(participant.sid);
_17 "sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "identifier": "+14155551212",
_17 "proxy_identifier": "+14155559999",
_17 "proxy_identifier_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "friendly_name": "friendly_name",
_17 "date_deleted": "2015-07-30T20:00:00Z",
_17 "date_updated": "2015-07-30T20:00:00Z",
_17 "date_created": "2015-07-30T20:00:00Z",
_17 "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_17 "message_interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions"
Read multiple Participant resources GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants
Property name Type Required PII Description
ServiceSid SID<KS> required The SID of the parent Service of the resources to read.
Pattern: ^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
SessionSid SID<KC> required The SID of the parent Session of the resources to read.
Pattern: ^KC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property name Type Required PII Description
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
In order to add a new Participant in a Session, you can DELETE
an existing Participant and then add a new one.
Danger Adding a participant that was removed is not possible.
Proxy will return with error 80103 if the new participant's identifier matches the deleted participant's identifier.
List multiple Participants _19 // Download the helper library from https://www.twilio.com/docs/node/install
_19 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19 // Find your Account SID and Auth Token at twilio.com/console
_19 // and set the environment variables. See http://twil.io/secure
_19 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19 const authToken = process.env.TWILIO_AUTH_TOKEN;
_19 const client = twilio(accountSid, authToken);
_19 async function listParticipant() {
_19 const participants = await client.proxy.v1
_19 .services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 .sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 .participants.list({ limit: 20 });
_19 participants.forEach((p) => console.log(p.sid));
_12 "previous_page_url": null,
_12 "next_page_url": null,
_12 "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
_12 "first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",
_12 "key": "participants"
Delete a Participant resource DELETE https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{Sid}
Property name Type Required PII Description
ServiceSid SID<KS> required The SID of the parent Service of the resource to delete.
Pattern: ^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
SessionSid SID<KC> required The SID of the parent Session of the resource to delete.
Pattern: ^KC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Participant resource to delete.
Pattern: ^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_18 // Download the helper library from https://www.twilio.com/docs/node/install
_18 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18 // Find your Account SID and Auth Token at twilio.com/console
_18 // and set the environment variables. See http://twil.io/secure
_18 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18 const authToken = process.env.TWILIO_AUTH_TOKEN;
_18 const client = twilio(accountSid, authToken);
_18 async function deleteParticipant() {
_18 await client.proxy.v1
_18 .services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 .sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 .participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")