Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Recording Resource

A Recording resource represents the recording associated with a voice call, conference, or SIP Trunk. Using the Recordings REST API you can fetch, start, stop, pause, resume and delete voice recordings.

You can initiate a recording for your call, conference, or trunk via one of the following methods.

  1. <Record> in TwiML
  2. <Dial record> in TwiML
  3. <Conference record> in TwiML
  4. Record=true in an outbound call via the REST API
  5. Enable recording on an elastic SIP Trunk in the Twilio Console
  6. Post to Recording resource of an in-progress Call SID

Recording properties

Names in PHP format
accountSid
sid<AC> Not PII

The SID of the Account that created the Recording resource.

apiVersion
string Not PII

The API version used during the recording.

callSid
sid<CA> Not PII

The SID of the Call the Recording resource is associated with. This will always refer to the parent leg of a two-leg call.

conferenceSid
sid<CF> Not PII

The Conference SID that identifies the conference associated with the recording, if a conference recording.

dateCreated
date_time<rfc2822> Not PII

The date and time in GMT that the resource was created specified in RFC 2822 format.

dateUpdated
date_time<rfc2822> Not PII

The date and time in GMT that the resource was last updated specified in RFC 2822 format.

startTime
date_time<rfc2822> Not PII

The start time of the recording in GMT and in RFC 2822 format.

duration
string Not PII

The length of the recording in seconds.

sid
sid<RE> Not PII

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

price
string Not PII

The one-time cost of creating the recording in the price_unit currency.

priceUnit
string Not PII

The currency used in the price property. Example: USD.

status
enum:status Not PII

The status of the recording. Can be: processing, completed and absent. For information about more detailed statuses on in-progress recordings, check out how to Update a Recording Resource.

channels
integer Not PII

The number of channels in the final recording file. Can be: 1 or 2. You can split a call with two legs into two separate recording channels if you record using TwiML Dial or the Outbound Rest API.

source
enum:source Not PII

How the recording was created. Can be: DialVerb, Conference, OutboundAPI, Trunking, RecordVerb, StartCallRecordingAPI, and StartConferenceRecordingAPI.

errorCode
integer? Not PII

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 recording status is not absent.

uri
uri Not PII

The URI of the resource, relative to https://api.twilio.com.

encryptionDetails
object Not PII

How to decrypt the recording if it was encrypted using Call Recording Encryption feature.

subresourceUris
uri_map Not PII

A list of related resources identified by their relative URIs.

Fetch a Recording resource

get
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Recordings/{Sid}.json

Because the URLs that host individual recordings are useful for many external applications, they are public and do not require HTTP Basic Auth to access. This allows you to embed the recording URL in a web application without revealing your Twilio API credentials.

Twilio's recording URLs are quite long and difficult to guess, so the contents of the recordings should be reasonably private unless you distribute the URL. For added security, you can enforce HTTP basic auth to access media using your AccountSid and Authentication token via the voice settings page in the console.

Parameters
Names in None format
account_sid
Required
get sid<AC> Not PII

The SID of the Account that created the Recording resource to fetch.

sid
Required
get sid<RE> Not PII

The Twilio-provided string that uniquely identifies the Recording resource to fetch.

Example 1
        
        
        
        
        Appending ".json" to the URI will return a familiar JSON representation

        Fetch a Recording

        Appending ".json" to the URI will return a familiar JSON representation

        Response format

        The file extension appended to the recording sid determines the response format.

        File extension Response type Mime type
        (none) WAV file audio/x-wav
        .json JSON document application/json
        .mp3 MP3 file audio/mpeg
        .wav WAV file audio/x-wav
        .xml XML document application/xml

        JSON

        Appending .json to the URI will return a familiar JSON representation, as shown in the example above.

        MP3

        Appending .mp3 to the URI returns a binary MP3 audio file with mime-type type audio/mpeg. For example:

        GET /2010-04-01/Accounts/ACXXXXX.../Recordings/RE557ce644e5ab84fa21cc21112e22c485.mp3
        

        MP3 files have a bitrate of 32kbps

        WAV (default)

        Without an extension, or with .wav, a binary WAV audio file is returned with mime-type audio/x-wav. For example:

        GET /2010-04-01/Accounts/ACXXXXX.../Recordings/RE557ce644e5ab84fa21cc21112e22c485
        

        WAV files have a bitrate of 128kbps.

        XML

        Appending .xml to the URI returns a familiar XML representation.

        Fetch a Recording's transcription

        Each Recording instance resource has a Transcriptions subresource which represents the set of transcriptions generated from the recording (if any):

        /2010-04-01/Accounts/{YourAccountSid}/Recordings/{RecordingSid}/Transcriptions
        

        This will return the set of transcriptions available for the recording identified by {RecordingSid}. See the Transcriptions resource documentation for properties and response formats.

        Read multiple Recording resources

        get
        https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Recordings.json

        This API call returns a list of Recordings, each representing a recording generated during a call. The list returned includes paging information.

        The list of Recordings is protected by your account credentials like most parts of this API. You must use HTTP basic auth to access the Recordings list resource.

        You can also get a list of Recordings from a specific call by including the Call SID in your request like so:

        /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings
        

        This resource is scoped to an individual call or conference so that you can navigate directly from a call to the recordings generated from that call. See the example below.

        Parameters
        Names in None format
        date_created
        Optional
        get date_time_inequality<iso8601> Not PII

        The date_created value, specified as YYYY-MM-DD, of the resources to read. You can also specify inequality: DateCreated<=YYYY-MM-DD will return recordings generated at or before midnight on a given date, and DateCreated>=YYYY-MM-DD returns recordings generated at or after midnight on a date.

        call_sid
        Optional
        get sid<CA> Not PII

        The Call SID of the resources to read.

        conference_sid
        Optional
        get sid<CF> Not PII

        The Conference SID that identifies the conference associated with the recording to read.

        account_sid
        Required
        get sid<AC> Not PII

        The SID of the Account that created the Recording resources to read.

        Example 1
              
              
              
              
              Example 2
                    
                    
                    
                    
                    Example 3
                          
                          
                          
                          
                          Only return recordings generated on Oct 18, 2016

                          Filter recordings by exact date

                          Only return recordings generated on Oct 18, 2016
                          Example 4
                                
                                
                                
                                
                                Only return recordings generated between midnight Oct 12, 2016, and midnight Oct 15, 2016

                                Filter recordings within a given date range

                                Only return recordings generated between midnight Oct 12, 2016, and midnight Oct 15, 2016

                                Delete a Recording resource

                                delete
                                https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Recordings/{Sid}.json

                                Deletes a recording from your account. Once the recording is deleted, you will no longer be billed for storage of those minutes.

                                If successful, DELETE returns HTTP 204 (No Content) with no body.

                                Parameters
                                Names in None format
                                account_sid
                                Required
                                delete sid<AC> Not PII

                                The SID of the Account that created the Recording resources to delete.

                                sid
                                Required
                                delete sid<RE> Not PII

                                The Twilio-provided string that uniquely identifies the Recording resource to delete.

                                Example
                                      
                                      
                                      
                                      
                                      Rate this page:

                                      Need some help?

                                      We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.