Encrypted Compositions
Twilio Editions feature
Encryption is available to Twilio Enterprise Edition and Twilio Security Edition customers. Learn more about Editions.
The Twilio Composition Settings REST API lets you configure Twilio to store your compositions encrypted. Composition Settings work per-account (i.e. project). If you activate encryption, all Video Compositions in your account (or project) will get encrypted.
This document contains reference information about the Composition Settings REST API for encryption. For a step-by-step guide, you can also read the Encrypting your Stored Media developer guide
These are the URI schemes for the Composition Settings REST API and the supported methods:
/v1/CompositionSettings/DefaultGET: Retrieves current Composition Settings.POST: Updates the Composition Settings.
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).
The Compositions Settings default resource is located at the following Base URL:
1https://video.twilio.com/v1/CompositionSettings/Default2
A CompositionSettings resource has the following properties:
The SID of the Account that created the CompositionSettings resource.
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The string that you assigned to describe the resource and that will be shown in the console
The SID of the stored Credential resource.
^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34The 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.
Whether all compositions are written to the aws_s3_url. When false, all compositions are stored in our cloud.
The SID of the Public Key resource used for encryption.
^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34Whether all compositions are stored in an encrypted form. The default is false.
The absolute URL of the resource.
In the table above, the following properties are reserved for the feature called External S3 Storage:
aws_credentials_sidaws_s3_urlaws_storage_enabled
Retrieves your account's default Composition Settings.
For example:
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchCompositionSettings() {11const compositionSetting = await client.video.compositionSettings().fetch();1213console.log(compositionSetting.accountSid);14}1516fetchCompositionSettings();
Response
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/CompositionSettings/Default"10}
Sets your account's default Composition Settings. POST requests support the
following parameters:
application/x-www-form-urlencodedA descriptive string that you create to describe the resource and show to the user in the console
The SID of the stored Credential resource.
^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34The SID of the Public Key resource to use for encryption.
^CR[0-9a-fA-F]{32}$Min length: 34Max length: 34The 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.
Whether all compositions should be written to the aws_s3_url. When false, all compositions are stored in our cloud.
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 External S3 Storage:
AwsCredentialsSidAwsS3UrlAwsStorageEnabled
The following code snippets illustrate how you can set Encryption in your Compositions settings:
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createCompositionSettings() {11const compositionSetting = await client.video.compositionSettings().create({12awsCredentialsSid: "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",13awsS3Url: "https://my-bucket.s3.amazonaws.com/recordings",14awsStorageEnabled: true,15encryptionEnabled: true,16encryptionKeySid: "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",17friendlyName: "Upload encrypted",18});1920console.log(compositionSetting.accountSid);21}2223createCompositionSettings();
Response
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"friendly_name": "Upload encrypted",4"aws_credentials_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",5"encryption_key_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",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/CompositionSettings/Default"10}
- No known problems.