Sinks are the destinations to which events selected in a subscription will be delivered. Each sink has a sink_type
property. At this time, the Sink resource supports three types: AWS Kinesis indicated by the value kinesis
, Webhooks indicated by the value webhook
, and Segment indicated by the value segment
. Each Sink has a sink_configuration
property which expresses its set up.
Not seeing a sink type you would like to configure? Submit a sink type request.
An example of the sink_configuration
object for a Kinesis Sink:
_10"sink_configuration": { _10 "arn": "arn:aws:kinesis:us-east-1:111111111:stream/test", _10 "role_arn": "arn:aws:iam::111111111:role/Role", _10 "external_id": "a secret value here"_10}
Parameter | Description |
---|---|
arn | The Amazon Resource Identifier for the Kinesis stream. |
role_arn | The Amazon Resource Identifier for the AWS role that has write access to the Kineses stream specified arn . |
external_id | An ID added to the role specified in role_arn which AWS requires in order to grant a third party access to a given resource. It helps prevent what is known as the Confused Deputy Problem. |
Here is an example of the sink_configuration
object for a Webhook Sink:
_10"sink_configuration": { _10 "destination": "http://example.org/webhook",_10 "method": "<POST|GET>"_10}
Parameter | Description |
---|---|
destination | The customers' url endpoint i.e http://example.org/webhook |
method | The HTTP method for updating the data on the webhook. The currently available options are GET and POST . |
Here is an example of the sink_configuration
object for a Segment Sink:
_10"sink_configuration": { _10 "write_key": "lwfOUDBL0VK33XstNWD3uJ7Eei2BdgY3"_10}
Parameter | Description |
---|---|
write_key | Segment write key for the Segment source that you will use |
A 34 character string that uniquely identifies this Sink.
^DG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The information required for Twilio to connect to the provided Sink encoded as JSON.
The Sink type. Can only be "kinesis" or "webhook" currently.
kinesis
webhook
segment
The Status of this Sink. One of initialized
, validating
, active
or failed
.
initialized
validating
active
failed
Contains a dictionary of URL links to nested resources of this Sink.
POST https://events.twilio.com/v1/Sinks
A human readable description for the Sink This value should not contain PII.
The information required for Twilio to connect to the provided Sink encoded as JSON.
The Sink type. Can only be "kinesis" or "webhook" currently.
kinesis
webhook
segment
GET https://events.twilio.com/v1/Sinks/{Sid}
Fetches a Sink configuration by its SID.
A 34 character string that uniquely identifies this Sink.
^DG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
GET https://events.twilio.com/v1/Sinks
Gets a list of all Sinks belonging to the account associated with the request. Supports pagination.
A boolean query parameter filtering the results to return sinks used/not used by a subscription.
A String query parameter filtering the results by status initialized
, validating
, active
or failed
.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
POST https://events.twilio.com/v1/Sinks/{Sid}
Updates the description of a Sink
A 34 character string that uniquely identifies this Sink.
^DG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A human readable description for the Sink This value should not contain PII.
DELETE https://events.twilio.com/v1/Sinks/{Sid}
Deletes the Sink with the specified SID. If the Sink has a Subscription associated with it, the Subscription must be deleted first in order to delete the Sink.
A 34 character string that uniquely identifies this Sink.
^DG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34