NAME

Twilio::Rest::Events::V1::Sink - The Sink resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

my $sink = $client->events->v1->sinks->create($description, $sink_configuration, $sink_type);
for my $sink ($client->events->v1->sinks->read({}, 20)) {
  ...
}
my $sink = $client->events->v1->sinks($sid)->fetch;
$client->events->v1->sinks($sid)->update($description);
$client->events->v1->sinks($sid)->delete;

DESCRIPTION

Sink destination to send events to

This file holds SinkList, SinkPage, SinkContext and SinkInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

SinkList

Returned by $client->events->v1->sinks. See also Twilio::ListResource.

create

my $sink = $client->events->v1->sinks->create($description, $sink_configuration, $sink_type);

Create a new Sink. Returns a SinkInstance.

The required values are:

$description

A human readable description for the Sink This value should not contain PII.

$sink_configuration

The information required for Twilio to connect to the provided Sink encoded as JSON. A hash or array reference, or a string of JSON.

$sink_type

One of kinesis, webhook, segment or email.

read

my @records = $client->events->v1->sinks->read(\%options, $limit, $page_size);

Retrieve a paginated list of Sinks belonging to the account used to make the request. Returns the records as a list, fetching as many pages as it needs.

The options are:

in_use

A boolean query parameter filtering the results to return sinks used/not used by a subscription.

status

A String query parameter filtering the results by status initialized, validating, active or failed.

stream

my $stream = $client->events->v1->sinks->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->events->v1->sinks->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->events->v1->sinks->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->events->v1->sinks->get_context($sid);

Returns a SinkContext, and makes no request.

SinkPage

A Twilio::Page of SinkInstance objects.

records_key

build_instance

Used by Twilio::Page.

SinkContext

Returned by $client->events->v1->sinks($sid). It makes no request until one of these methods is called.

fetch

my $sink = $client->events->v1->sinks($sid)->fetch;

Fetch a specific Sink. Returns a SinkInstance.

update

my $sink = $client->events->v1->sinks($sid)->update($description);

Update a specific Sink. Returns a SinkInstance.

The required values are:

$description

A human readable description for the Sink This value should not contain PII.

delete

$client->events->v1->sinks($sid)->delete;

Delete a specific Sink. Returns true.

sink_test

my $list = $object->sink_test;

See Twilio::Rest::Events::V1::Sink::SinkTest.

sink_validate

my $list = $object->sink_validate;

See Twilio::Rest::Events::V1::Sink::SinkValidate.

SinkInstance

See also Twilio::InstanceResource.

It has fetch, update, delete, sink_test and sink_validate, which work as they do on the context.

Its fields are:

date_created

The date that this Sink was created, given in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

date_updated

The date that this Sink was updated, given in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

description

A human readable description for the Sink

Contains a dictionary of URL links to nested resources of this Sink.

sid

A 34 character string that uniquely identifies this Sink.

sink_configuration

The information required for Twilio to connect to the provided Sink encoded as JSON.

sink_type

One of kinesis, webhook, segment or email.

status

One of initialized, validating, active or failed.

url

The URL of this resource.

CONSTRUCTORS

new

Objects here come from the methods above, so there is no need to call new directly.

LICENSE

Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.