The Joints Of The Contact Center: Twilio’s Sync API

January 19, 2021
Written by
Karla Nussbaumer
Opinions expressed by Twilio contributors are their own

Sync Joints of the Contact Center Header

Have you ever thought how fascinating the human body is? Simple activities like walking are such a complicated process. The motion of your two legs is coordinated, so that one foot or the other is always in contact with the ground. While the brain is sending signals to precise the coordination of our muscles. More parts of the body play an important role to make it happen.

But – how can everything be held together without falling apart? That’s thanks to joints, ligaments, and tendons.

Just like our body needs joints, any product or service needs its equivalent. For instance, imagine a contact center. It consists of multiple applications for routing, reporting, connecting 3rd party systems,  storing and transferring data, managing omnichannel interactions, and so on.

All of a contact center’s services and applications have to work together. To do that, a connector is needed –Twilio Sync is that link.

Twilio Sync API

Such as our aforementioned ligaments and joints, Twilio’s Sync API connects other Twilio APIs and features. Twilio Sync is responsible for state synchronization across your applications – and it does it all within milliseconds.

Numerous customers (such as ING) have built their own contact center using Twilio APIs. For many to accomplish this, our Sync API played a key role by gluing our other APIs together. Today, Twilio Flex, a programmable contact center, includes the Sync API as part of the Flex user subscription. And the Sync API is tailored towards some specific use cases to satisfy high customer expectations.

Sync is the heartbeat of the programmable contact center. It powers contextual communication, statistics, call states, and delivers powerful use cases such as canned responses, opening hours, queue dashboards, scheduled SMSes, disposition codes, curbside pickup, and directory services – to mention only a few.  

Let me explain a few of these uses cases:

  • Canned Responses: Many customers use Sync to store canned responses (i.e., Response management tool). Agents working on any digital channel won’t need to type in every response. They have a set of pre-written messages that they can drop into a conversation with a customer. Canned responses make the process of answering questions simple and less time consuming. Additionally, contact centers keep the same responses across all agents.

    In this use case, Sync stores your canned responses, and distributes them to the agents. Agents have the ability to filter and search in this list. Then, they can drag the content of the response into the conversation.
  • Scheduled SMSes: An insurance company in LA required a system for scheduling SMSes. Twilio’s Sync API was used to queue up a JSON representation of an SMS message when the message was ‘sent’ during “off hours”. For this, they used Sync Maps.

    Once “on hours”, they iterated through the messages, sent them out, and deleted the JSON from the Sync map. A Sync map was created for each timezone. The messages are stored and sent in accordance with the timezone of the customer’s system.
  • Disposition / Wrap-up Codes: To categorize work handled by agents, companies use Disposition or Wrap-up Codes. This categorization breaks down all the traffic that comes into the contact center, and assigns these categories.

    Managers and supervisors can understand why customers are interacting with the contact center by later auditing these classifications. An agent will usually set the disposition or wrap-up code during a conversation,  or perhaps shortly after a conversation has finished. After, this data will be stored for reporting purposes.

    Customers and partners have leveraged Sync Maps to store all these codes.
  • Customer Data: A leading charity organization, needed to show specific customer data to the agents when they receive an incoming conversation. The customer solved it by creating a Flex Plugin that pulls this specific information from the Sync API.

    Customers can also store content related to the conversation and present agents with a list of Knowledge Base articles to better assist the end-user.  

We have reviewed some common Sync use cases. Let’s cover some tactics and best practices to build your applications using the Sync API.

Tips for building with Sync API

The Twilio Sync API makes it easy to get started storing and accessing a wide range of data. Sync is meant to connect different APIs together or to build specific functionality to satisfy your end-users’ requests. There is no need to wait for new features – you can just build them yourself.  

The following tips will help you build a scalable application from the start, rather than having to rip out and reimagine a piece of functionality later.



Build a proper backend service to collect and store the needed data. This is the most scalable method for production applications.

If you are using Sync from Twilio Functions: don’t use it for large production apps due to Sync’s limitation of only 20 read/writes per second.

Remember that Sync includes several hard limits, set to protect our customers and our infrastructure. If you start to hit 429 errors during a traffic burst, we highly recommend that you implement exponential backoff retry logic as described here.

Don’t forget that Sync is not a database; it is a state synchronization tool. Store only short-term and relevant data in Twilio Sync. It will not scale well if it is used as a large database.

Design your application so that there is no global Sync object. Using a single global map / document / list to store everything is an anti-pattern and results in a bottleneck for frequent updates.

Don’t make any Sync object a single point of failure.

For example, don’t store all the agents in a single Sync Map and update it frequently. Instead, create a Sync Map for each agent and update just dedicated items of the map. (i.e. agent’s availability, support level, name, etc.)

An important note: the Twilio Console does not currently support visualization of the Sync API activity. However, if you need a visualization tool, a Twilio partner, Impekable, created an app called was built on top of the Sync library to synchronize your applications with a single source of state in the cloud.

Screenshot of a syncdb console

Another visualization tool built by a Twilion, Dominik Kundel, is called Twilio Sync Inspector.  It offers a view of available Sync services, resources by type (documents, maps and lists), and auto updates the inspector view based on remote changes.

Secure scalable sync applications

Now you know the tips you’ll need to build scalable applications with Sync. Let’s cover how to make them secure.

Sync SDKs use 2 levels of security control:

  1. The Access Token issued by your application backend, and secured by any method that you consider suitable.
  2. The actual access control where you decide which token gives access to which Sync object. We’ve created a very detailed step-by-step guide on how to build a secure Sync App.

Keep in mind that Sync never logs or sends any customer data in object payloads to its telemetry system. Additionally, Sync handles PII (Personally Identifiable Information) according to GDPR and HIPAA requirements. Sync data is encrypted at rest. And Sync does not store logs longer than 30 days.

Connecting your contact center with the Sync API

As we discussed in this blog, the Sync API is a key component to connect different APIs and to synchronize data across your distributed applications.

Sync use cases enrich and enhance the relationship between your contact center users (agents, supervisors, CC managers, and end-users) by delivering contextual information. This information might include what customers are searching for, or viewing on your webpage or in your application. All this relevant data helps organizations make better decisions based on customer activity and interest. The key benefit of Sync lies in giving each of your customers a more personalized experience through real-time data.

For more information on the Sync API, please visit the following links:

Karla is Head of Technical Marketing at Twilio. She is responsible for establishing Twilio Flex as the leader in the contact center market. With technical consulting, research and storytelling as her core skills, she has developed and executed programs to increase Flex growth in the industry. Before Twilio, she held product marketing and sales roles in the contact center and collaboration industry. Her experience spans across several technologies to develop GTM strategies and increase revenue.