openapi: 3.0.1 info: title: Twilio - Accounts A2p CompositionHooks API description: This is the public Twilio REST API. termsOfService: https://www.twilio.com/legal/tos contact: name: Twilio Support url: https://support.twilio.com email: support@twilio.com license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html version: 1.52.0 servers: - url: https://accounts.twilio.com tags: - name: CompositionHooks paths: /v1/CompositionHooks/{Sid}: servers: - url: https://video.twilio.com description: Recording composition hooks x-twilio: defaultOutputProperties: - sid - friendly_name - date_created pathType: instance get: description: Returns a single CompositionHook resource identified by a CompositionHook SID. tags: - CompositionHooks parameters: - name: Sid in: path description: The SID of the CompositionHook resource to fetch. schema: type: string minLength: 34 maxLength: 34 pattern: ^HK[0-9a-fA-F]{32}$ required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/video.v1.composition_hook' description: OK security: - accountSid_authToken: [] operationId: FetchCompositionHook x-maturity: - GA delete: description: Delete a Recording CompositionHook resource identified by a `CompositionHook SID`. tags: - CompositionHooks parameters: - name: Sid in: path description: The SID of the CompositionHook resource to delete. schema: type: string minLength: 34 maxLength: 34 pattern: ^HK[0-9a-fA-F]{32}$ required: true responses: '204': description: The resource was deleted successfully. security: - accountSid_authToken: [] operationId: DeleteCompositionHook x-maturity: - GA post: description: '' tags: - CompositionHooks parameters: - name: Sid in: path description: The SID of the CompositionHook resource to update. schema: type: string minLength: 34 maxLength: 34 pattern: ^HK[0-9a-fA-F]{32}$ required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/video.v1.composition_hook' description: OK security: - accountSid_authToken: [] operationId: UpdateCompositionHook x-maturity: - GA requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/UpdateCompositionHookRequest' /v1/CompositionHooks: servers: - url: https://video.twilio.com description: Recording composition hooks x-twilio: defaultOutputProperties: - sid - friendly_name - date_created pathType: list get: description: List of all Recording CompositionHook resources. tags: - CompositionHooks parameters: - name: Enabled in: query description: Read only CompositionHook resources with an `enabled` value that matches this parameter. schema: type: boolean - name: DateCreatedAfter in: query description: Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. schema: type: string format: date-time - name: DateCreatedBefore in: query description: Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. schema: type: string format: date-time - name: FriendlyName in: query description: 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. schema: type: string - name: PageSize in: query description: How many resources to return in each list page. The default is 50, and the maximum is 1000. schema: type: integer minimum: 1 maximum: 1000 - name: Page in: query description: The page index. This value is simply for client state. schema: type: integer minimum: 0 - name: PageToken in: query description: The page token. This is provided by the API. schema: type: string responses: '200': content: application/json: schema: $ref: '#/components/schemas/ListCompositionHookResponse' description: OK security: - accountSid_authToken: [] operationId: ListCompositionHook x-maturity: - GA post: description: '' tags: - CompositionHooks responses: '201': content: application/json: schema: $ref: '#/components/schemas/video.v1.composition_hook' description: Created security: - accountSid_authToken: [] operationId: CreateCompositionHook x-maturity: - GA requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CreateCompositionHookRequest' components: schemas: UpdateCompositionHookRequest: type: object required: - FriendlyName properties: FriendlyName: type: string description: 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. Enabled: type: boolean description: 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. VideoLayout: description: A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. AudioSources: type: array items: type: string description: 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`. AudioSourcesExcluded: type: array items: type: string description: 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. Trim: type: boolean description: 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](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Format: type: string $ref: '#/components/schemas/composition_hook_enum_format' description: '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.' 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." 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`.' video.v1.composition_hook: type: object properties: account_sid: type: string minLength: 34 maxLength: 34 pattern: ^AC[0-9a-fA-F]{32}$ nullable: true description: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionHook resource. friendly_name: type: string nullable: true description: The string that you assigned to describe the resource. Can be up to 100 characters long and must be unique within the account. enabled: type: boolean nullable: true description: 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. date_created: type: string format: date-time nullable: true description: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. date_updated: type: string format: date-time nullable: true description: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. sid: type: string minLength: 34 maxLength: 34 pattern: ^HK[0-9a-fA-F]{32}$ nullable: true description: The unique string that we created to identify the CompositionHook resource. audio_sources: type: array items: type: string nullable: true description: 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 x-twilio: pii: handling: standard deleteSla: 30 audio_sources_excluded: type: array items: type: string nullable: true description: 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. x-twilio: pii: handling: standard deleteSla: 30 video_layout: nullable: true description: 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](https://www.twilio.com/docs/video/api/compositions-resource#http-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 x-twilio: pii: handling: standard deleteSla: 30 resolution: type: string nullable: true description: 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`. trim: type: boolean nullable: true description: 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](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. format: type: string $ref: '#/components/schemas/composition_hook_enum_format' nullable: true description: 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. status_callback: type: string format: uri nullable: true description: The URL we call using the `status_callback_method` to send status information to your application. status_callback_method: type: string format: http-method enum: - HEAD - GET - POST - PATCH - PUT - DELETE nullable: true description: The HTTP method we should use to call `status_callback`. Can be `POST` or `GET` and defaults to `POST`. url: type: string format: uri nullable: true description: The absolute URL of the resource. CreateCompositionHookRequest: type: object required: - FriendlyName properties: FriendlyName: type: string description: 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. Enabled: type: boolean description: 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. VideoLayout: description: An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. AudioSources: type: array items: type: string description: 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`. AudioSourcesExcluded: type: array items: type: string description: 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. 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: '#/components/schemas/composition_hook_enum_format' description: '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.' 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 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](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. composition_hook_enum_format: type: string enum: - mp4 - webm ListCompositionHookResponse: type: object properties: composition_hooks: type: array items: $ref: '#/components/schemas/video.v1.composition_hook' meta: type: object properties: first_page_url: type: string format: uri next_page_url: type: string format: uri nullable: true page: type: integer page_size: type: integer previous_page_url: type: string format: uri nullable: true url: type: string format: uri key: type: string securitySchemes: accountSid_authToken: type: http scheme: basic x-maturity: - name: GA description: This product is Generally Available. - name: Beta description: PLEASE NOTE that this is a Beta product that is subject to change. Use it with caution.