# `Twilio.Calls.Recordings`

API calls: `create`, `delete`, `list`, `retrieve`, `update`.

# `create`

```elixir
@spec create(String.t(), map() | keyword(), keyword()) ::
  {:ok, Twilio.Schemas.CallRecording.t()} | {:error, Infusion.Runtime.Error.t()}
```

Create a recording for the call

`POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json`

## Path parameters

  * `call_sid` (required) - The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) to associate the resource with.

`{AccountSid}` in the path is the `:account_sid` setting; pass `account_sid: "..."` as an option to use another.

## Parameters

  * `recording_channels` - The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels.
  * `recording_configuration_id` - The identifier of the configuration to be used when creating and processing the recording
  * `recording_status_callback` - The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback).
  * `recording_status_callback_event` - The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space.
  * `recording_status_callback_method` - The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`.
  * `recording_track` - The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio.
  * `trim` - Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not.

# `create!`

```elixir
@spec create!(String.t(), map() | keyword(), keyword()) ::
  Twilio.Schemas.CallRecording.t()
```

Like `create/3`, but returns the result or raises `Infusion.Runtime.Error`.

# `delete`

```elixir
@spec delete(String.t(), String.t(), keyword()) ::
  {:ok, nil} | {:error, Infusion.Runtime.Error.t()}
```

Delete a recording from your account

`DELETE /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json`

## Path parameters

  * `call_sid` (required) - The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to delete.
  * `sid` (required) - The Twilio-provided string that uniquely identifies the Recording resource to delete.

`{AccountSid}` in the path is the `:account_sid` setting; pass `account_sid: "..."` as an option to use another.

# `delete!`

```elixir
@spec delete!(String.t(), String.t(), keyword()) :: nil
```

Like `delete/3`, but returns the result or raises `Infusion.Runtime.Error`.

# `list`

```elixir
@spec list(String.t(), map() | keyword(), keyword()) ::
  {:ok, Twilio.Schemas.CallsRecordingsListResponse.t()}
  | {:error, Infusion.Runtime.Error.t()}
```

Retrieve a list of recordings belonging to the call used to make the request

`GET /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json`

## Path parameters

  * `call_sid` (required) - The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read.

`{AccountSid}` in the path is the `:account_sid` setting; pass `account_sid: "..."` as an option to use another.

## Parameters

  * `date_created` - The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date.
  * `date_created_query` - The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date.
  * `date_created_query_2` - The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date.
  * `page_size` - How many resources to return in each list page. The default is 50, and the maximum is 1000.
  * `page` - The page index. This value is simply for client state.
  * `page_token` - The page token. This is provided by the API.

To read every item across all pages, use `list_all`.

# `list!`

```elixir
@spec list!(String.t(), map() | keyword(), keyword()) ::
  Twilio.Schemas.CallsRecordingsListResponse.t()
```

Like `list/3`, but returns the result or raises `Infusion.Runtime.Error`.

# `list_all`

```elixir
@spec list_all(String.t(), map() | keyword(), keyword()) ::
  {:ok, Enumerable.t()} | {:error, Infusion.Runtime.Error.t()}
```

Like `list/3`, but returns every item, from every page: a lazy stream of `Twilio.Schemas.CallRecording.t()` that fetches pages as it is read.

The first page is fetched right away, so its errors are returned; a later page that fails raises `Infusion.Runtime.Error`. Stopping early (`Enum.take/2`) fetches no more pages.

# `list_all!`

```elixir
@spec list_all!(String.t(), map() | keyword(), keyword()) :: Enumerable.t()
```

Like `list_all/3`, but returns the stream or raises `Infusion.Runtime.Error`.

# `retrieve`

```elixir
@spec retrieve(String.t(), String.t(), keyword()) ::
  {:ok, Twilio.Schemas.CallRecording.t()} | {:error, Infusion.Runtime.Error.t()}
```

Fetch an instance of a recording for a call

`GET /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json`

## Path parameters

  * `call_sid` (required) - The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource to fetch.
  * `sid` (required) - The Twilio-provided string that uniquely identifies the Recording resource to fetch.

`{AccountSid}` in the path is the `:account_sid` setting; pass `account_sid: "..."` as an option to use another.

# `retrieve!`

```elixir
@spec retrieve!(String.t(), String.t(), keyword()) :: Twilio.Schemas.CallRecording.t()
```

Like `retrieve/3`, but returns the result or raises `Infusion.Runtime.Error`.

# `update`

```elixir
@spec update(String.t(), String.t(), map() | keyword(), keyword()) ::
  {:ok, Twilio.Schemas.CallRecording.t()} | {:error, Infusion.Runtime.Error.t()}
```

Changes the status of the recording to paused, stopped, or in-progress. Note: Pass `Twilio.CURRENT` instead of recording sid to reference current active recording.

`POST /2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json`

## Path parameters

  * `call_sid` (required) - The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource to update.
  * `sid` (required) - The Twilio-provided string that uniquely identifies the Recording resource to update.

`{AccountSid}` in the path is the `:account_sid` setting; pass `account_sid: "..."` as an option to use another.

## Parameters

  * `pause_behavior` - Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`.
  * `status` (required)

# `update!`

```elixir
@spec update!(String.t(), String.t(), map() | keyword(), keyword()) ::
  Twilio.Schemas.CallRecording.t()
```

Like `update/4`, but returns the result or raises `Infusion.Runtime.Error`.

---

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