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.
We recommend migrating your application to the API provided by our preferred video partner, Zoom. We've prepared this migration guide to assist you in minimizing any service disruption.
The Twilio Composition Hooks REST API lets you automate the creation of Compositions. A Composition Hook is a template that specifies how Group Room video recordings should be composed. Using this API you will be able to:
Composition Hooks work per-account (i.e. project). Hence, when a Group Room is completed, all enabled Composition Hooks in the account will be executed against that room recordings.
This API is located beneath the following base URL:
1https://video.twilio.com2
These are the URI schemes for the Composition Hooks REST API and the supported methods:
/v1/CompositionHooks
GET
: Lists Composition Hook resources.
POST
: Creates new Composition Hook resources.
/v1/CompositionHooks/{CompositionHookSid}
GET
: Retrieves a Composition Hook instance.
POST
: Updates a Composition Hook instance.
DELETE
: Deletes a Composition Hook instance.
The Composition Hook instance resource represents a template that specifies how Group Room recordings should be composed.
1/v1/CompositionHooks/{CompositionHookSid}2
A Composition Hook Instance Resource has the following properties:
The SID of the Account that created the CompositionHook resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The string that you assigned to describe the resource. Can be up to 100 characters long and must be unique within the account.
Whether the CompositionHook is active. When true
, the CompositionHook is triggered for every completed Group Room on the account. When false
, the CompositionHook is never triggered.
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
The unique string that we created to identify the CompositionHook resource.
^HK[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The array of track names to include in the compositions created by the composition hook. A composition triggered by the composition hook includes all audio sources specified in audio_sources
except those specified in audio_sources_excluded
. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, student*
includes tracks named student
as well as studentTeam
. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request
The array of track names to exclude from the compositions created by the composition hook. A composition triggered by the composition hook includes all audio sources specified in audio_sources
except for those specified in audio_sources_excluded
. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, student*
excludes student
as well as studentTeam
. This parameter can also be empty.
A JSON object that describes the video layout of the composition in terms of regions as specified in the HTTP POST request that created the CompositionHook resource. See POST Parameters for more information. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request
The dimensions of the video image in pixels expressed as columns (width) and rows (height). The string's format is {width}x{height}
, such as 640x480
.
Whether intervals with no media are clipped, as specified in the POST request that created the CompositionHook resource. Compositions with trim
enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See Specifying Video Layouts for more info.
The container format of the media files used by the compositions created by the composition hook. If mp4
or webm
, audio_sources
must have one or more tracks and/or a video_layout
element must contain a valid video_sources
list, otherwise an error occurs.
mp4
webm
The URL we call using the status_callback_method
to send status information to your application.
The HTTP method we should use to call status_callback
. Can be POST
or GET
and defaults to POST
.
GET
POST
The absolute URL of the resource.
Returns the single Composition Hook instance identified by {CompositionHookSid}
.
Updates the Composition Hook instance identified by {CompositionHookSid}
.
Be aware that partial updates are not supported. This means that when updating
you must specify all the POST
parameters, even for properties that don't change.
Any optional parameter that is not explicitly specified will be reset
(i.e. set to its default value)
The following parameters are supported:
The SID of the CompositionHook resource to update.
^HK[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account.
Whether the composition hook is active. When true
, the composition hook will be triggered for every completed Group Room in the account. When false
, the composition hook never triggers.
A JSON object that describes the video layout of the composition hook in terms of regions. See Specifying Video Layouts for more info.
An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in audio_sources
except those specified in audio_sources_excluded
. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, student*
includes tracks named student
as well as studentTeam
.
An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in audio_sources
except for those specified in audio_sources_excluded
. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, student*
excludes student
as well as studentTeam
. This parameter can also be empty.
Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is true
. Compositions with trim
enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See Specifying Video Layouts for more info.
The container format of the media files used by the compositions created by the composition hook. Can be: mp4
or webm
and the default is webm
. If mp4
or webm
, audio_sources
must have one or more tracks and/or a video_layout
element must contain a valid video_sources
list, otherwise an error occurs.
mp4
webm
A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to 640x480
.
The string's format is {width}x{height}
where:
{width}
<= 1280{height}
<= 1280{width}
* {height}
<= 921,600Typical values are:
1280x720
1024x576
640x480
320x240
Note that the resolution
imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See Specifying Video Layouts for more info.
The URL we should call using the status_callback_method
to send status information to your application on every composition event. If not provided, status callback events will not be dispatched.
The HTTP method we should use to call status_callback
. Can be: POST
or GET
and the default is POST
.
GET
POST
The return value is a 200 OK
if the request is accepted and executed successfully.
Otherwise, a 4xx
is returned with detailed information about the problem.
Deletes the Composition Hook instance identified by {CompositionHookSid}
.
The return value is a 204 NO CONTENT
if the request is accepted and executed successfully. In this case, deletion is immediate.
Otherwise, a 4xx
is returned with detailed information about the problem.
1/v1/CompositionHooks2
Creates a new Composition Hook and registers it so that Twilio can fire it whenever a Group Room is completed.
The return value is a 201 CREATED
if the request is accepted and executed successfully.
Otherwise, a 4xx
is returned with detailed information about the problem.
The following table shows all the parameters that can be specified when creating a new Composition Hook.
application/x-www-form-urlencoded
A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account.
Whether the composition hook is active. When true
, the composition hook will be triggered for every completed Group Room in the account. When false
, the composition hook will never be triggered.
An object that describes the video layout of the composition hook in terms of regions. See Specifying Video Layouts for more info.
An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in audio_sources
except those specified in audio_sources_excluded
. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, student*
includes tracks named student
as well as studentTeam
.
An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in audio_sources
except for those specified in audio_sources_excluded
. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, student*
excludes student
as well as studentTeam
. This parameter can also be empty.
A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to 640x480
.
The string's format is {width}x{height}
where:
{width}
<= 1280{height}
<= 1280{width}
* {height}
<= 921,600Typical values are:
1280x720
1024x576
640x480
320x240
Note that the resolution
imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See Specifying Video Layouts for more info.
The container format of the media files used by the compositions created by the composition hook. Can be: mp4
or webm
and the default is webm
. If mp4
or webm
, audio_sources
must have one or more tracks and/or a video_layout
element must contain a valid video_sources
list, otherwise an error occurs.
mp4
webm
The URL we should call using the status_callback_method
to send status information to your application on every composition event. If not provided, status callback events will not be dispatched.
The HTTP method we should use to call status_callback
. Can be: POST
or GET
and the default is POST
.
GET
POST
Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is true
. Compositions with trim
enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See Specifying Video Layouts for more info.
A Composition Hook VideoLayout describes the video layout of compositions created by that Hook. Details on how to specify such a VideoLayout can be found in the Specifying Video Layouts section on Twilio's Compositions REST API documentation. The only aspect you may take into consideration is that, when working with Composition Hooks, you don't have information about the specific SIDs of tracks, recordings, and participants. Hence, you must specify layouts basing on track names and set such names appropriately in your real-time Group Rooms.
Retrieves the list Composition Hook Records belonging to the corresponding AccountSid
with paging data.
The following GET
query string parameters allow you to limit the list returned. Note, parameters are case-sensitive
Read only CompositionHook resources with an enabled
value that matches this parameter.
Read only CompositionHook resources created on or after this ISO 8601 datetime with time zone.
Read only CompositionHook resources created before this ISO 8601 datetime with time zone.
Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk *
characters as wildcard match.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
Not Supported
Programming with Composition Hooks is quite similar to programming with Compositions. Hence, in addition to the examples here below, you may also find useful our Recording Compositions documentation
In this example, we want to compose only the audio tracks of all completed Group Rooms. Considering that:
SKXXXX:your_api_key_secret
)
The desired Composition Hook can be created with the following code:
1// NOTE: This example uses the next generation Twilio helper library - for more2// information on how to download and install this version, visit3// https://www.twilio.com/docs/libraries/node45// Find your credentials at twilio.com/console6// To set up environmental variables, see http://twil.io/secure7const API_KEY_SID = process.env.TWILIO_API_KEY;8const API_KEY_SECRET = process.env.TWILIO_API_KEY_SECRET;9const ACCOUNT_SID = process.env.TWILIO_ACCOUNT_SID;1011const Twilio = require('twilio');1213const client = new Twilio(API_KEY_SID, API_KEY_SECRET, {accountSid: ACCOUNT_SID});1415client.video.compositionHooks.16create({17friendlyName: 'MixingAllRoomAudiosHook',18audioSources: '*',19statusCallback: 'http://my.server.org/callbacks',20format: 'mp4'21})22.then(compositionHook =>{23console.log('Created Composition Hook with SID=' + compositionHook.sid);24});
1{2"account_sid": "ACXXXX",3"sid": "HKXXXX",4"friendly_name": "MixingAllRoomAudiosHook",5"enabled": true,6"date_created": "2018-12-19T16:22:13Z",7"date_updated": null,8"audio_sources": [9"*"10],11"audio_sources_excluded": [],12"video_layout": {},13"format": "mp4",14"trim": true,15"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",16"resolution": "640x480",17"status_callback_method": "POST",18"status_callback": "http://my.server.org/callbacks"19}
In this example, we create a Composition Hook for composing all tracks of a Group Room using a simple grid layout for video.
Considering that:
SKXXXX:your_api_key_secret
)
mp4
as target format
640x480
)
You can create the desired Composition Hook using the following:
1// NOTE: This example uses the next generation Twilio helper library - for more2// information on how to download and install this version, visit3// https://www.twilio.com/docs/libraries/node45// Find your credentials at twilio.com/console6// To set up environmental variables, see http://twil.io/secure7const API_KEY_SID = process.env.TWILIO_API_KEY;8const API_KEY_SECRET = process.env.TWILIO_API_KEY_SECRET;9const ACCOUNT_SID = process.env.TWILIO_ACCOUNT_SID;1011const Twilio = require('twilio');1213const client = new Twilio(API_KEY_SID, API_KEY_SECRET, {accountSid: ACCOUNT_SID});1415client.video.compositionHooks.16create({17friendlyName: 'MyFirstCompositionHook',18audioSources: '*',19videoLayout: {20grid : {21video_sources: ['*']22}23},24statusCallback: 'http://my.server.org/callbacks',25format: 'mp4'26})27.then(compositionHook =>{28console.log('Created Composition Hook with SID=' + compositionHook.sid);29});
1{2"account_sid": "ACXXXX",3"sid": "HKXXXX",4"friendly_name": "MyFirstCompositionHook",5"enabled": true,6"date_created": "2018-12-19T16:04:11Z",7"date_updated": null,8"audio_sources": [9"*"10],11"audio_sources_excluded": [],12"video_layout": {13"grid": {14"z_pos": 0,15"reuse": "show_oldest",16"x_pos": 0,17"max_columns": null,18"cells_excluded": [],19"video_sources_excluded": [],20"height": null,21"width": null,22"max_rows": null,23"y_pos": 0,24"video_sources": [25"*"26]27}28},29"format": "mp4",30"trim": true,31"resolution": "640x480",32"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",33"status_callback_method": "POST",34"status_callback": "http://my.server.org/callbacks"35}
In this example, we create a Composition Hook that fires a composition with PiP (Picture-in-Picture) layout for every completed Group Room. Observe that, at Hook creation time we don't know any track or recording SIDs. Due to this, we must rely on track names. Here we assume that such names comply with the following:
presenter-cam
as well as a
screenshare track named
screen
. The presenter audio track, in turn, has
the name
presenter-audio
.
listener-audio
.
Assuming that:
SKXXXX:your_api_key_secret
)
mp4
as target format
1280x720
)
The desired Composition Hook may be created as follows:
1// NOTE: This example uses the next generation Twilio helper library - for more2// information on how to download and install this version, visit3// https://www.twilio.com/docs/libraries/node45// Find your credentials at twilio.com/console6// To set up environmental variables, see http://twil.io/secure7const API_KEY_SID = process.env.TWILIO_API_KEY;8const API_KEY_SECRET = process.env.TWILIO_API_KEY_SECRET;9const ACCOUNT_SID = process.env.TWILIO_ACCOUNT_SID;1011const Twilio = require('twilio');1213const client = new Twilio(API_KEY_SID, API_KEY_SECRET, {accountSid: ACCOUNT_SID});1415client.video.compositionHooks.16create({17friendlyName: 'MyHookWithComplexVideoLayout',18audioSources: ['listener-audio', 'presenter-audio'],19videoLayout: {20main: {21z_pos: 1,22video_sources: ['screen']23},24pip: {25z_pos: 2,26x_pos: 1000,27y_pos: 30,28width: 240,29height: 180,30video_sources: ['presenter-cam']31}32},33statusCallback: 'http://my.server.org/callbacks',34resolution: '1280x720',35format: 'mp4'36})37.then(compositionHook =>{38console.log('Created Composition Hook with SID=' + compositionHook.sid);39});
1{2"account_sid": "ACXXXX",3"sid": "HKXXXX",4"friendly_name": "MyHookWithComplexVideoLayout",5"enabled": true,6"date_created": "2018-12-19T16:44:10Z",7"date_updated": null,8"audio_sources": [9"listener-audio",10"presenter-audio"11],12"audio_sources_excluded": [],13"trim": true,14"video_layout": {15"pip": {16"z_pos": 2,17"reuse": "show_oldest",18"x_pos": 1000,19"max_columns": null,20"cells_excluded": [],21"video_sources_excluded": [],22"height": 180,23"width": 240,24"max_rows": null,25"y_pos": 30,26"video_sources": [27"presenter-cam"28]29},30"main": {31"z_pos": 1,32"reuse": "show_oldest",33"x_pos": 0,34"max_columns": null,35"cells_excluded": [],36"video_sources_excluded": [],37"height": null,38"width": null,39"max_rows": null,40"y_pos": 0,41"video_sources": [42"screen"43]44}45},46"resolution": "1280x720",47"format": "mp4",48"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",49"status_callback_method": "POST",50"status_callback": "http://my.server.org/callbacks"51}
For executing this example you need:
SKXXXX:your_api_key_secret
)
HKXXXX
)
1// NOTE: This example uses the next generation Twilio helper library - for more2// information on how to download and install this version, visit3// https://www.twilio.com/docs/libraries/node45const apiKeySid = 'SKXXXX';6const apiKeySecret = 'your_api_key_secret';7// To set up environmental variables, see http://twil.io/secure8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const Twilio = require('twilio');1011const client = new Twilio(apiKeySid, apiKeySecret, {accountSid: accountSid});1213compositionHook = client.video.compositionHooks('HKXXXX')14.fetch()15.then(compositionHook =>{16console.log('Read Composition Hook with SID=' + compositionHook.sid);17});
1{2"account_sid": "ACXXXX",3"sid": "HKXXXX",4"friendly_name": "MixingAllRoomAudiosHook",5"enabled": true,6"date_created": "2018-12-19T16:22:13Z",7"date_updated": null,8"audio_sources": [9"*"10],11"audio_sources_excluded": [],12"video_layout": {},13"format": "mp4",14"trim": true,15"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",16"resolution": "640x480",17"status_callback_method": "POST",18"status_callback": "http://my.server.org/callbacks"19}
For executing this example you need:
SKXXXX:your_api_key_secret
)
1// NOTE: This example uses the next generation Twilio helper library - for more2// information on how to download and install this version, visit3// https://www.twilio.com/docs/libraries/node45const apiKeySid = 'SKXXXX';6const apiKeySecret = 'your_api_key_secret';7// To set up environmental variables, see http://twil.io/secure8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const Twilio = require('twilio');1011const client = new Twilio(apiKeySid, apiKeySecret, {accountSid: accountSid});1213client.video.compositionHooks.14list({15enabled: true16})17.then(hooks =>{18console.log("Found " + hooks.length + " Composition Hooks.");19hooks.forEach(function(hook){20console.log('Read hook with SID=' + hook.sid);21});22});
1{2"composition_hooks": [3{4"trim": true,5"video_layout": {6"pip": {7"z_pos": 2,8"reuse": "show_oldest",9"x_pos": 1000,10"max_columns": null,11"cells_excluded": [],12"video_sources_excluded": [],13"height": 180,14"width": 240,15"max_rows": null,16"y_pos": 30,17"video_sources": [18"presenter-cam"19]20},21"main": {22"z_pos": 1,23"reuse": "show_oldest",24"x_pos": 0,25"max_columns": null,26"cells_excluded": [],27"video_sources_excluded": [],28"height": null,29"width": null,30"max_rows": null,31"y_pos": 0,32"video_sources": [33"screen"34]35}36},37"audio_sources_excluded": [],38"format": "mp4",39"date_updated": null,40"friendly_name": "MyHookWithComplexVideoLayout",41"enabled": true,42"account_sid": "ACXXXX",43"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",44"audio_sources": [45"listener-audio",46"listener-video"47],48"sid": "HKXXXX",49"date_created": "2018-12-19T16:44:10Z",50"resolution": "1280x720",51"status_callback_method": "POST",52"status_callback": "http://my.server.org/callbacks"53},54{55"trim": true,56"video_layout": {},57"audio_sources_excluded": [],58"format": "mp4",59"date_updated": null,60"friendly_name": "MixingAllRoomAudiosHook",61"enabled": true,62"account_sid": "ACXXXX",63"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",64"audio_sources": [65"*"66],67"sid": "HKXXXX",68"date_created": "2018-12-19T16:22:13Z",69"resolution": "640x480",70"status_callback_method": "POST",71"status_callback": "http://my.server.org/callbacks"72},73{74"trim": true,75"video_layout": {76"grid": {77"z_pos": 0,78"reuse": "show_oldest",79"x_pos": 0,80"max_columns": null,81"cells_excluded": [],82"video_sources_excluded": [],83"height": null,84"width": null,85"max_rows": null,86"y_pos": 0,87"video_sources": [88"*"89]90}91},92"audio_sources_excluded": [],93"format": "mp4",94"date_updated": null,95"friendly_name": "MyFirstCompositionHook2",96"enabled": true,97"account_sid": "ACXXXX",98"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",99"audio_sources": [100"*"101],102"sid": "HKXXXX",103"date_created": "2018-12-19T16:15:25Z",104"resolution": "640x480",105"status_callback_method": "POST",106"status_callback": "http://my.server.org/callbacks"107},108{109"trim": true,110"video_layout": {111"grid": {112"z_pos": 0,113"reuse": "show_oldest",114"x_pos": 0,115"max_columns": null,116"cells_excluded": [],117"video_sources_excluded": [],118"height": null,119"width": null,120"max_rows": null,121"y_pos": 0,122"video_sources": [123"*"124]125}126},127"audio_sources_excluded": [],128"format": "mp4",129"date_updated": null,130"friendly_name": "MyFirstCompositionHook",131"enabled": true,132"account_sid": "ACXXXX",133"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",134"audio_sources": [135"*"136],137"sid": "HKXXXX",138"date_created": "2018-12-19T16:04:11Z",139"resolution": "640x480",140"status_callback_method": "POST",141"status_callback": "http://my.server.org/callbacks"142},143{144"trim": true,145"video_layout": {146"grid": {147"z_pos": 0,148"reuse": "show_oldest",149"x_pos": 0,150"max_columns": null,151"cells_excluded": [],152"video_sources_excluded": [],153"height": null,154"width": null,155"max_rows": null,156"y_pos": 0,157"video_sources": [158"*"159]160}161},162"audio_sources_excluded": [],163"format": "mp4",164"date_updated": "2018-12-19T15:52:08Z",165"friendly_name": "llf-composition-hook-test",166"enabled": false,167"account_sid": "ACXXXX",168"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",169"audio_sources": [170"*"171],172"sid": "HKXXXX",173"date_created": "2018-12-19T15:09:41Z",174"resolution": "640x480",175"status_callback_method": "POST",176"status_callback": null177}178],179"meta": {180"page": 0,181"page_size": 50,182"first_page_url": "https://video.twilio.com/v1/CompositionHooks?PageSize=50&Page=0",183"previous_page_url": null,184"url": "https://video.twilio.com/v1/CompositionHooks?PageSize=50&Page=0",185"next_page_url": null,186"key": "composition_hooks"187}188}
A very important aspect that you must remember is that we do not support
partial updates. This means that you must provide all POST
parameters
on every update operation. In other words, any optional parameter you
don't provide will be reset (i.e. set to its default value) with the
update.
Just for illustration, the following example updates the above-created Grid Composition Hook to disable it. Observe that we need to provide again all the properties that were set during the create operation.
1// NOTE: This example uses the next generation Twilio helper library - for more2// information on how to download and install this version, visit3// https://www.twilio.com/docs/libraries/node45// Find your credentials at twilio.com/console6// To set up environmental variables, see http://twil.io/secure7const API_KEY_SID = process.env.TWILIO_API_KEY;8const API_KEY_SECRET = process.env.TWILIO_API_KEY_SECRET;9const ACCOUNT_SID = process.env.TWILIO_ACCOUNT_SID;1011const Twilio = require('twilio');1213const client = new Twilio(API_KEY_SID, API_KEY_SECRET, {accountSid: ACCOUNT_SID});1415client.video.compositionHooks('HKXXXX')16update({17friendlyName: 'MyFirstCompositionHook',18enabled: false,19audioSources: '*',20videoLayout: {21grid : {22video_sources: ['*']23}24},25statusCallback: 'http://my.server.org/callbacks',26format: 'mp4'27})28.then(compositionHook =>{29console.log('Updated Composition Hook with SID=' + compositionHook.sid);30});
1{2"account_sid": "ACXXXX",3"sid": "HKXXXX",4"friendly_name": "MyFirstCompositionHook",5"enabled": false,6"date_created": "2018-12-19T16:04:11Z",7"date_updated": "2018-12-19T16:55:21Z",8"audio_sources": [9"*"10],11"audio_sources_excluded": [],12"video_layout": {13"grid": {14"z_pos": 0,15"reuse": "show_oldest",16"x_pos": 0,17"max_columns": null,18"cells_excluded": [],19"video_sources_excluded": [],20"height": null,21"width": null,22"max_rows": null,23"y_pos": 0,24"video_sources": [25"*"26]27}28},29"format": "mp4",30"trim": true,31"resolution": "640x480",32"url": "https://video.twilio.com/v1/CompositionHooks/HKXXXX",33"status_callback_method": "POST",34"status_callback": "http://my.server.org/callbacks"35}
For executing this example you need:
SKXXXX:your_api_key_secret
)
HKXXXX
)
1// NOTE: This example uses the next generation Twilio helper library - for more2// information on how to download and install this version, visit3// https://www.twilio.com/docs/libraries/node45const apiKeySid = 'SKXXXX';6const apiKeySecret = 'your_api_key_secret';7// To set up environmental variables, see http://twil.io/secure8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const Twilio = require('twilio');1011const client = new Twilio(apiKeySid, apiKeySecret, {accountSid: accountSid});1213client.video.compositionHooks('HKXXXX').14remove()15.then(response =>{16console.log('Composition Hook removed');17});
A successful request returns an HTTP status code 204 and an empty body
There are no known problems.