NAME

Twilio::Rest::Taskrouter::V1::Workspace::Activity - The Activity resource

SYNOPSIS

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

my $activity = $client->taskrouter->v1->workspaces($workspace_sid)->activities->create($friendly_name, \%options);
for my $activity ($client->taskrouter->v1->workspaces($workspace_sid)->activities->read({}, 20)) {
  ...
}
my $activity = $client->taskrouter->v1->workspaces($workspace_sid)->activities($sid)->fetch;
$client->taskrouter->v1->workspaces($workspace_sid)->activities($sid)->update(\%options);
$client->taskrouter->v1->workspaces($workspace_sid)->activities($sid)->delete;

DESCRIPTION

This file holds ActivityList, ActivityPage, ActivityContext and ActivityInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ActivityList

Returned by $client->taskrouter->v1->workspaces($workspace_sid)->activities. See also Twilio::ListResource.

create

my $activity = $client->taskrouter->v1->workspaces($workspace_sid)->activities->create($friendly_name, \%options);

Returns a ActivityInstance.

The required values are:

$friendly_name

A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: on-call, break, and email.

The options are:

available

Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of true, 1, or yes specifies the Activity is available. All other values specify that it is not. The value cannot be changed after the Activity is created.

read

my @records = $client->taskrouter->v1->workspaces($workspace_sid)->activities->read(\%options, $limit, $page_size);

Returns the records as a list, fetching as many pages as it needs.

The options are:

available

Whether return only Activity resources that are available or unavailable. A value of true returns only available activities. Values of '1' or yes also indicate true. All other values represent false and return activities that are unavailable.

friendly_name

The friendly_name of the Activity resources to read.

stream

my $stream = $client->taskrouter->v1->workspaces($workspace_sid)->activities->stream(\%options, $limit, $page_size);

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

page

my $page = $client->taskrouter->v1->workspaces($workspace_sid)->activities->page(\%options, $page_size, $page_token, $page_number);

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

get_page

my $page = $client->taskrouter->v1->workspaces($workspace_sid)->activities->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->taskrouter->v1->workspaces($workspace_sid)->activities->get_context($sid);

Returns a ActivityContext, and makes no request.

ActivityPage

A Twilio::Page of ActivityInstance objects.

records_key

build_instance

Used by Twilio::Page.

ActivityContext

Returned by $client->taskrouter->v1->workspaces($workspace_sid)->activities($sid). It makes no request until one of these methods is called.

fetch

my $activity = $client->taskrouter->v1->workspaces($workspace_sid)->activities($sid)->fetch;

Returns a ActivityInstance.

update

my $activity = $client->taskrouter->v1->workspaces($workspace_sid)->activities($sid)->update(\%options);

Returns a ActivityInstance.

The options are:

friendly_name

A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: on-call, break, and email.

delete

$client->taskrouter->v1->workspaces($workspace_sid)->activities($sid)->delete;

Returns true.

ActivityInstance

See also Twilio::InstanceResource.

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

Its fields are:

account_sid

The SID of the Account that created the Activity resource.

available

Whether the Worker is eligible to receive a Task when it occupies the Activity. A value of true, 1, or yes indicates the Activity is available. All other values indicate that it is not. The value cannot be changed after the Activity is created.

date_created

The date and time in GMT when the resource was created specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

date_updated

The date and time in GMT when the resource was last updated specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

friendly_name

The string that you assigned to describe the Activity resource.

No description in the specification.

sid

The unique string that we created to identify the Activity resource.

url

The absolute URL of the Activity resource.

workspace_sid

The SID of the Workspace that contains the Activity.

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.