# REST Resource: projects.recordings

## 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.

<div class="highlight"><span class="filename">JSON representation</span><pre><code><span class="p">{</span>
  <span class="s2">&quot;name&quot;</span><span class="p">: </span><span class="kd">string</span><span class="p">,</span>
  <span class="s2">&quot;state&quot;</span><span class="p">: </span><span class="kd">enum (</span><a href="#recordingstate"><strong><span class="kd">State</span></strong></a><span class="kd">)</span><span class="p">,</span>
  <span class="s2">&quot;source&quot;</span><span class="p">: </span><span class="kd">enum (</span><a href="#recordingsource"><strong><span class="kd">Source</span></strong></a><span class="kd">)</span><span class="p">,</span>
  <span class="s2">&quot;duration&quot;</span><span class="p">: </span><span class="kd">string (</span><a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank"><strong><span class="kd">Duration</span></strong></a><span class="kd">)</span><span class="p">,</span>
  <span class="s2">&quot;channelCount&quot;</span><span class="p">: </span><span class="kd">number (</span><a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank"><strong><span class="kd">int32</span></strong></a><span class="kd">)</span><span class="p">,</span>
  <span class="s2">&quot;postProcessing&quot;</span><span class="p">: </span><span class="p">[</span>
    <span class="kd">enum (</span><a href="/docs/cloud-voice/api-reference/rest/v1beta1/PostProcessing/"><strong><span class="kd">PostProcessing</span></strong></a><span class="kd">)</span>
  <span class="p">]</span><span class="p">,</span>
  <span class="s2">&quot;errorCode&quot;</span><span class="p">: </span><span class="kd">enum (</span><a href="#recordingerrorcode"><strong><span class="kd">ErrorCode</span></strong></a><span class="kd">)</span><span class="p">,</span>
  <span class="s2">&quot;audio&quot;</span><span class="p">: </span><span class="p">[</span>
    <span class="p">{</span>
      <span class="kd">object (</span><a href="/docs/cloud-voice/api-reference/rest/v1beta1/RecordingAudio/"><strong><span class="kd">RecordingAudio</span></strong></a><span class="kd">)</span>
    <span class="p">}</span>
  <span class="p">]</span><span class="p">,</span>
  <span class="s2">&quot;startTime&quot;</span><span class="p">: </span><span class="kd">string (</span><a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank"><strong><span class="kd">Timestamp</span></strong></a><span class="kd">)</span><span class="p">,</span>
  <span class="s2">&quot;createTime&quot;</span><span class="p">: </span><span class="kd">string (</span><a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank"><strong><span class="kd">Timestamp</span></strong></a><span class="kd">)</span><span class="p">,</span>
  <span class="s2">&quot;readyUri&quot;</span><span class="p">: </span><span class="kd">string</span>
<span class="p">}</span></code></pre></div>

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">enum ([State](#recordingstate))</span><br/>Output only. The state of the recording.
<span class="e-code">source</span> | <span class="e-code">enum ([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">string (<a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank">Duration</a> format)</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">channelCount</span> | <span class="e-code">number (<a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank">int32</a> format)</span><br/>Output only. The number of channels that have been recorded.
<span class="e-code">postProcessing[]</span> | <span class="e-code">enum ([PostProcessing](/docs/cloud-voice/api-reference/rest/v1beta1/PostProcessing/))</span><br/>The post processing that should be applied to the recording.
<span class="e-code">errorCode</span> | <span class="e-code">enum ([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">object ([RecordingAudio](/docs/cloud-voice/api-reference/rest/v1beta1/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">startTime</span> | <span class="e-code">string (<a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank">Timestamp</a> format)</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">createTime</span> | <span class="e-code">string (<a href="https://developers.google.com/protocol-buffers/docs/proto3#json" target="_blank">Timestamp</a> format)</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">readyUri</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.

## 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.

## 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.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.

## Methods

Methods | &nbsp;
--|--
<span class="e-code">[list](/docs/cloud-voice/api-reference/rest/v1beta1/projects.recordings/list/)</span> | <span class="e-code">GET /v1beta1/{parent}/recordings</span><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.

