Proxy Public Beta is currently closed for new customers. Please consider using Twilio Conversations and Programmable Voice directly if you are building your masking application.
Note that this does not have any impact on Twilio Flex customers.
Twilio's Proxy API is currently available as a Public Beta product. Some features are not yet implemented and others may be changed before the product is declared as Generally Available.
Public Beta products are not covered by a Twilio SLA.
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:
The unique string that we created to identify the Participant resource.
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the parent Session resource.
^KC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the resource's parent Service resource.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Participant resource.
^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.
The SID of the Proxy Identifier assigned to the Participant.
^PN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The ISO 8601 date when the Participant was removed from the session.
The ISO 8601 date and time in GMT when the resource was created.
The ISO 8601 date and time in GMT when the resource was last updated.
The URLs to resources related the participant.
POST https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants
application/x-www-form-urlencoded
The string that you assigned to describe the participant. This value must be 255 characters or fewer. This value should not have PII.
The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool.
The SID of the Proxy Identifier to assign to the Participant.
^PN[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createParticipant() {11const participant = await client.proxy.v112.services("KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")13.sessions("KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")14.participants.create({15friendlyName: "Alice",16identifier: "+15558675310",17});1819console.log(participant.proxyIdentifier);20}2122createParticipant();
1{2"sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"session_sid": "KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",4"service_sid": "KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",5"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"identifier": "+15558675310",7"proxy_identifier": "+14155559999",8"proxy_identifier_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",9"friendly_name": "Alice",10"date_deleted": "2015-07-30T20:00:00Z",11"date_updated": "2015-07-30T20:00:00Z",12"date_created": "2015-07-30T20:00:00Z",13"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"links": {15"message_interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions"16}17}
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{Sid}
The SID of the parent Service of the resource to fetch.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the parent Session of the resource to fetch.
^KC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Participant resource to fetch.
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchParticipant() {11const participant = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")15.fetch();1617console.log(participant.sid);18}1920fetchParticipant();
1{2"sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"identifier": "+14155551212",7"proxy_identifier": "+14155559999",8"proxy_identifier_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",9"friendly_name": "friendly_name",10"date_deleted": "2015-07-30T20:00:00Z",11"date_updated": "2015-07-30T20:00:00Z",12"date_created": "2015-07-30T20:00:00Z",13"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"links": {15"message_interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions"16}17}
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants
The SID of the parent Service of the resources to read.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
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.
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.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listParticipant() {11const participants = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.participants.list({ limit: 20 });1516participants.forEach((p) => console.log(p.sid));17}1819listParticipant();
1{2"meta": {3"previous_page_url": null,4"next_page_url": null,5"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",6"page": 0,7"first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0",8"page_size": 50,9"key": "participants"10},11"participants": []12}
DELETE https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{Sid}
The SID of the parent Service of the resource to delete.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the parent Session of the resource to delete.
^KC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Participant resource to delete.
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteParticipant() {11await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")15.remove();16}1718deleteParticipant();