> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.voicebip.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.voicebip.com/_mcp/server.

# Recording Playback

> Access and play back call recordings via the API with range-request support.

Voicebip records calls when recording consent is granted (see [Voice Calls](/guides/voice-calls) for the consent flow). Recordings are stored as WAV files and retained for 30 days with automatic cleanup.

## Get a Call Recording

```bash
curl "https://api.voicebip.com/v1/calls/{call_id}/recording" \
  -H "Authorization: Bearer pk_live_your_key" \
  --output recording.wav
```

The response is an `audio/wav` binary file with `Accept-Ranges: bytes` header for seeking support.

## Range Requests

For in-browser playback or seeking within a recording, use HTTP Range requests:

```bash
curl "https://api.voicebip.com/v1/calls/{call_id}/recording" \
  -H "Authorization: Bearer pk_live_your_key" \
  -H "Range: bytes=0-1023"
```

Returns HTTP 206 Partial Content with `Content-Range` header.

## Browser Playback

Use the HTML5 audio element for browser playback. The range-request support enables seeking.

```html
<audio controls>
  <source
    src="https://api.voicebip.com/v1/calls/call_abc123/recording"
    type="audio/wav"
  />
</audio>
```

Set the `Authorization` header using a short-lived JWT from `/v1/auth/session`:

```javascript
const session = await fetch("https://api.voicebip.com/v1/auth/session", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ api_key: "pk_live_your_key" }),
});
const { token } = await session.json();

// Use the token as a query parameter for audio sources
const audioUrl = `https://api.voicebip.com/v1/calls/${callId}/recording?token=${token}`;
```

## Recording Lifecycle

| Stage                  | Description                               |
| ---------------------- | ----------------------------------------- |
| Call starts            | Recording begins after DTMF "1" consent   |
| Call ends              | WAV file saved to persistent storage      |
| call.completed webhook | `recording_url` field included in payload |
| 30 days                | Recording automatically deleted           |

## Error Responses

| Status | Meaning                                                                                                |
| ------ | ------------------------------------------------------------------------------------------------------ |
| 404    | Call not found, or recording not available (consent not given, call in progress, or recording expired) |
| 401    | Missing or invalid authentication                                                                      |

## Sandbox Mode

Sandbox calls (`pk_test_` keys) do not produce recordings. The `recording_url` field is always `null` in sandbox `call.completed` events, and `GET /v1/calls/{call_id}/recording` returns `404` for sandbox calls.