# Service enfonica.voice.v1beta1.Recordings

## Methods

| DeleteRecording |
| -- |
| <span class="e-code">rpc DeleteRecording(<span class="e-code">[DeleteRecordingRequest](#deleterecordingrequest)</span>) returns (<span class="e-code">[Recording](#resource-recording)</span>)</span><br/><br/>Deletes a recording.<br/><br/>The caller must have `voice.recordings.delete` permission on the project. |

| GetRecording |
| -- |
| <span class="e-code">rpc GetRecording(<span class="e-code">[GetRecordingRequest](#getrecordingrequest)</span>) returns (<span class="e-code">[Recording](#resource-recording)</span>)</span><br/><br/>Retrieves a Recording identified by the supplied resource name.<br/><br/>The caller must have `voice.recordings.get` permission on the project. |

| ListRecordings |
| -- |
| <span class="e-code">rpc ListRecordings(<span class="e-code">[ListRecordingsRequest](#listrecordingsrequest)</span>) returns (<span class="e-code">[ListRecordingsResponse](#listrecordingsresponse)</span>)</span><br/><br/>Lists the Recordings of the specified project. List returns Recordings sorted by create_time descending.<br/><br/>The caller must have `voice.recordings.list` permission on the project. |

## Resource: Recording

The Recording resource. This represents a recording, which can either be a recording of a small section of the call (eg recorded using the `<Record>` action), or a recording of an entire call.

Fields | &nbsp;
--|--
<span class="e-code">name</span> | <span class="e-code">string</span><br/>Resource name of the recording. It must match the pattern `projects/*/calls/*/recordings/*`. The call will always refer to the parent leg of a two-leg call.
<span class="e-code">state</span> | <span class="e-code">[State](#recordingstate)</span><br/>Output only. The state of the recording.
<span class="e-code">source</span> | <span class="e-code">[Source](#recordingsource)</span><br/>The source of the recording. This lets you know what triggered the recording to begin. This cannot be set by users.
<span class="e-code">duration</span> | <span class="e-code"><a href="https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration" target="_blank">google.protobuf.Duration</a></span><br/>Output only. The duration of the recording, after any post processing. This is only set when the state is SUCCEEDED.
<span class="e-code">channel_count</span> | <span class="e-code">int32</span><br/>Output only. The number of channels that have been recorded.
<span class="e-code">post_processing[]</span> | <span class="e-code">[PostProcessing](/docs/cloud-voice/api-reference/rpc/enfonica.voice.v1beta1/PostProcessing/)</span><br/>The post processing that should be applied to the recording.
<span class="e-code">error_code</span> | <span class="e-code">[ErrorCode](#recordingerrorcode)</span><br/>Output only. When state is FAILED, an error code describing the type of error that occurred.
<span class="e-code">audio[]</span> | <span class="e-code">[RecordingAudio](#recordingaudio)</span><br/>Output only. The audio that was recorded in various formats and encodings. For non-empty, successful recordings, there should always be an `audio/x-wav` and `audio/mpeg` recording.
<span class="e-code">start_time</span> | <span class="e-code"><a href="https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp" target="_blank">google.protobuf.Timestamp</a></span><br/>Output only. The start time of the recording. This is when recording on the call started. Only set when state is SUCCEEDED.
<span class="e-code">create_time</span> | <span class="e-code"><a href="https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#timestamp" target="_blank">google.protobuf.Timestamp</a></span><br/>Output only. The creation time of the recording. This is the time that the recording resource was created. This is usually immediately before `start_time`, but can be afterwards if processing was delayed. Output only.
<span class="e-code">ready_uri</span> | <span class="e-code">string</span><br/>The URI to send the recording ready webhook to when the state transitions to a terminal state (SUCCEEDED, EMPTY, FAILED). Must be an absolute URI.

## PostProcessing

Post processing options.

Enums | &nbsp;
--|--
<span class="e-code">POST_PROCESSING_UNSPECIFIED</span> | Unspecified post processing.
<span class="e-code">TRIM_SILENCE</span> | Trim silence from the start and end of the audio.

## Recording.ErrorCode

Error code definitions.

Enums | &nbsp;
--|--
<span class="e-code">ERROR_CODE_UNSPECIFIED</span> | Unspecified error code.
<span class="e-code">TIMEOUT</span> | A timeout occurred, where a pending recording did not complete within the expected timeframe.
<span class="e-code">INTERNAL_ERROR</span> | An internal error occurred while processing the recording.

## Recording.Source

The source of the recording. It is anticipated that additional values will be added in the future.

Enums | &nbsp;
--|--
<span class="e-code">SOURCE_UNSPECIFIED</span> | Unspecified recording source.
<span class="e-code">RECORD_ACTION</span> | The recording was created by the `<Record>` action.
<span class="e-code">CALL_RECORDING</span> | The recording was created by call recording.

## Recording.State

The state of the recording.

Enums | &nbsp;
--|--
<span class="e-code">STATE_UNSPECIFIED</span> | Unspecified state.
<span class="e-code">PENDING</span> | The audio is currently being recorded, or recording has finished and the audio is pending processing.
<span class="e-code">SUCCEEDED</span> | The audio has successfully been recorded.
<span class="e-code">EMPTY</span> | The audio that was recorded was completely silent.
<span class="e-code">FAILED</span> | The audio failed to be recorded due to a system error. For more information, see the value of error_code.

## RecordingAudio

Audio that is associated with a recording.

Fields | &nbsp;
--|--
<span class="e-code">mime_type</span> | <span class="e-code">string</span><br/>The MIME type of the audio file. This will likely be "audio/x-wav" or "audio/mpeg".
<span class="e-code">encoding</span> | <span class="e-code">[AudioEncoding](#recordingaudioaudioencoding)</span><br/>The encoding of the audio.
<span class="e-code">sample_rate</span> | <span class="e-code">int32</span><br/>The sample rate of the audio. This will likely be 8000.
<span class="e-code">size_bytes</span> | <span class="e-code">int32</span><br/>The size of the audio in bytes.
<span class="e-code">uri</span> | <span class="e-code">string</span><br/>An ephemeral URI that can be used to download the recording. The URI is valid for 60 minutes. Note that this field is only included in the FULL view.

## RecordingAudio.AudioEncoding

The audio encoding used. It is anticipated that additional values will be added in the future.

Enums | &nbsp;
--|--
<span class="e-code">AUDIO_ENCODING_UNSPECIFIED</span> | Unspecified audio encoding.
<span class="e-code">AUDIO_ENCODING_PCM_16BIT</span> | PCM 16 bit per sample.
<span class="e-code">AUDIO_ENCODING_MP3</span> | MP3 compressed.

## GetRecordingRequest

The GetRecording request recording.

Fields | &nbsp;
--|--
<span class="e-code">name</span> | <span class="e-code">string</span><br/>Required. The resource name of the Recording to retrieve. Must be of the form `projects/*/calls/*/recordings/*`.
<span class="e-code">view</span> | <span class="e-code">[RecordingView](#recordingview)</span><br/>Configuration of partial responses. Defaults to FULL.

## RecordingView

Configuration of partial responses for the Recording resource.

Enums | &nbsp;
--|--
<span class="e-code">RECORDING_VIEW_UNSPECIFIED</span> | The default / unset value. The API will default to BASIC for ListRecordings and FULL for GetRecording.
<span class="e-code">BASIC</span> | Includes all fields except [RecordingAudio.uri][enfonica.voice.v1beta1.RecordingAudio.uri]. This is the default for ListRecordings.
<span class="e-code">FULL</span> | Includes all fields. This is the default for GetRecording.

## ListRecordingsRequest

The ListRecordings request recording.

Fields | &nbsp;
--|--
<span class="e-code">parent</span> | <span class="e-code">string</span><br/>Required. The resource name of the parent of which to list recordings. May be of the form `projects/*/calls/*` to list the recordings of that specific call, or `projects/*` to list recordings across the entire project, which maps to `projects/*/calls/-`.
<span class="e-code">page_size</span> | <span class="e-code">int32</span><br/>The maximum number of Recordings to return in the response. Default value of 10 and maximum value of 100.
<span class="e-code">page_token</span> | <span class="e-code">string</span><br/>A pagination token returned from a previous recording to `ListRecordings` that indicates where this listing should continue from.
<span class="e-code">view</span> | <span class="e-code">[RecordingView](#recordingview)</span><br/>Configuration of partial responses. Defaults to BASIC.

## ListRecordingsResponse

The ListRecordings response recording.

Fields | &nbsp;
--|--
<span class="e-code">recordings[]</span> | <span class="e-code">[Recording](#resource-recording)</span><br/>A possibly paginated list of Recordings that are direct descendants of the specified parent resource.
<span class="e-code">next_page_token</span> | <span class="e-code">string</span><br/>A pagination token returned from a previous recording to `ListRecordings` that indicates from where listing should continue.

## DeleteRecordingRequest

The DeleteRecording request message.

Fields | &nbsp;
--|--
<span class="e-code">name</span> | <span class="e-code">string</span><br/>Required. The resource name of the Recording to be deleted. Must be of the form `projects/*/calls/*/recordings/*`.

