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.
Interactions are read-only communications logs of a given Session. Each Interaction represents a single communication.
Interactions are composed of an inbound (to Twilio) and an outbound (from Twilio) leg. Interactions can have both inbound and outbound legs or be "one-sided" (like when creating a Message Interaction resource).
If a user sends an SMS to a proxy number, and Twilio Proxy handles the proxying to the other Participant, you'll have an Interaction with both an inbound SMS and an outbound SMS.
The unique string that we created to identify the Interaction resource.
^KI[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 parent Service resource.
^KS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Interaction resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A JSON string that includes the message body of message interactions (e.g. {"body": "hello"}
) or the call duration (when available) of a call (e.g. {"duration": "5"}
).
The Type of the Interaction. Can be: message
, voice
or unknown
.
message
voice
unknown
The SID of the inbound Participant resource.
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the inbound resource; either the Call or Message.
^[a-zA-Z]{2}[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The inbound resource status of the Interaction. Will always be delivered
for messages and in-progress
for calls.
accepted
answered
busy
canceled
completed
deleted
delivered
delivery-unknown
failed
in-progress
The SID of the outbound Participant).
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the outbound resource; either the Call or Message.
^[a-zA-Z]{2}[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The outbound resource status of the Interaction. Can be: accepted
, canceled
, deleted
, delivered
, delivery-unknown
, failed
, partially-delivered
, queued
, read
, received
, receiving
, scheduled
, sending
, sent
, undelivered
, or unknown
for messages. Can be initiated
or completed
or unknown
for calls.
accepted
answered
busy
canceled
completed
deleted
delivered
delivery-unknown
failed
in-progress
The ISO 8601 date and time in GMT when the Interaction was created.
The ISO 8601 date and time in GMT when the resource was last updated.
The absolute URL of the Interaction resource.
You cannot POST
to the Interactions resource. Instead, you can generate Interactions via the appropriate Participant's MessageInteraction resource. For details, see Sending Messages. Otherwise, Interactions are created automatically when Participants text or call each other.
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions/{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 Interaction resource to fetch.
^KI[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 fetchInteraction() {11const interaction = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")15.fetch();1617console.log(interaction.sid);18}1920fetchInteraction();
1{2"service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"data": "{\"body\":\"some message\"}",4"date_created": "2015-07-30T20:00:00Z",5"date_updated": "2015-07-30T20:00:00Z",6"inbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"inbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",8"inbound_resource_status": "sent",9"inbound_resource_type": "Message",10"inbound_resource_url": null,11"outbound_participant_sid": "KPbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",12"outbound_resource_sid": "SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",13"outbound_resource_status": "sent",14"outbound_resource_type": "Message",15"outbound_resource_url": null,16"sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",17"type": "message",18"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",19"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",20"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"21}
GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions
Retrieve a list of Interactions for a given Session.
The SID of the parent Service to read the resources from.
^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.
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 listInteraction() {11const interactions = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.interactions.list({ limit: 20 });1516interactions.forEach((i) => console.log(i.sid));17}1819listInteraction();
1{2"interactions": [],3"meta": {4"previous_page_url": null,5"next_page_url": null,6"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions?PageSize=50&Page=0",7"page": 0,8"first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions?PageSize=50&Page=0",9"page_size": 50,10"key": "interactions"11}12}
DELETE https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Interactions/{Sid}
Deleting an Interaction removes it permanently.
Any Message or Call records created during this interaction will NOT be deleted automatically. If you want to delete all related Message/Call resources, you must issue direct DELETE
requests for the inbound and outbound resources directly. Once you have deleted an interaction, those resource SIDs will not be discoverable via Proxy.
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 Interaction resource to delete.
^KI[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 deleteInteraction() {11await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")15.remove();16}1718deleteInteraction();