Twilio Composition Hooks API

Configure automatic composition rules

Operations 10

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /CompositionHooks List composition hooks via the legacy endpoint · Twilio List Composition Hooks #
Ask an LLM
“Is there an unversioned endpoint that lists my composition hooks?”
“Can I list only enabled hooks from the older /CompositionHooks path?”
Tell an agent
List composition hooks from the legacy unversioned endpoint.
Show legacy-endpoint composition hooks where enabled is {enabled}.
POST /CompositionHooks Create a composition hook via the legacy endpoint · Twilio Create a Composition Hook #
Ask an LLM
“Can I still create an auto-composition hook through the legacy unversioned endpoint?”
“Does the older create call accept a video layout and output format?”
Tell an agent
Create composition hook {friendly_name} through the legacy endpoint.
Use the unversioned endpoint to add hook {friendly_name} producing {format} at {resolution}.
GET /CompositionHooks/{CompositionHookSid} Look up a composition hook via the legacy endpoint · Twilio Fetch a Composition Hook #
Ask an LLM
“Can I fetch a composition hook from the older unversioned path?”
“Does the legacy endpoint still return a single hook by its SID?”
Tell an agent
Fetch composition hook {composition_hook_sid} from the legacy endpoint.
Show hook {composition_hook_sid} using the unversioned /CompositionHooks path.
POST /CompositionHooks/{CompositionHookSid} Update a composition hook via the legacy endpoint · Twilio Update a Composition Hook #
Ask an LLM
“Can I edit a composition hook through the legacy unversioned endpoint?”
“Does the older update call let me disable a hook while keeping its name?”
Tell an agent
Update legacy-endpoint hook {composition_hook_sid} to name {friendly_name} and enabled {enabled}.
Via the unversioned path, set hook {composition_hook_sid} named {friendly_name} to callback {status_callback}.
DELETE /CompositionHooks/{CompositionHookSid} Delete a composition hook via the legacy endpoint · Twilio Delete a Composition Hook #
Ask an LLM
“Can I delete a composition hook through the older unversioned path?”
“Is the legacy delete call still available for composition hooks?”
Tell an agent destructive · confirm first
Delete composition hook {composition_hook_sid} through the legacy endpoint.
Remove hook {composition_hook_sid} using the unversioned /CompositionHooks path.
GET /v1/CompositionHooks/{Sid} Look up one composition hook · Fetch composition hook #
Ask an LLM
“Can I check how a single composition hook is configured?”
“Is a particular auto-composition hook currently enabled?”
Tell an agent
Fetch v1 composition hook {sid}.
Show the layout and format settings of hook {sid}.
DELETE /v1/CompositionHooks/{Sid} Delete a composition hook · Delete composition hook #
Ask an LLM
“Can I permanently remove a composition hook I don't need anymore?”
“How do I stop auto-compositions for good by deleting the hook?”
Tell an agent destructive · confirm first
Delete v1 composition hook {sid}.
Permanently remove auto-composition hook {sid}.
POST /v1/CompositionHooks/{Sid} Update a composition hook's settings · Update composition hook #
Ask an LLM
“Can I pause a composition hook so completed Group Rooms stop being composed?”
“Can I change which audio sources an existing hook mixes in?”
Tell an agent
Disable v1 composition hook {sid} named {friendly_name} by setting enabled to {enabled}.
Change the audio sources on hook {sid} ({friendly_name}) to {audio_sources}.
GET /v1/CompositionHooks List composition hooks with filters · List composition hook #
Ask an LLM
“Which composition hooks are active on my account right now?”
“Can I search my hooks by friendly name or creation date?”
Tell an agent
List my v1 composition hooks where enabled is {enabled}.
Find composition hooks named {friendly_name}.
POST /v1/CompositionHooks Auto-compose recordings when rooms end · Create composition hook #
Ask an LLM
“Can every completed video room be turned into a composition automatically?”
“Can I choose the resolution and file format of automatically generated compositions?”
Tell an agent
Create a v1 composition hook named {friendly_name}.
Set up hook {friendly_name} with layout {video_layout} and audio from {audio_sources}.

Documentation

Specifications

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/twilio-composition-hooks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

twilio-composition-hooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Twilio Video Composition Hooks API
  description: Build real-time video communication applications with Twilio's Video API. Create and manage video rooms, control participants, manage recordings and compositions, and configure recording rules.
  version: '2.0'
  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
  termsOfService: https://www.twilio.com/legal/tos
servers:
- url: https://video.twilio.com/v1
  description: Twilio Video API v1
security:
- accountSid_authToken: []
tags:
- name: Composition Hooks
  description: Configure automatic composition rules
paths:
  /CompositionHooks:
    get:
      operationId: listCompositionHooks
      summary: Twilio List Composition Hooks
      tags:
      - Composition Hooks
      parameters:
      - name: Enabled
        in: query
        schema:
          type: boolean
      - name: PageSize
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
      responses:
        '200':
          description: List of composition hooks
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompositionHookList'
    post:
      operationId: createCompositionHook
      summary: Twilio Create a Composition Hook
      description: Create a composition hook that automatically generates compositions when rooms complete.
      tags:
      - Composition Hooks
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateCompositionHookRequest'
      responses:
        '201':
          description: Composition hook created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompositionHook'
  /CompositionHooks/{CompositionHookSid}:
    get:
      operationId: fetchCompositionHook
      summary: Twilio Fetch a Composition Hook
      tags:
      - Composition Hooks
      parameters:
      - name: CompositionHookSid
        in: path
        required: true
        schema:
          type: string
          pattern: ^HK[0-9a-fA-F]{32}$
      responses:
        '200':
          description: Composition hook details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompositionHook'
    post:
      operationId: updateCompositionHook
      summary: Twilio Update a Composition Hook
      tags:
      - Composition Hooks
      parameters:
      - name: CompositionHookSid
        in: path
        required: true
        schema:
          type: string
          pattern: ^HK[0-9a-fA-F]{32}$
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateCompositionHookRequest'
      responses:
        '200':
          description: Composition hook updated
    delete:
      operationId: deleteCompositionHook
      summary: Twilio Delete a Composition Hook
      tags:
      - Composition Hooks
      parameters:
      - name: CompositionHookSid
        in: path
        required: true
        schema:
          type: string
          pattern: ^HK[0-9a-fA-F]{32}$
      responses:
        '204':
          description: Composition hook deleted
  /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:
      - Composition Hooks
      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
      summary: Fetch composition hook
      x-summary-source: derived
    delete:
      description: Delete a Recording CompositionHook resource identified by a `CompositionHook SID`.
      tags:
      - Composition Hooks
      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
      summary: Delete composition hook
      x-summary-source: derived
    post:
      description: ''
      tags:
      - Composition Hooks
      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'
      summary: Update composition hook
      x-summary-source: derived
  /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:
      - Composition Hooks
      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
      summary: List composition hook
      x-summary-source: derived
    post:
      description: ''
      tags:
      - Composition Hooks
      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'
      summary: Create composition hook
      x-summary-source: derived
components:
  schemas:
    PaginationMeta:
      type: object
      properties:
        page:
          type: integer
        page_size:
          type: integer
        first_page_url:
          type: string
          format: uri
        previous_page_url:
          type: string
          format: uri
        next_page_url:
          type: string
          format: uri
        url:
          type: string
          format: uri
        key:
          type: string
    CompositionHookList:
      type: object
      properties:
        composition_hooks:
          type: array
          items:
            $ref: '#/components/schemas/CompositionHook'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    CompositionHook:
      type: object
      properties:
        sid:
          type: string
          pattern: ^HK[0-9a-fA-F]{32}$
        account_sid:
          type: string
          pattern: ^AC[0-9a-fA-F]{32}$
        friendly_name:
          type: string
        enabled:
          type: boolean
        video_layout:
          type: object
        audio_sources:
          type: array
          items:
            type: string
        audio_sources_excluded:
          type: array
          items:
            type: string
        resolution:
          type: string
        format:
          type: string
          enum:
          - mp4
          - webm
        trim:
          type: boolean
        status_callback:
          type: string
          format: uri
        status_callback_method:
          type: string
        date_created:
          type: string
          format: date-time
        date_updated:
          type: string
          format: date-time
        url:
          type: string
          format: uri
    CreateCompositionHookRequest:
      type: object
      required:
      - FriendlyName
      properties:
        FriendlyName:
          type: string
        Enabled:
          type: boolean
          default: true
        VideoLayout:
          type: string
        AudioSources:
          type: array
          items:
            type: string
        AudioSourcesExcluded:
          type: array
          items:
            type: string
        Resolution:
          type: string
        Format:
          type: string
          enum:
          - mp4
          - webm
        Trim:
          type: boolean
        StatusCallback:
          type: string
          format: uri
        StatusCallbackMethod:
          type: string
          enum:
          - GET
          - POST
    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
              - 'null'
              format: uri
            page:
              type: integer
            page_size:
              type: integer
            previous_page_url:
              type:
              - string
              - 'null'
              format: uri
            url:
              type: string
              format: uri
            key:
              type: string
    video.v1.composition_hook:
      type: object
      properties:
        account_sid:
          type:
          - string
          - 'null'
          minLength: 34
          maxLength: 34
          pattern: ^AC[0-9a-fA-F]{32}$
          description: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionHook resource.
        friendly_name:
          type:
          - string
          - 'null'
          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
          - 'null'
          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
          - 'null'
          format: date-time
          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
          - 'null'
          format: date-time
          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
          - 'null'
          minLength: 34
          maxLength: 34
          pattern: ^HK[0-9a-fA-F]{32}$
          description: The unique string that we created to identify the CompositionHook resource.
        audio_sources:
          type:
          - array
          - 'null'
          items:
            type: string
          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
          - 'null'
          items:
            type: string
          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:
          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
          - 'null'
          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
          - 'null'
          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
          - 'null'
          $ref: '#/components/schemas/composition_hook_enum_format'
          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
          - 'null'
          format: uri
          description: The URL we call using the `status_callback_method` to send status information to your application.
        status_callback_method:
          type:
          - string
          - 'null'
          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 defaults to `POST`.
        url:
          type:
          - string
          - 'null'
          format: uri
          description: The absolute URL of the resource.
    composition_hook_enum_format:
      type: string
      enum:
      - mp4
      - webm
    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`.'
  securitySchemes:
    accountSid_authToken:
      type: http
      scheme: basic
      description: Use your Twilio Account SID as the username and Auth Token as the password for HTTP Basic authentication.
externalDocs:
  description: Twilio Video API Documentation
  url: https://www.twilio.com/docs/video