Skip to contentSkip to navigationSkip to topbar
On this page

External S3 Recordings



Overview

overview page anchor

The Twilio Recording Settings REST API lets you configure Twilio to store your recordings in an external AWS S3 bucket. Recording Settings work per-account (i.e. project). If you activate external S3 storage, all Video Recordings in your account (or project) will be stored in the specified external bucket.

This document contains reference information about the Recording Settings REST API for external S3 storage. For a step-by-step guide you can also read the Storing into AWS S3 developer guide



These are the URI schemes for the Recording Settings REST API and the supported methods:

  • /v1/RecordingSettings/Default
    • GET: Retrieves current Recording Settings.
    • POST: Updates the Recording Settings.

Recording Settings instance resource

recording-settings-instance-resource page anchor

The Default RecordingSettings resource holds the default recording settings for the given Twilio account (or project). Its configuration will be applied to all Recordings created in such account (or project).

Base URL

base-url page anchor

The Recording Settings default resource is located at the following Base URL:

1
https://video.twilio.com/v1/RecordingSettings/Default
2

A RecordingSettings resource has the following properties:

Property nameTypeRequiredDescriptionChild properties
account_sidSID<AC>

Optional

Not PII

The SID of the Account that created the RecordingSettings resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestring

Optional

The string that you assigned to describe the resource and show the user in the console


aws_credentials_sidSID<CR>

Optional

The SID of the stored Credential resource.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

aws_s3_urlstring<uri>

Optional

The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like https://documentation-example-twilio-bucket/recordings, where recordings is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986(link takes you to an external page).


aws_storage_enabledboolean

Optional

Whether all recordings are written to the aws_s3_url. When false, all recordings are stored in our cloud.


encryption_key_sidSID<CR>

Optional

The SID of the Public Key resource used for encryption.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

encryption_enabledboolean

Optional

Whether all recordings are stored in an encrypted form. The default is false.


urlstring<uri>

Optional

The absolute URL of the resource.

In the table above, the following properties are reserved for the feature called Encrypted Recordings:

  • encryption_key_sid
  • encryption_enabled

If you have an interest in activating Encrypted Recordings in your account, please contact the Twilio Support Service.(link takes you to an external page)

HTTP GET: Get Settings

http-get page anchor

Retrieves your account's default Recording Settings.

For example:

Fetch Recording SettingsLink to code sample: Fetch Recording Settings
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchRecordingSettings() {
11
const recordingSetting = await client.video.recordingSettings().fetch();
12
13
console.log(recordingSetting.accountSid);
14
}
15
16
fetchRecordingSettings();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"friendly_name": "string",
4
"aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"aws_s3_url": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
7
"aws_storage_enabled": true,
8
"encryption_enabled": true,
9
"url": "https://video.twilio.com/v1/RecordingSettings/Default"
10
}

HTTP POST: Set Settings

http-post page anchor

Sets your account's default Recording Settings. POST requests support the following parameters:

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
FriendlyNamestringrequired

A descriptive string that you create to describe the resource and be shown to users in the console


AwsCredentialsSidSID<CR>

Optional

The SID of the stored Credential resource.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

EncryptionKeySidSID<CR>

Optional

The SID of the Public Key resource to use for encryption.

Pattern: ^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34

AwsS3Urlstring<uri>

Optional

The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like https://documentation-example-twilio-bucket/recordings, where recordings is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986(link takes you to an external page).


AwsStorageEnabledboolean

Optional

Whether all recordings should be written to the aws_s3_url. When false, all recordings are stored in our cloud.


EncryptionEnabledboolean

Optional

Whether all recordings should be stored in an encrypted form. The default is false.

In the table above, the following parameters are reserved for the feature called Encrypted Recordings:

  • EncryptionKeySid
  • EncryptionEnabled

If you have an interest in activating Encrypted Recordings and enable the use of these parameters in your account, please contact the Twilio Support Service.(link takes you to an external page)

Enabling external S3 storage for Recordings

enable-s3 page anchor

The following code snippet illustrates how you can set your Recordings to be stored in an external S3 bucket:

Create or update the configuration to upload to an external S3 bucketLink to code sample: Create or update the configuration to upload to an external S3 bucket
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createRecordingSettings() {
11
const recordingSetting = await client.video.recordingSettings().create({
12
awsCredentialsSid: "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
13
awsS3Url: "https://my-bucket.s3.amazonaws.com/recordings",
14
awsStorageEnabled: true,
15
friendlyName: "Upload to external bucket",
16
});
17
18
console.log(recordingSetting.accountSid);
19
}
20
21
createRecordingSettings();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"friendly_name": "Upload to external bucket",
4
"aws_credentials_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
5
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"aws_s3_url": "https://my-bucket.s3.amazonaws.com/recordings",
7
"aws_storage_enabled": true,
8
"encryption_enabled": true,
9
"url": "https://video.twilio.com/v1/RecordingSettings/Default"
10
}

Disabling external S3 storage for Recordings

disabling-external-s3-storage-for-recordings page anchor

To stop storing recordings in an AWS S3 Bucket by default, you can create a new default configuration with AWS storage disabled. If you disable external AWS S3 storage, recordings will be stored in the Twilio cloud.

Disable external S3 storage for RecordingsLink to code sample: Disable external S3 storage for Recordings
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createRecordingSettings() {
11
const recordingSetting = await client.video.recordingSettings().create({
12
awsStorageEnabled: false,
13
friendlyName: "Resetting default configuration",
14
});
15
16
console.log(recordingSetting.accountSid);
17
}
18
19
createRecordingSettings();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"friendly_name": "Resetting default configuration",
4
"aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"aws_s3_url": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
7
"aws_storage_enabled": false,
8
"encryption_enabled": true,
9
"url": "https://video.twilio.com/v1/RecordingSettings/Default"
10
}

  • If you activate External S3 Storage in your account, you will not be able to use Compositions in such account given that Compositions require the source recordings to be stored in Twilio's cloud.

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.