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:
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).
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.
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.
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.
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 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.
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.
To build with Event Streams, use the following API resources:
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.