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

# Record calls and ask for consent

> Turn call recording on or off for an application, play a consent prompt first, and find the recording after the call.

Fonoster records calls by policy, not from your code. You set a recording policy on the
application, and every call it takes follows it. The recording is saved with the call's signed
[call record](https://docs.fonoster.com/observe/call-records.md).

## The policies

| Policy | What happens |
| - | - |
| `off` | Nothing is recorded. |
| `on` | The whole call is recorded from the moment it reaches your application. |
| `consent` | The caller first hears a consent prompt, then recording starts. |

Your application can't start, stop or pause the recording during the call. The Voice SDK has no
record verb.

## Set the policy

**Dashboard**

* **Stream**: go to **Streams**, open the stream, and go to the **Call handling** tab.
* **Autopilot agent**: open the agent, go to the **Advanced** tab, and choose **Edit** on the
  **Call handling** panel.

Under **Recording**, choose **Off**, **On** or **On after consent prompt**, then choose
**Save**. **Workspace default** leaves the choice to the default (see below).

**SDK**

Set `recording` when you create or update the application. An update replaces the whole
application, so read it first, change `recording`, and send all of it back:

```javascript theme={"system"}
const apps = new SDK.Applications(client);
const app = await apps.getApplication("6c1e2f4a-8b3d-4e7a-9f10-2d5c7b9e4a31");
await apps.updateApplication({ ...app, recording: "consent" });
```

**CLI**

```bash theme={"system"}
fonoster applications:update 6c1e2f4a-8b3d-4e7a-9f10-2d5c7b9e4a31 --recording consent
```

`--recording` takes `off`, `on` or `consent`.

## Which policy applies

Fonoster uses the first policy that's set, in this order:

1. The application's policy.
2. The workspace's policy.
3. The region's default.
4. `off`.

An application left on **Workspace default** follows the workspace's policy, or the region's
default if the workspace has none. To be sure a call is recorded, or not, set the policy on the
application.

> [!NOTE]
>
> On your own install, the operator sets the workspace policies and the region default in the call
> record configuration. See [Tune turn-taking and audio](https://docs.fonoster.com/self-hosting/turn-taking-and-audio.md).

If the call goes to the application's fallback because the application couldn't be reached, the
fallback application's policy applies.

## The consent prompt

With `consent`, Fonoster answers the call and plays the consent prompt before your application
starts. Your agent's first message, or your stream's first `say`, comes after it. The caller can't
interrupt the prompt.

* **Words**: "This call will be recorded." On your own install, the operator can change the
  wording.
* **Voice and language**: the application's voice and language, from its `speech` settings.

The wording isn't translated: it's the same text for every application. A Spanish agent reads the
English sentence in its Spanish voice. If your callers don't speak English, check what they hear,
or ask for consent in your own words (see below).

The call record notes that consent was requested. Recording starts after the prompt, whatever the
caller does. If the caller doesn't agree, they hang up. To let callers decline and stay on the line,
set the policy to `off`, ask for consent in your own words, and keep your own record of the answer.

## What you get

The recording is a stereo WAV file at 16 kHz:

* **Left channel**: the caller.
* **Right channel**: your agent or stream.

Keeping the sides apart lets you transcribe or analyze each one alone.

After a transfer, recording goes on for `cold` and `warm` transfers, so the operator's part of the
call is in the file too. A `refer` transfer ends the recording at the transfer. See
[Transfer calls](https://docs.fonoster.com/telephony/transfers.md).

## Get the recording

When the call ends, Fonoster seals the call record with the recording in it. Open the call under
**Calls** in the dashboard and download it there, or run:

```bash theme={"system"}
fonoster records:download 1d7f3a9c-5e2b-4c8d-9a6f-3b1e7d5c2a94
```

It saves `1d7f3a9c-5e2b-4c8d-9a6f-3b1e7d5c2a94.wav`. To know when a recording is ready, subscribe to
the `call_record.sealed` [webhook](https://docs.fonoster.com/observe/webhooks.md). [Call records](https://docs.fonoster.com/observe/call-records.md) covers
fetching, verifying and redacted copies, and [Retention and erasure](https://docs.fonoster.com/observe/retention.md) covers how
long recordings are kept.

The `recording` field is in [Autopilot configuration](https://docs.fonoster.com/reference/autopilot-config.md#recording).

## Next steps

> **[Call records](https://docs.fonoster.com/observe/call-records.md)**
>
> Fetch the recording, transcript and signature of a call.

> **[Retention and erasure](https://docs.fonoster.com/observe/retention.md)**
>
> Delete recordings after a set time, or on request.

> **[Webhooks](https://docs.fonoster.com/observe/webhooks.md)**
>
> Get told when a recording is ready.

> **[Transfer calls](https://docs.fonoster.com/telephony/transfers.md)**
>
> How transfers affect the recording.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.