# `Twilio.Video.V1.CompositionService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/video/v1/composition_service.ex#L2)

Recording compositions

Operations: `list`, `create`, `fetch`, `delete`

# `create`

```elixir
@spec create(Twilio.Client.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Video.V1.Composition.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Operation: `CreateComposition` | Tags: VideoV1Composition

## Required Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `RoomSid` | string | The SID of the Group Room with the media tracks to be used as composition sources. |
## Optional Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `AudioSources` | array | 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 |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `AudioSourcesExcluded` | array | 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. |
| `Format` | string |  Values: `mp4`, `webm` |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Resolution` | string | 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:   * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600  Typical values are:   * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `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](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `StatusCallback` | string (uri) | 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. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `StatusCallbackMethod` | string (http-method) | The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. Values: `GET`, `POST` |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Trim` | boolean | 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. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `VideoLayout` | string | 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 |

# `delete`

```elixir
@spec delete(Twilio.Client.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}
```

Delete a Recording Composition resource identified by a Composition SID.

Operation: `DeleteComposition` | Tags: VideoV1Composition

# `fetch`

```elixir
@spec fetch(Twilio.Client.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Video.V1.Composition.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

Returns a single Composition resource identified by a Composition SID.

Operation: `FetchComposition` | Tags: VideoV1Composition

# `list`

```elixir
@spec list(Twilio.Client.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}
```

List of all Recording compositions.

Operation: `ListComposition` | Tags: VideoV1Composition

## Query Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Status` | string | Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateCreatedAfter` | string (date-time) | Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `DateCreatedBefore` | string (date-time) | Read only Composition resources created before this ISO 8601 date-time with time zone. |
| `RoomSid` | string | Read only Composition resources with this Room SID. |

# `stream`

```elixir
@spec stream(Twilio.Client.t(), map(), keyword()) :: Enumerable.t()
```

Stream: List of all Recording compositions. (lazy auto-pagination).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
