Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Programmable Video Rest API: Recordings


(warning)

Warning

This documentation is for reference only. We are no longer onboarding new customers to Programmable Video. Existing customers can continue to use the product until December 5, 2026(link takes you to an external page).

We recommend migrating your application to the API provided by our preferred video partner, Zoom. We've prepared this migration guide(link takes you to an external page) to assist you in minimizing any service disruption.


Overview

overview page anchor

Twilio Video's Group Rooms and Recording APIs allow you to record the audio and video shared in a Programmable Video Room. To turn on Recording in a Group Room, set the RecordParticipantsOnConnect property to true when creating the Room. Check the Rooms REST API documentation for additional information.

All Recording resources are located beneath the following Base URL.


_10
https://video.twilio.com

(warning)

Warning

legal-implications-of-call-recording page anchor

If you choose to record voice or video calls, you need to comply with certain laws and regulations, including those regarding obtaining consent to record (such as California's Invasion of Privacy Act and similar laws in other jurisdictions). Additional information on the legal implications of call recording can be found in the "Legal Considerations with Recording Voice and Video Communications" Help Center article(link takes you to an external page).

Notice: Twilio recommends that you consult with your legal counsel to make sure that you are complying with all applicable laws in connection with communications you record or store using Twilio.



Recording instance resource

recording-instance-resource page anchor

Recordings captured by Programmable Video products are single-track, single-media and stored in a single file format.

Recordings are represented through a REST API with the following URI scheme:


_10
/v1/Recordings/{RecordingSid}

Resource properties

resource-properties page anchor

A Recording has the following properties:

Resource properties
account_sidtype: SID<AC>Not PII

The SID of the Account(link takes you to an external page) that created the Recording resource.


statustype: enum<STRING>Not PII

The status of the recording. Can be: processing, completed, or deleted. processing indicates the recording is still being captured; completed indicates the recording has been captured and is now available for download. deleted means the recording media has been deleted from the system, but its metadata is still available.

Possible values:
processingcompleteddeletedfailed

date_createdtype: string<DATE TIME>Not PII

The date and time in GMT when the resource was created specified in ISO 8601(link takes you to an external page) format.


sidtype: SID<RT>Not PII

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


source_sidtype: SIDNot PII

The SID of the recording source. For a Room Recording, this value is a track_sid.


sizetype: integer<INT64>Not PII

The size of the recorded track, in bytes.


urltype: string<URI>Not PII

The absolute URL of the resource.


typetype: enum<STRING>Not PII

The recording's media type. Can be: audio or video.

Possible values:
audiovideodata

durationtype: integerNot PII

The duration of the recording in seconds rounded to the nearest second. Sub-second tracks have a Duration property of 1 second


container_formattype: enum<STRING>Not PII

The file format for the recording. Can be: mka or mkv. Video Room recordings are captured in Matroska container format(link takes you to an external page), mka is for audio files and mkv for video files.

Possible values:
mkamkv

codectype: enum<STRING>Not PII

The codec used to encode the track. Can be: VP8, H264, OPUS, and PCMU.

Possible values:
VP8H264OPUSPCMU

grouping_sidstype: objectNot PII

A list of SIDs related to the recording. Includes the room_sid and participant_sid.


track_nametype: stringPII MTL: 30 days

The name that was given to the source track of the recording. If no name is given, the source_sid is used.


offsettype: integer<INT64>Not PII

The time in milliseconds elapsed between an arbitrary point in time, common to all group rooms, and the moment when the source room of this track started. This information provides a synchronization mechanism for recordings belonging to the same room.


media_external_locationtype: string<URI>Not PII

The URL of the media file associated with the recording when stored externally. See External S3 Recordings for more details.


status_callbacktype: string<URI>Not PII

The URL called using the status_callback_method to send status information on every recording event.


status_callback_methodtype: enum<HTTP METHOD>Not PII

The HTTP method used to call status_callback. Can be: POST or GET, defaults to POST.

Possible values:
GETPOST

linkstype: object<URI MAP>Not PII

The URLs of related resources.

Note: The duration of media tracks is rounded to the nearest second. Thus, sub-second duration tracks have a Duration property of 1 second.

Returns a single Recording Instance resource identified by a RecordingSid.

Example: Retrieve a Recording

get-by-sid page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.video.v1.recordings('RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(recording => console.log(recording.trackName));

Output

_24
{
_24
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"status": "processing",
_24
"date_created": "2015-07-30T20:00:00Z",
_24
"sid": "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"source_sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"size": 0,
_24
"url": "https://video.twilio.com/v1/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_24
"type": "audio",
_24
"duration": 0,
_24
"container_format": "mka",
_24
"codec": "OPUS",
_24
"track_name": "A name",
_24
"offset": 10,
_24
"status_callback": "https://mycallbackurl.com",
_24
"status_callback_method": "POST",
_24
"grouping_sids": {
_24
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_24
},
_24
"media_external_location": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
_24
"links": {
_24
"media": "https://video.twilio.com/v1/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media"
_24
}
_24
}

HTTP GET to the /Media subresource

get-media-subresource page anchor

Retrieves the media file associated to a given Recording Instance resource identified by a RecordingSid.

When you make a request to this URL, Twilio will generate a temporary URL for accessing this binary data, and issue an HTTP 302 redirect response to your request. The Recording will be returned in the format as described in the metadata, with the Content-Type header set according to the codec used to record the media.

CodecContent-Type value
PCMUaudio/x-matroska
H264video/x-matroska

The URL returned will be available by default for 600 seconds, but this can be configured to a value between 1 and 3600 seconds via the Ttl request param. If the recording is not yet available, a 404 is returned. If the recording is not available (for example, if its status is processing or deleted, or if the track was muted for the duration of the recording), an HTTP 404 response is returned.

The HTTP GET request accepts the following parameters

NameDescription
ContentDispositionOptional. Sets the Content-Disposition header of the redirect_to URL. Possible values are attachment or inline. Default value attachment%3B%20filename%3D%22RTxxx.mk{a|v} (not PII)
TtlOptional. Duration in seconds for which the redirect_to URL can be used to retrieve the media file. The default Ttl is 600 seconds. The minimum supported Ttl value is 1 second and the maximum supported value is 3600 seconds. (not PII)

The Content-Disposition(link takes you to an external page) header can be set in this request. By default, the value of this header is attachment%3B%20filename%3D%22RTxxx.mk{a|v}.

NOTE: You can play these recordings in media players that support the Matroska file format(link takes you to an external page), like the VLC(link takes you to an external page) player. You can also use other programs like Chrome, ffplay or ffplayer to play these recordings. However, these files are optimized for compactness and they are not player-friendly. Hence, you may experience different types of problems when playing these files. For generating player-friendly media files, compose your Recordings using Twilio's Recordings Composition API.

Example: Retrieve a Recording's Media

get-media-by-sid page anchor

Retrieve the actual recording Media

retrieve-the-actual-recording-media page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_19
// NOTE: This example uses the next generation Twilio helper library - for more
_19
// information on how to download and install this version, visit
_19
// https://www.twilio.com/docs/libraries/node
_19
const Twilio = require("twilio");
_19
_19
// To set up environmental variables, see http://twil.io/secure
_19
const apiKeySid = process.env.TWILIO_API_KEY;
_19
const apiKeySecret = process.env.TWILIO_API_KEY_SECRET;
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const client = new Twilio(apiKeySid, apiKeySecret, { accountSid: accountSid });
_19
_19
const recordingSid = "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
_19
const uri = `https://video.twilio.com/v1/Recordings/${recordingSid}/Media`;
_19
client.request({ method: "GET", uri: uri }).then(response => {
_19
const mediaLocation = response.data.redirect_to;
_19
request.get(mediaLocation, (err, res, media) => {
_19
console.log(media);
_19
});
_19
});

Output

_10
{
_10
"redirect_to": "https://com-twilio-us1-video-recording.s3.amazonaws.com/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}

Not supported.

Deletes the recording media file.

The metadata for the Recording is preserved for a period of 30 days, and its Status is set to deleted. After this period, the metadata will not be available. By default, Recordings with deleted status are not returned when retrieving the Recordings list. To retrieve deleted Recordings, use the Status=deleted filter.

Note that the 30-day period starts after the Status is set to deleted. After this period expires, the metadata will not be available.

Example: Delete a Recording

delete-recording page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.video.v1.recordings('RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();

(information)

Info

To delete a large set of Video Recordings, you can use the bulk deletion capabilities available in the Twilio Console(link takes you to an external page).


Recordings List Resource

recordings-list-resource page anchor

Recordings list is available at the following URI:


_10
/v1/Recordings

Returns a list of all Track Recordings with paging data.

HTTP GET: List filters

get-list-filters page anchor

The following GET query string parameters allow you to limit the list returned. Note, parameters are case-sensitive.

URI parameters
Statustype: enum<STRING>Not PII
Query Parameter

Read only the recordings that have this status. Can be: processing, completed, or deleted.

Possible values:
processingcompleteddeletedfailed

SourceSidtype: SIDNot PII
Query Parameter

Read only the recordings that have this source_sid.


GroupingSidtype: string[]Not PII
Query Parameter

Read only recordings with this grouping_sid, which may include a participant_sid and/or a room_sid.


DateCreatedAftertype: string<DATE TIME>Not PII
Query Parameter

Read only recordings that started on or after this ISO 8601(link takes you to an external page) date-time with time zone.


DateCreatedBeforetype: string<DATE TIME>Not PII
Query Parameter

Read only recordings that started before this ISO 8601(link takes you to an external page) date-time with time zone, given as YYYY-MM-DDThh:mm:ss+|-hh:mm or YYYY-MM-DDThh:mm:ssZ.


MediaTypetype: enum<STRING>Not PII
Query Parameter

Read only recordings that have this media type. Can be either audio or video.

Possible values:
audiovideodata

PageSizetype: integerNot PII
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integerNot PII
Query Parameter

The page index. This value is simply for client state.


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

Example: Get all Recordings from a given Room

filter-by-room-sid page anchor
(information)

Info

This endpoint does not retrieve deleted recordings by default. To retrieve deleted recordings, use the status filter in your request.

Get all Recordings from a given Room

get-all-recordings-from-a-given-room page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_13
// Download the helper library from https://www.twilio.com/docs/node/install
_13
// Find your Account SID and Auth Token at twilio.com/console
_13
// and set the environment variables. See http://twil.io/secure
_13
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13
const authToken = process.env.TWILIO_AUTH_TOKEN;
_13
const client = require('twilio')(accountSid, authToken);
_13
_13
client.video.v1.recordings
_13
.list({
_13
groupingSid: ['RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'],
_13
limit: 20
_13
})
_13
.then(recordings => recordings.forEach(r => console.log(r.sid)));

Output

_41
{
_41
"recordings": [
_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"status": "completed",
_41
"date_created": "2015-07-30T20:00:00Z",
_41
"date_updated": "2015-07-30T21:00:00Z",
_41
"date_deleted": "2015-07-30T22:00:00Z",
_41
"sid": "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"source_sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"size": 23,
_41
"type": "audio",
_41
"duration": 10,
_41
"container_format": "mka",
_41
"codec": "OPUS",
_41
"track_name": "A name",
_41
"offset": 10,
_41
"status_callback": "https://mycallbackurl.com",
_41
"status_callback_method": "POST",
_41
"grouping_sids": {
_41
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"participant_sid": "PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_41
},
_41
"media_external_location": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
_41
"encryption_key": "public_key",
_41
"url": "https://video.twilio.com/v1/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"links": {
_41
"media": "https://video.twilio.com/v1/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media"
_41
}
_41
}
_41
],
_41
"meta": {
_41
"page": 0,
_41
"page_size": 50,
_41
"first_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"previous_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"next_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=1",
_41
"key": "recordings"
_41
}
_41
}

Example: Get all Recordings for a given Participant

filter-by-participant-sid page anchor
(information)

Info

This endpoint does not retrieve deleted recordings by default. To retrieve deleted recordings, use the status filter in your request.

Get all Recordings for a given Participant

get-all-recordings-for-a-given-participant page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.video.v1.recordings
_10
.list({groupingSid: ['ParticipantSid'], limit: 20})
_10
.then(recordings => recordings.forEach(r => console.log(r.sid)));

Output

_41
{
_41
"recordings": [
_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"status": "completed",
_41
"date_created": "2015-07-30T20:00:00Z",
_41
"date_updated": "2015-07-30T21:00:00Z",
_41
"date_deleted": "2015-07-30T22:00:00Z",
_41
"sid": "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"source_sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"size": 23,
_41
"type": "audio",
_41
"duration": 10,
_41
"container_format": "mka",
_41
"codec": "OPUS",
_41
"track_name": "A name",
_41
"offset": 10,
_41
"status_callback": "https://mycallbackurl.com",
_41
"status_callback_method": "POST",
_41
"grouping_sids": {
_41
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"participant_sid": "PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_41
},
_41
"media_external_location": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
_41
"encryption_key": "public_key",
_41
"url": "https://video.twilio.com/v1/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"links": {
_41
"media": "https://video.twilio.com/v1/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media"
_41
}
_41
}
_41
],
_41
"meta": {
_41
"page": 0,
_41
"page_size": 50,
_41
"first_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"previous_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"next_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=1",
_41
"key": "recordings"
_41
}
_41
}

Example: Get the list of deleted Recordings

filter-by-status page anchor

Get the list of deleted Recordings

get-the-list-of-deleted-recordings page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.video.v1.recordings
_10
.list({status: 'deleted', limit: 20})
_10
.then(recordings => recordings.forEach(r => console.log(r.sid)));

Output

_41
{
_41
"recordings": [
_41
{
_41
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"status": "completed",
_41
"date_created": "2015-07-30T20:00:00Z",
_41
"date_updated": "2015-07-30T21:00:00Z",
_41
"date_deleted": "2015-07-30T22:00:00Z",
_41
"sid": "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"source_sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"size": 23,
_41
"type": "audio",
_41
"duration": 10,
_41
"container_format": "mka",
_41
"codec": "OPUS",
_41
"track_name": "A name",
_41
"offset": 10,
_41
"status_callback": "https://mycallbackurl.com",
_41
"status_callback_method": "POST",
_41
"grouping_sids": {
_41
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"participant_sid": "PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_41
},
_41
"media_external_location": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
_41
"encryption_key": "public_key",
_41
"url": "https://video.twilio.com/v1/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_41
"links": {
_41
"media": "https://video.twilio.com/v1/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media"
_41
}
_41
}
_41
],
_41
"meta": {
_41
"page": 0,
_41
"page_size": 50,
_41
"first_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"previous_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=0",
_41
"next_page_url": "https://video.twilio.com/v1/Recordings?Status=completed&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&SourceSid=source_sid&MediaType=audio&GroupingSid=RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&PageSize=50&Page=1",
_41
"key": "recordings"
_41
}
_41
}

Not supported.

Not supported.


Using the Rooms API to find Recordings

rooms-recordings page anchor

You can also retrieve the list of recordings for a specific room using the Rooms API endpoint.

Example: Get all recordings from a given Room using the Rooms API

rooms-filter-by-room-sid page anchor
(information)

Info

This endpoint does not retrieve deleted recordings by default. To retrieve deleted recordings, use the status filter in your request.

Get all Recordings from a given Room using the Rooms API

get-all-recordings-from-a-given-room-using-the-rooms-api page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.recordings
_11
.list({limit: 20})
_11
.then(recordings => recordings.forEach(r => console.log(r.sid)));

Output

_40
{
_40
"recordings": [
_40
{
_40
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_40
"status": "completed",
_40
"date_created": "2015-07-30T20:00:00Z",
_40
"date_updated": "2015-07-30T21:00:00Z",
_40
"date_deleted": "2015-07-30T22:00:00Z",
_40
"sid": "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_40
"source_sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_40
"size": 23,
_40
"type": "audio",
_40
"duration": 10,
_40
"container_format": "mka",
_40
"codec": "OPUS",
_40
"track_name": "A name",
_40
"offset": 10,
_40
"grouping_sids": {
_40
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_40
"participant_sid": "PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_40
},
_40
"media_external_location": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
_40
"encryption_key": "public_key",
_40
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_40
"url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_40
"links": {
_40
"media": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media"
_40
}
_40
}
_40
],
_40
"meta": {
_40
"page": 0,
_40
"page_size": 50,
_40
"first_page_url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Status=completed&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&SourceSid=source_sid&PageSize=50&Page=0",
_40
"previous_page_url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Status=completed&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&SourceSid=source_sid&PageSize=50&Page=0",
_40
"url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Status=completed&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&SourceSid=source_sid&PageSize=50&Page=0",
_40
"next_page_url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings?Status=completed&DateCreatedBefore=2017-12-31T23%3A59%3A59Z&DateCreatedAfter=2017-01-01T00%3A00%3A01Z&SourceSid=source_sid&PageSize=50&Page=1",
_40
"key": "recordings"
_40
}
_40
}

Example: Retrieve a Recording using the Rooms API

rooms-get-instance page anchor

Retrieve a Recording using the Rooms API

retrieve-a-recording-using-the-rooms-api page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.recordings('RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.fetch()
_11
.then(room_recording => console.log(room_recording.trackName));

Output

_23
{
_23
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23
"status": "processing",
_23
"date_created": "2015-07-30T20:00:00Z",
_23
"sid": "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23
"source_sid": "MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23
"size": 0,
_23
"type": "audio",
_23
"duration": 0,
_23
"container_format": "mka",
_23
"codec": "OPUS",
_23
"track_name": "A name",
_23
"offset": 10,
_23
"grouping_sids": {
_23
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_23
},
_23
"media_external_location": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
_23
"room_sid": "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23
"url": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23
"links": {
_23
"media": "https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Media"
_23
}
_23
}

Example: Retrieve a Recording's Media using the Rooms API

rooms-get-media-subresource page anchor

Retrieve the actual recording Media using the Rooms API

retrieve-the-actual-recording-media-using-the-rooms-api page anchor
Node.js
Python
C#
Java
PHP
Ruby
curl

_24
// NOTE: This example uses the next generation Twilio helper library - for more
_24
// information on how to download and install this version, visit
_24
// https://www.twilio.com/docs/libraries/node
_24
const Twilio = require("twilio");
_24
_24
// To set up environmental variables, see http://twil.io/secure
_24
const apiKeySid = process.env.TWILIO_API_KEY;
_24
const apiKeySecret = process.env.TWILIO_API_KEY_SECRET;
_24
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_24
const client = new Twilio(apiKeySid, apiKeySecret, { accountSid: accountSid });
_24
_24
const roomSid = "RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
_24
const recordingSid = "RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
_24
const uri =
_24
"https://video.twilio.com/v1/" +
_24
`Rooms/${roomSid}/` +
_24
`Recordings/${recordingSid}` +
_24
"/Media";
_24
client.request({ method: "GET", uri: uri }).then((response) => {
_24
const mediaLocation = response.data.redirect_to;
_24
request.get(mediaLocation, (err, res, media) => {
_24
console.log(media);
_24
});
_24
});

Output

_10
{
_10
"redirect_to": "https://com.twilio.us1.video.recording.s3.amazonaws.com/RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_10
}

Size estimation of a track Recording

recording-size-estimation page anchor

The size of a video Recording (.mkv) will vary based on resolution, bit rate and duration. The following table shows files size for a single participant with video captured at common resolutions and bitrates:

Capture Size1 Hr8 Hrs24 Hrs
720 @ 1,500 kbps0.7 GB5.4 GB16.2 GB
480 @ 700 kbps0.3 GB2.5 GB7.6 GB
180 @ 200 kbps0.1 GB0.7 GB2.2 GB
(warning)

Warning

The above table is for heuristic estimation and reference only. There are a lot of other factors influence the actual video file size such as compression ratio, variable bitrate, color depth.

The size of an audio Recording (.mka) will vary based on bit rate and duration. The following table shows files size for a single participant with audio captured at common bit rates:

Capture Size1 Hr8 Hrs24 Hrs
16 kbps7.2 MB57.6 MB172.8 MB
32 kbps14.4 MB115.2 MB345.6 MB
40 kbps18 MB144 MB432 MB
(warning)

Warning

Note that the file size reported by our REST API may vary slightly from that shown due to file allocation methods and/or possible differences in the amount of header information.


Known limitations

known-issues page anchor
  • Recording files are generated with a format optimized for reliability and compactness. This format is not player friendly. Hence, many media players may not render Recordings media files appropriately. For generating player-friendly media files, compose your Recordings using Twilio's Recordings Composition API .
  • Participants of Group Rooms on the browser Firefox Mobile could find Recording gaps due to a Firefox bug when sending temporization. Twilio recommends Video participants to use other mobile browsers.

Rate this page: