> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Recording

The `<Recording>` instruction starts a non-blocking call recording when nested inside `<Start>`. After recording starts, Telnyx immediately continues executing the next TeXML instruction. The recording stops when the call ends or when it is stopped with the Stop Recording command.

## Attributes

<table>
  <thead>
    <tr>
      <th>ATTRIBUTE</th>
      <th>DESCRIPTION</th>
      <th>OPTIONS</th>
      <th>DEFAULT</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>recordingStatusCallback</code></td>
      <td> Optional URL that tells Telnyx where to make its GET or POST request when recording status events occur. Relative URLs are resolved against the current TeXML document URL. </td>

      <td />

      <td>-</td>
    </tr>

    <tr>
      <td><code>recordingStatusCallbackMethod</code></td>
      <td> HTTP request type used for recordingStatusCallback. </td>
      <td><code>GET</code>, <code>POST</code></td>
      <td><code>POST</code></td>
    </tr>

    <tr>
      <td><code>recordingStatusCallbackEvent</code></td>
      <td> The recording events for which Telnyx should send a webhook to the recordingStatusCallback URL. Multiple events are separated by a space. </td>
      <td><code>in-progress</code>, <code>completed</code>, <code>absent</code></td>
      <td><code>completed</code></td>
    </tr>

    <tr>
      <td><code>channels</code></td>
      <td> Specifies whether the final audio file should be recorded as one channel or two channels. Use mono or single for a single-channel recording. </td>
      <td><code>mono</code>, <code>single</code>, <code>dual</code></td>
      <td><code>dual</code></td>
    </tr>

    <tr>
      <td><code>track</code></td>
      <td> Specifies which track should be recorded. </td>
      <td><code>inbound</code>, <code>outbound</code>, <code>both</code></td>
      <td><code>both</code></td>
    </tr>

    <tr>
      <td><code>trim</code></td>
      <td> Removes silence from the beginning and end of the recording when set to trim-silence. </td>
      <td><code>trim-silence</code></td>
      <td>-</td>
    </tr>

    <tr>
      <td><code>format</code></td>
      <td> The format of the recording file. </td>
      <td><code>mp3</code>, <code>wav</code></td>
      <td><code>mp3</code></td>
    </tr>
  </tbody>
</table>

## Examples

Start a recording and continue immediately to the next TeXML instruction:

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Start>
    <Recording />
  </Start>
  <Say>Recording has started.</Say>
</Response>
```

Start a dual-channel recording and receive status callbacks:

```xml theme={null}
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Start>
    <Recording
      channels="dual"
      track="both"
      format="mp3"
      trim="trim-silence"
      recordingStatusCallback="https://example.com/recording-status"
      recordingStatusCallbackMethod="POST"
      recordingStatusCallbackEvent="in-progress completed absent" />
  </Start>
  <Say>This call may be recorded for quality assurance.</Say>
</Response>
```

## Expected callbacks

If `recordingStatusCallback` is set, recording status callbacks are sent for the events listed in `recordingStatusCallbackEvent`:

| Event         | Callback Reference                                                            |
| ------------- | ----------------------------------------------------------------------------- |
| `in-progress` | [Recording In Progress](/api-reference/callbacks/texml-recording-in-progress) |
| `completed`   | [Recording Completed](/api-reference/callbacks/texml-recording-completed)     |
| `absent`      | Recording failed or was not created                                           |

When `recordingStatusCallbackEvent` is not provided, Telnyx sends the `completed` callback by default.
