{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/twilio/main/json-schema/twilio-create-composition-request-2-schema.json", "title": "CreateCompositionRequest_2", "x-generated": "2026-10-08", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/twilio-compositions-api-openapi.yml#/components/schemas/CreateCompositionRequest_2", "type": "object", "required": [ "RoomSid" ], "properties": { "RoomSid": { "type": "string", "minLength": 34, "maxLength": 34, "pattern": "^RM[0-9a-fA-F]{32}$", "description": "The SID of the Group Room with the media tracks to be used as composition sources." }, "VideoLayout": { "description": "An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request" }, "AudioSources": { "type": "array", "items": { "type": "string" }, "description": "An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition 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 will match zero or more characters in a track name. For example, `student*` includes `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" }, "AudioSourcesExcluded": { "type": "array", "items": { "type": "string" }, "description": "An array of track names to exclude. The new composition 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 will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty." }, "Resolution": { "type": "string", "description": "A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. \nThe string's format is `{width}x{height}` where: \n\n* 16 <= `{width}` <= 1280\n* 16 <= `{height}` <= 1280\n* `{width}` * `{height}` <= 921,600\n\nTypical values are: \n\n* HD = `1280x720`\n* PAL = `1024x576`\n* VGA = `640x480`\n* CIF = `320x240`\n\nNote 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](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info." }, "Format": { "type": "string", "$ref": "#/$defs/composition_enum_format", "description": "The container format of the composition's media files. Can be: `mp4` or `webm` and the default is `webm`. If you specify `mp4` or `webm`, you must also specify one or more `audio_sources` and/or a `video_layout` element that contains a valid `video_sources` list, otherwise an error occurs." }, "StatusCallback": { "type": "string", "format": "uri", "description": "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." }, "StatusCallbackMethod": { "type": "string", "format": "http-method", "enum": [ "HEAD", "GET", "POST", "PATCH", "PUT", "DELETE" ], "description": "The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`." }, "Trim": { "type": "boolean", "description": "Whether to clip the intervals where there is no active media in the composition. 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](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info." } }, "$defs": { "composition_enum_format": { "type": "string", "enum": [ "mp4", "webm" ] } } }