NAME

Twilio::Rest::Taskrouter::V1::Workspace::Task::Reservation - The Reservation resource

SYNOPSIS

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

for my $reservation ($client->taskrouter->v1->workspaces($workspace_sid)->tasks($task_sid)->reservations->read({}, 20)) {
  ...
}
my $reservation = $client->taskrouter->v1->workspaces($workspace_sid)->tasks($task_sid)->reservations($sid)->fetch;
$client->taskrouter->v1->workspaces($workspace_sid)->tasks($task_sid)->reservations($sid)->update(\%options);

DESCRIPTION

Tasks reserved for workers

This file holds ReservationList, ReservationPage, ReservationContext and ReservationInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ReservationList

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

read

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

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

The options are:

reservation_status

Returns the list of reservations for a task with a specified ReservationStatus. Can be: pending, accepted, rejected, or timeout. One of pending, accepted, rejected, timeout, canceled, rescinded, wrapping or completed.

worker_sid

The SID of the reserved Worker resource to read.

stream

my $stream = $client->taskrouter->v1->workspaces($workspace_sid)->tasks($task_sid)->reservations->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)->tasks($task_sid)->reservations->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)->tasks($task_sid)->reservations->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

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

Returns a ReservationContext, and makes no request.

ReservationPage

A Twilio::Page of ReservationInstance objects.

records_key

build_instance

Used by Twilio::Page.

ReservationContext

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

fetch

my $reservation = $client->taskrouter->v1->workspaces($workspace_sid)->tasks($task_sid)->reservations($sid)->fetch;

Returns a ReservationInstance.

update

my $reservation = $client->taskrouter->v1->workspaces($workspace_sid)->tasks($task_sid)->reservations($sid)->update(\%options);

Returns a ReservationInstance.

The options are:

beep

Whether to play a notification beep when the participant joins or when to play a beep. Can be: true, false, onEnter, or onExit. The default value is true.

beep_on_customer_entrance

Whether to play a notification beep when the customer joins.

call_accept

Whether to accept a reservation when executing a Call instruction.

call_from

The Caller ID of the outbound call when executing a Call instruction.

call_record

Whether to record both legs of a call when executing a Call instruction or which leg to record.

call_status_callback_url

The URL to call for the completed call event when executing a Call instruction.

call_timeout

Timeout for call when executing a Call instruction.

call_to

The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the E.164 formatted phone number, depending on the destination.

call_url

TwiML URI executed on answering the worker's leg as a result of the Call instruction.

conference_record

Whether to record the conference the participant is joining or when to record the conference. Can be: true, false, record-from-start, and do-not-record. The default value is false.

conference_recording_status_callback

The URL we should call using the conference_recording_status_callback_method when the conference recording is available.

conference_recording_status_callback_method

The HTTP method we should use to call conference_recording_status_callback. Can be: GET or POST and defaults to POST. One of GET or POST.

conference_status_callback

The URL we should call using the conference_status_callback_method when the conference events in conference_status_callback_event occur. Only the value set by the first participant to join the conference is used. Subsequent conference_status_callback values are ignored.

conference_status_callback_event

The conference status events that we will send to conference_status_callback. Can be: start, end, join, leave, mute, hold, speaker. One of start, end, join, leave, mute, hold or speaker. An array reference.

conference_status_callback_method

The HTTP method we should use to call conference_status_callback. Can be: GET or POST and defaults to POST. One of GET or POST.

conference_trim

How to trim the leading and trailing silence from your recorded conference audio files. Can be: trim-silence or do-not-trim and defaults to trim-silence.

dequeue_from

The Caller ID of the call to the worker when executing a Dequeue instruction.

dequeue_post_work_activity_sid

The SID of the Activity resource to start after executing a Dequeue instruction.

dequeue_record

Whether to record both legs of a call when executing a Dequeue instruction or which leg to record.

dequeue_status_callback_event

The Call progress events sent via webhooks as a result of a Dequeue instruction. An array reference.

dequeue_status_callback_url

The Callback URL for completed call event when executing a Dequeue instruction.

dequeue_timeout

Timeout for call when executing a Dequeue instruction.

dequeue_to

The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the E.164 formatted phone number, depending on the destination.

early_media

Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is true.

end_conference_on_customer_exit

Whether to end the conference when the customer leaves.

end_conference_on_exit

Whether to end the conference when the agent leaves.

from

The Caller ID of the call to the worker when executing a Conference instruction.

instruction

The assignment instruction for reservation.

jitter_buffer_size

The jitter buffer size for conference. Can be: small, medium, large, off.

max_participants

The maximum number of participants in the conference. Can be a positive integer from 2 to 250. The default value is 250.

muted

Whether the agent is muted in the conference. The default is false.

post_work_activity_sid

The new worker activity SID after executing a Conference instruction.

record

Whether to record the participant and their conferences, including the time between conferences. The default is false.

recording_channels

The recording channels for the final recording. Can be: mono or dual and the default is mono.

recording_status_callback

The URL that we should call using the recording_status_callback_method when the recording status changes.

recording_status_callback_method

The HTTP method we should use when we call recording_status_callback. Can be: GET or POST and defaults to POST. One of GET or POST.

redirect_accept

Whether the reservation should be accepted when executing a Redirect instruction.

redirect_call_sid

The Call SID of the call parked in the queue when executing a Redirect instruction.

redirect_url

TwiML URI to redirect the call to when executing the Redirect instruction.

region

The region where we should mix the recorded audio. Can be:us1, us2, ie1, de1, sg1, br1, au1, or jp1.

reservation_status

One of pending, accepted, rejected, timeout, canceled, rescinded, wrapping or completed.

sip_auth_password

The SIP password for authentication.

sip_auth_username

The SIP username used for authentication.

start_conference_on_enter

Whether to start the conference when the participant joins, if it has not already started. The default is true. If false and the conference has not started, the participant is muted and hears background music until another participant starts the conference.

status_callback

The URL we should call using the status_callback_method to send status information to your application.

status_callback_event

The call progress events that we will send to status_callback. Can be: initiated, ringing, answered, or completed. One of initiated, ringing, answered or completed. An array reference.

status_callback_method

The HTTP method we should use to call status_callback. Can be: POST or GET and the default is POST. One of GET or POST.

supervisor

The Supervisor SID/URI when executing the Supervise instruction.

supervisor_mode

One of monitor, whisper or barge.

timeout

Timeout for call when executing a Conference instruction.

to

The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the E.164 formatted phone number, depending on the destination.

wait_method

The HTTP method we should use to call wait_url. Can be GET or POST and the default is POST. When using a static audio file, this should be GET so that we can cache the file. One of GET or POST.

wait_url

The URL we should call using the wait_method for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. Learn more about hold music.

worker_activity_sid

The new worker activity SID if rejecting a reservation.

if_match

The If-Match HTTP request header

ReservationInstance

See also Twilio::InstanceResource.

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

Its fields are:

account_sid

The SID of the Account that created the TaskReservation resource.

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.

The URLs of related resources.

reservation_status

One of pending, accepted, rejected, timeout, canceled, rescinded, wrapping or completed.

sid

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

task_sid

The SID of the reserved Task resource.

url

The absolute URL of the TaskReservation reservation.

worker_name

The friendly_name of the Worker that is reserved.

worker_sid

The SID of the reserved Worker resource.

workspace_sid

The SID of the Workspace that this task is contained within.

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.