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

External S3 Compositions


(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.


Contents

contents page anchor

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

  • /v1/CompositionSettings/Default
    • GET : Retrieves current Composition Settings.
    • POST : Updates the Composition Settings.

Composition Settings instance resource

composition-settings-instance-resource page anchor

The Default CompositionSettings resource holds the default composition settings for the given Twilio account (or project). Its configuration will be applied to all Recording Compositions created in such account (or project).

Base URL

base-url page anchor

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


_10
https://video.twilio.com/v1/CompositionSettings/Default

A CompositionSettings resource has the following properties:

Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The SID of the Account that created the CompositionSettings resource.

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

friendly_namestring

The string that you assigned to describe the resource and that will be shown in the console


aws_credentials_sidSID<CR>

The SID of the stored Credential resource.

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

aws_s3_urlstring<uri>

The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like https://documentation-example-twilio-bucket/compositions, where compositions is the path in which you want the compositions 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

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


encryption_key_sidSID<CR>

The SID of the Public Key resource used for encryption.

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

encryption_enabledboolean

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


urlstring<uri>

The absolute URL of the resource.


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

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

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

  • encryption_key_sid
  • encryption_enabled

If you have an interest in activating Encrypted Compositions in you 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 Composition Settings.

For example:

Fetch Composition Settings

fetch-composition-settings page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function fetchCompositionSettings() {
_16
const compositionSetting = await client.video.compositionSettings().fetch();
_16
_16
console.log(compositionSetting.accountSid);
_16
}
_16
_16
fetchCompositionSettings();

Output

_10
{
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"friendly_name": "string",
_10
"aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"aws_s3_url": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
_10
"aws_storage_enabled": true,
_10
"encryption_enabled": true,
_10
"url": "https://video.twilio.com/v1/CompositionSettings/Default"
_10
}

HTTP POST: Set Settings

http-post page anchor

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

Property nameTypeRequiredPIIDescription
FriendlyNamestringrequired

A descriptive string that you create to describe the resource and show to the user 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 compositions should be stored. We only support DNS-compliant URLs like https://documentation-example-twilio-bucket/compositions, where compositions is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986(link takes you to an external page).


AwsStorageEnabledbooleanOptional

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


EncryptionEnabledbooleanOptional

Whether all compositions 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 Compositions:

  • EncryptionKeySid
  • EncryptionEnabled

If you have an interest in activating Encrypted Compositions 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 Compositions

enable-s3 page anchor

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

Create or update the configuration to upload to an external S3 bucket

create-or-update-the-configuration-to-upload-to-an-external-s3-bucket page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function createCompositionSettings() {
_21
const compositionSetting = await client.video.compositionSettings().create({
_21
awsCredentialsSid: "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
awsS3Url: "https://my-bucket.s3.amazonaws.com/recordings",
_21
awsStorageEnabled: true,
_21
friendlyName: "Upload to external bucket",
_21
});
_21
_21
console.log(compositionSetting.accountSid);
_21
}
_21
_21
createCompositionSettings();

Output

_10
{
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"friendly_name": "Upload to external bucket",
_10
"aws_credentials_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"aws_s3_url": "https://my-bucket.s3.amazonaws.com/recordings",
_10
"aws_storage_enabled": true,
_10
"encryption_enabled": true,
_10
"url": "https://video.twilio.com/v1/CompositionSettings/Default"
_10
}

Disabling external S3 storage for Compositions

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

To stop storing compositions 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, compositions will be stored in the Twilio cloud.

Disable external S3 storage for Compositions

disable-external-s3-storage-for-compositions page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_19
// Download the helper library from https://www.twilio.com/docs/node/install
_19
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19
_19
// Find your Account SID and Auth Token at twilio.com/console
_19
// and set the environment variables. See http://twil.io/secure
_19
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19
const authToken = process.env.TWILIO_AUTH_TOKEN;
_19
const client = twilio(accountSid, authToken);
_19
_19
async function createCompositionSettings() {
_19
const compositionSetting = await client.video.compositionSettings().create({
_19
awsStorageEnabled: false,
_19
friendlyName: "Resetting default configuration",
_19
});
_19
_19
console.log(compositionSetting.accountSid);
_19
}
_19
_19
createCompositionSettings();

Output

_10
{
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"friendly_name": "Resetting default configuration",
_10
"aws_credentials_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"encryption_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"aws_s3_url": "https://my-super-duper-bucket.s3.amazonaws.com/my/path/",
_10
"aws_storage_enabled": false,
_10
"encryption_enabled": true,
_10
"url": "https://video.twilio.com/v1/CompositionSettings/Default"
_10
}


Rate this page: