NAME
Twilio::Rest::Api::V2010::Account::Call::Recording - The Recording resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $recording = $client->calls($call_sid)->recordings->create(\%options);
for my $recording ($client->calls($call_sid)->recordings->read({}, 20)) {
...
}
my $recording = $client->calls($call_sid)->recordings($sid)->fetch;
$client->calls($call_sid)->recordings($sid)->update($status, \%options);
$client->calls($call_sid)->recordings($sid)->delete;
DESCRIPTION
A Recording resource represents the recording associated with a voice call, conference, or SIP Trunk.
This file holds RecordingList, RecordingPage, RecordingContext and RecordingInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
RecordingList
Returned by $client->calls($call_sid)->recordings. See also Twilio::ListResource.
create
my $recording = $client->calls($call_sid)->recordings->create(\%options);
Create a recording for the call. Returns a RecordingInstance.
The options are:
recording_channels-
The number of channels used in the recording. Can be:
monoordualand the default ismono.monorecords all parties of the call into one channel.dualrecords each party of a 2-party call into separate channels. recording_configuration_id-
The identifier of the configuration to be used when creating and processing the recording
recording_status_callback-
The URL we should call using the
recording_status_callback_methodon each recording event specified inrecording_status_callback_event. For more information, see RecordingStatusCallback parameters. recording_status_callback_event-
The recording status events on which we should call the
recording_status_callbackURL. Can be:in-progress,completedandabsentand the default iscompleted. Separate multiple event values with a space. An array reference. recording_status_callback_method-
The HTTP method we should use to call
recording_status_callback. Can be:GETorPOSTand the default isPOST. One ofGETorPOST. recording_track-
The audio track to record for the call. Can be:
inbound,outboundorboth. The default isboth.inboundrecords the audio that is received by Twilio.outboundrecords the audio that is generated from Twilio.bothrecords the audio that is received and generated by Twilio. trim-
Whether to trim any leading and trailing silence in the recording. Can be:
trim-silenceordo-not-trimand the default isdo-not-trim.trim-silencetrims the silence from the beginning and end of the recording anddo-not-trimdoes not.
read
my @records = $client->calls($call_sid)->recordings->read(\%options, $limit, $page_size);
Retrieve a list of recordings belonging to the call used to make the request. Returns the records as a list, fetching as many pages as it needs.
The options are:
date_created-
The
date_createdvalue, specified asYYYY-MM-DD, of the resources to read. You can also specify inequality:DateCreated<=YYYY-MM-DDwill return recordings generated at or before midnight on a given date, andDateCreated>=YYYY-MM-DDreturns recordings generated at or after midnight on a date. A string, or an object with anepochmethod. See "iso8601_date_time" in Twilio::Serialize. date_created_before-
The
date_createdvalue, specified asYYYY-MM-DD, of the resources to read. You can also specify inequality:DateCreated<=YYYY-MM-DDwill return recordings generated at or before midnight on a given date, andDateCreated>=YYYY-MM-DDreturns recordings generated at or after midnight on a date. A string, or an object with anepochmethod. See "iso8601_date_time" in Twilio::Serialize. date_created_after-
The
date_createdvalue, specified asYYYY-MM-DD, of the resources to read. You can also specify inequality:DateCreated<=YYYY-MM-DDwill return recordings generated at or before midnight on a given date, andDateCreated>=YYYY-MM-DDreturns recordings generated at or after midnight on a date. A string, or an object with anepochmethod. See "iso8601_date_time" in Twilio::Serialize.
stream
my $stream = $client->calls($call_sid)->recordings->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->calls($call_sid)->recordings->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->calls($call_sid)->recordings->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->calls($call_sid)->recordings->get_context($sid);
Returns a RecordingContext, and makes no request.
RecordingPage
A Twilio::Page of RecordingInstance objects.
records_key
build_instance
Used by Twilio::Page.
RecordingContext
Returned by $client->calls($call_sid)->recordings($sid). It makes no request until one of these methods is called.
fetch
my $recording = $client->calls($call_sid)->recordings($sid)->fetch;
Fetch an instance of a recording for a call. Returns a RecordingInstance.
update
my $recording = $client->calls($call_sid)->recordings($sid)->update($status, \%options);
Changes the status of the recording to paused, stopped, or in-progress. Note: Pass Twilio.CURRENT instead of recording sid to reference current active recording. Returns a RecordingInstance.
The required values are:
The options are:
pause_behavior-
Whether to record during a pause. Can be:
skiporsilenceand the default issilence.skipdoes not record during the pause period, whilesilencewill replace the actual audio of the call with silence during the pause period. This parameter only applies when settingstatusis set topaused.
delete
$client->calls($call_sid)->recordings($sid)->delete;
Delete a recording from your account. Returns true.
RecordingInstance
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 Recording resource.
- api_version
-
The API version used to make the recording.
- call_sid
-
The SID of the Call the Recording resource is associated with.
- channels
-
The number of channels in the final recording file. Can be:
1, or2. Separating a two leg call into two separate channels of the recording file is supported in Dial and Outbound Rest API record options. - conference_sid
-
The Conference SID that identifies the conference associated with the recording, if a conference recording.
- date_created
-
The date and time in GMT that the resource was created specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date and time in GMT that the resource was last updated, specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- duration
-
The length of the recording in seconds.
- encryption_details
-
How to decrypt the recording if it was encrypted using Call Recording Encryption feature.
- error_code
-
The error code that describes why the recording is
absent. The error code is described in our Error Dictionary. This value is null if the recordingstatusis notabsent. - price
-
The one-time cost of creating the recording in the
price_unitcurrency. - price_unit
-
The currency used in the
priceproperty. Example:USD. - sid
-
The unique string that that we created to identify the Recording resource.
- source
-
One of
DialVerb,Conference,OutboundAPI,Trunking,RecordVerb,StartCallRecordingAPIorStartConferenceRecordingAPI. - start_time
-
The start time of the recording in GMT and in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- status
-
One of
in-progress,paused,stopped,processing,completedorabsent. - track
-
The recorded track. Can be:
inbound,outbound, orboth. - uri
-
The URI of the resource, relative to
https://api.twilio.com.
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.