Skip to contentSkip to navigationSkip to topbar
On this page

Event Streams


The Event Streams REST API provides access to a unified stream of every interaction sent or received on Twilio. Event Streams supports streaming events to multiple sinks (destinations), unlike the single-producer-to-single-consumer model. Event Streams provides the following capabilities:


Event Streams overview

event-streams-overview page anchor

Twilio logs actions within our platform as events. Use the Event Streams REST API to set up and manage subscriptions to specific events. You can stream events to multiple sinks (destinations).

Event Streams subscriptions and sinks

event-streams-subscriptions-and-sinks page anchor

An Event Streams subscription specifies the event types and schema versions that you want to receive. A sink is the destination for your subscription. You can configure Event Streams to send events to Amazon Kinesis, Segment, or webhooks.

Guaranteed at-least-once delivery

guaranteed-at-least-once-delivery page anchor

Event Streams guarantees at-least-once delivery of events. Twilio sends each event to your system at least once, and we might send the same event more than once when retrying delivery after a failure. Learn more about delivery retries and dealing with duplicate events.

Asynchronous event delivery

asynchronous-event-delivery page anchor

Receiving events in order isn't guaranteed. Event Streams might deliver events out of order, especially when retrying delivery. All events have timestamps that you can use to determine the order of events.

Differences between Event Streams and webhooks

differences-between-event-streams-and-webhooks page anchor

Event Streams is additive and doesn't replace webhooks. Twilio continues to support existing webhooks and add new webhooks for TwiML use cases and for customers who prefer per-channel integrations.

Some Twilio webhooks are informational, while others require a response in Twilio Markup Language (TwiML). The delivery of an event using Event Streams is similar to an informational webhook.

Event Streams isn't a replacement for webhooks that respond with TwiML, because Twilio delivers events asynchronously and there is no bi-directional channel to send a response to an event. If you need to take action in response to an event, then you'll need to do so outside of the Event Streams channel and product.

Event Streams has advantages over informational webhooks:

  • Event Streams provides a consistent format for all data, making it easier to consume when you're using multiple products or a product that's built on top of multiple products, such as Flex and Studio.
  • Event Streams provides at-least-once delivery of events. If an event isn't delivered, because of an error within Twilio or an error from your server, then Event Streams attempts redelivery.
  • Event Streams supports Amazon Kinesis and Segment sinks.
  • The maximum retention period for application logs through Event Streams is seven days.
  • The maximum retention period for error logs is 23 days at the account level.

Event Streams for subaccounts

event-streams-for-subaccounts page anchor

Event Streams supports both ISVs (Independent Software Vendors) and direct customers. You can configure Event Streams for subaccounts, but there is no way to receive events from all subaccounts with a single Event Streams subscription. Instead, create an Event Streams subscription for each subaccount.

Event Streams is available at no additional cost. You pay only for the underlying Twilio products that generate the events.


Get started with Event Streams

get-started-with-event-streams page anchor

You can start using Event Streams by creating Sink and Subscription resources. The following guides can help you get started with the Event Streams API:

We also provide helper libraries for popular programming languages to help you integrate Event Streams.


Event Streams API resources

event-streams-api-resources page anchor

To build with Event Streams, use the following API resources:

  • Event Type resource: the event types that are available through the Event Streams API.
  • Sink resource: the destinations to deliver the subscribed events to.
  • Subscription resource: subscribe to specific Twilio events and versions.
  • Schema resource: the Event Type schemas that define the organization of information within events.

You can have up to 100 Sink resources and 100 Subscription resources per account. Every subaccount can also have up to 100 Sink resources and 100 Subscription resources.