NAME

Twilio::Rest::Webhooks::V1::Operation - The Operation resource

SYNOPSIS

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

for my $operation ($client->webhooks->v1->operations->read({}, 20)) {
  ...
}
my $operation = $client->webhooks->v1->operations($operation_id)->fetch;

DESCRIPTION

This file holds OperationList, OperationPage, OperationContext and OperationInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

OperationList

Returned by $client->webhooks->v1->operations. See also Twilio::ListResource.

read

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

Returns a paginated list of async Rule operations. Use this endpoint to recover a lost Operation-Id — for example, after a process crash before the ID was persisted. Results are sorted by createdAt descending (newest first). Returns the records as a list, fetching as many pages as it needs.

The options are:

resource_id

Filter operations affecting a specific resource ID

status

Filter by operation state One of PENDING, RUNNING, COMPLETED, CANCELLED or FAILED.

stream

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

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

page

my $page = $client->webhooks->v1->operations->page(\%options, $page_size, $page_token);

Fetches one page, and returns a Twilio::TokenPaginationPage. This API pages by token, so there is no page number.

get_page

my $page = $client->webhooks->v1->operations->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->webhooks->v1->operations->get_context($operation_id);

Returns a OperationContext, and makes no request.

OperationPage

A Twilio::Page of OperationInstance objects.

records_key

build_instance

Used by Twilio::Page.

OperationContext

Returned by $client->webhooks->v1->operations($operation_id). It makes no request until one of these methods is called.

fetch

my $operation = $client->webhooks->v1->operations($operation_id)->fetch;

Check status of an async Rule operation. ### Operation Lifecycle Operations transition from PENDING to COMPLETED status within 30-60 seconds of a Rule mutation being accepted (202 Accepted with Operation-Id header). Returns a OperationInstance.

OperationInstance

See also Twilio::InstanceResource.

It has fetch, which work as they do on the context.

Its fields are:

completed_at

A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

created_at

A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

error

Present only when status is FAILED

id

Unique operation identifier (TypeID/TTID format)

resource_id

ID of the affected resource

retention_period

ISO-8601 duration for how long this Operation record is retained after creation (fixed at 7 days)

status

Current state of the operation: - PENDING: Accepted, not yet started - RUNNING: Propagating to all regions (typically 30-60 seconds) - COMPLETED: Rule active globally - CANCELLED: Operation was cancelled before completion - FAILED: Operation could not complete; see error field for details One of PENDING, RUNNING, COMPLETED, CANCELLED or FAILED.

status_url

URL to poll for operation status (same as Location header in 202 response)

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.