Build the future of communications.
Start building for free

Introducing Twilio Proxy


  • Deploy and moderate private interactions between a customer and a mobile worker representing a business.
  • Works with text, phone calls, chat, and messaging apps.
  • Available in developer preview.

Today we’re excited to introduce you to Twilio Proxy, a declarative API for powering private text and voice conversations between your customers and mobile workers. Accessible via a simple-to-use API, Proxy connects any two individuals with just a few lines of code and lets you set up and moderate the conversations on your platform.

Now with Twilio Proxy, developers can quickly deploy a service that’s built for companies that want to connect people with each other safely and securely such as delivery people, on-demand car drivers, rental hosts, tutors, technicians, buyers & sellers and crowdsourced support.It’s crucial to protect the privacy of both parties and filter inappropriate content out of the conversation. Proxy makes it possible to communicate directly with customers without going through a central contact center or dispatch service.

Proxy also comes with support for two-way communications over voice, SMS, and messaging services such as Facebook Messenger, Slack, WeChat, Twitter, Viber, LINE, BlackBerry Messenger, HipChat, and Kik. So with just a few lines of code, companies instantly gain the ability to bridge communications across different channels, hide personal information, control the length of time for two people to be connected, and moderate the content being shared on their platforms even though the two participants are using their own devices.

No Hassle, Ready to Deploy

We’ve all experienced the pain of not knowing where our rideshare driver is and the delight of being able to talk with them directly to sort things out. Being able to connect with the right person at the right time is really convenient, but what most don’t realize is what’s going on behind the scenes to make these secure interactions possible. Those communications are being handled by proxied, or masked, phone numbers that act as a middle layer between two participants.

While sending an SMS or handling a voice call with Twilio is easy, fully managing and routing one-to-one communications at scale is a huge challenge that most developers only realize after starting down the path of building a solution for themselves. The types of problems they’ll need to solve are:

  • SMS has no concept of session management; developers have to create and store conversations themselves.
  • Managing multiple phone numbers can become extremely complex, particularly as solutions are scaled up. Working out how to use the minimum amount of numbers for the most amount of sessions is a difficult problem.
  • Recording what’s happening in every conversation means additional logic to build and data to store.
  • Handling the proxying and routing yourself means building and maintaining code.
  • The individuals you wish to connect may be different channels, such as a customer on SMS talking to a customer on Programmable Chat. Building this yourself means writing custom code for each additional medium you wish to add.

Traditionally you have had to build your way out of all of these problems. With Twilio Proxy, all of that functionality is handled for you, freeing you up to focus exclusively on delivering the best experience for your customers.

How to Create a Proxied Conversation

Getting started with Twilio Proxy is super simple. Let’s start with a voice- and SMS-capable proxied conversation. The steps are:

  1. Create a Proxy service that will act as a container for the sessions we’ll create.
  2. Add at least one Twilio phone number to use for our proxied communications.
  3. Create a session and add two participants.

Let’s get started!

Create Proxy service

This will be our container for all the proxied conversations (sessions) we’ll create. It’ll also act as the container for Twilio numbers we want to use.

require 'twilio-ruby'

# Get your Account SID and Auth Token from
auth_token = 'your_auth_token'

@client =, auth_token)

# Create a new service and make note of that service's SID.
new_service =  "Demo test")
puts "Created Proxy service #{new_service.sid}"

Add a Twilio phone number

With our service created, it’s time to add a Twilio phone number to our service. You can purchase a Twilio phone number by visiting this page. Once you purchase a number, you can use its SID (String Identifier) to add it to the Proxy service:

# Retrieve our Proxy service

 phone_number = service.phone_numbers.create(

OK! We’ve got a Proxy service with a Twilio number assigned.

Create a session

We’re ready to create a conversation session, add participants to it, and get some proxied communications going!

# Retrieve our Proxy service

# Create our session - a single conversation
session = service.sessions.create(
  unique_name: "MyFirstSession"  

# Add our first participant
participantA = session.participants.create(
  identifier: "+15558675309",
  friendly_name: "Alice"

# Add our second participant
participantB = session.participants.create(
  identifier: "+15017250604",
  friendly_name: "Bob"

# Retrieve the Twilio proxy numbers assigned to the two participants

We could connect the two participants via an app or other experience, but for this demo let’s get them talking by sending them both a message they can reply to:

# Message our first participant
firstMessage = participantA.message_interactions.create(
  body: "Reply to this message to chat!"

# and our second
secondMessage = = participantB.message_interactions.create(
  body: "Reply to this message to chat!"

That’s it! Both participants (Alice and Bob) will now receive those messages and they can text and call over the proxy number.

How to Sign up

Proxy is available today in developer preview to a limited number of accounts. If you’re a business that has a mobile workforce such as delivery people, on-demand car drivers, rental hosts, tutors, technicians, and other field representatives, we’d love to hear from you. Request access here and if there’s a match, we’ll get back to you with more details on how to get started.

Support for SMS and Voice with more Channels and features are coming soon.

We can’t wait to see what you build.

Sign up and start building
Not ready yet? Talk to an expert.