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.
We can send text messages through the Proxy API by creating a Message Interaction on a Participant. The referenced Participant will receive the message from their allocated proxy number on the appropriate channel.
Note: Only POST
(create) is available on Message Interactions. To query past messages you've created with this resource, query the Interaction resource.
The unique string that we created to identify the MessageInteraction 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 MessageInteraction resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A JSON string that includes the message body sent to the participant. (e.g. {"body": "hello"}
)
The Type of Message Interaction. This value is always message
.
message
voice
unknown
The SID of the Participant resource.
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Always empty for created Message Interactions.
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Always empty for created Message Interactions.
^[a-zA-Z]{2}[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Always empty for created Message Interactions.
accepted
answered
busy
canceled
completed
deleted
delivered
delivery-unknown
failed
in-progress
The SID of the outbound Participant resource.
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the outbound Message resource.
^[a-zA-Z]{2}[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The outbound message resource status. Can be: accepted
, deleted
, delivered
, delivery-unknown
, failed
, queued
, received
, receiving
, scheduled
, sending
, sent
, undelivered
, or unknown
.
accepted
answered
busy
canceled
completed
deleted
delivered
delivery-unknown
failed
in-progress
The outbound resource type. This value is always Message
.
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 absolute URL of the MessageInteraction resource.
POST https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{SessionSid}/Participants/{ParticipantSid}/MessageInteractions
The SID of the parent Service resource.
^KS[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 Participant resource.
^KP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
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 createMessageInteraction() {11const messageInteraction = await client.proxy.v112.services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")15.messageInteractions.create({16body: "This will be the body of the new message!",17});1819console.log(messageInteraction.sid);20}2122createMessageInteraction();
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"participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"inbound_participant_sid": null,8"inbound_resource_sid": null,9"inbound_resource_status": null,10"inbound_resource_type": null,11"inbound_resource_url": null,12"outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"outbound_resource_status": "sent",15"outbound_resource_type": "Message",16"outbound_resource_url": null,17"sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",18"type": "message",19"url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",20"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",21"session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"22}