# Update a voice recording

> PATCH /v1/twilio/voice/accounts/{accountId}/recordings/{recordingSid} · Voice API

Source: https://developer.kustomer.com/api/voice/update-a-voice-recording

```http
PATCH https://{orgname}.api.kustomerapp.com/v1/twilio/voice/accounts/{accountId}/recordings/{recordingSid}
Authorization: Bearer <API key>
```

## Authorization

Requires any one of these roles: `org.permission.apps.read`, `org.permission.apps.update`; or legacy `org.user.apps.read`, `org.user.apps.write`, `org.admin.apps.write`. The API key or user must hold at least one of them. Legacy roles predate permission sets and still work.

Pauses or resumes an in-progress voice call recording.

Send `{ "status": "paused" }` to pause, or `{ "status": "inProgress" }` to resume. No other body fields are accepted. While the recording is paused, that audio is omitted from the final recording (it is not replaced with silence).

On success the response is `{ "status": "paused" }` or `{ "status": "in-progress" }` (note the hyphen in the resumed value). The call message's `attributes.meta.recordingStatus` is updated to match, and other agents on the call are notified.

`accountId` is the Kustomer voice account ID for the call (the call message's `attributes.meta.twilioKustomerAccountId`), not the telephony provider account SID. `recordingSid` is the call message's `attributes.meta.recordingSid`.

If agents are not allowed to pause recording for the phone number on the call, a pause request still returns `200` with the recording's current status and does not change it. That status is usually `in-progress`, and can be `completed` if the recording has already finished. Check the response `status` before you rely on a pause; HTTP `200` alone does not confirm it. Resume (`inProgress`) is not blocked by that setting.

## About Voice recordings

A Voice recording captures the audio of a live Kustomer Voice call. Pause or resume it during the call, or download the finished audio when the call ends.

Voice recordings are created when your org records inbound or outbound Voice calls. While a call is live, you can pause and resume the recording so card numbers or other sensitive audio never land in the stored file. After the call, you can stream or download the completed audio.

#### Path parameters from the call message

Both endpoints take `accountId` and `recordingSid`. Read them from the Voice call's [message](https://developer.kustomer.com/api/core-resources#messages):

| Path parameter | Message field |
| --- | --- |
| `recordingSid` | `attributes.meta.recordingSid` |
| `accountId` | `attributes.meta.twilioKustomerAccountId` |

`accountId` is the Kustomer voice account ID for that call, not the telephony provider account SID (`attributes.meta.accountSid`).

#### Pause and resume

[`PATCH /v1/twilio/voice/accounts/{accountId}/recordings/{recordingSid}`](https://developer.kustomer.com/api/voice/update-a-voice-recording) takes only `status`:

| Request `status` | Effect |
| --- | --- |
| `paused` | Stop capturing audio until you resume |
| `inProgress` | Resume capturing audio |

Paused time is **omitted** from the final recording; it is not replaced with silence. A successful response is `{ "status": "paused" }` or `{ "status": "in-progress" }` (hyphenated when recording). The call message's `attributes.meta.recordingStatus` is updated to match, and other agents on the call are notified.

If agents are not allowed to pause recording for the phone number on the call, a pause request still returns `200` with the recording's current status and does not change it. That status is usually `in-progress`, and can be `completed` if the recording has already finished. Before you rely on a pause to keep sensitive audio out of the recording, check that the response `status` is `paused`. An HTTP `200` alone does not confirm the pause. Resume is not blocked by that setting.

#### Download recording media

[`GET /v1/twilio/voice/accounts/{accountId}/recordings/{recordingSid}`](https://developer.kustomer.com/api/voice/get-voice-recording-media) streams the audio as `audio/mpeg`. Add `download=true` when you want a file download instead of inline playback.

#### Which endpoint to use

| To | Call |
| --- | --- |
| Pause a live recording | [`PATCH …/recordings/{recordingSid}`](https://developer.kustomer.com/api/voice/update-a-voice-recording) with `{ "status": "paused" }` |
| Resume a paused recording | [`PATCH …/recordings/{recordingSid}`](https://developer.kustomer.com/api/voice/update-a-voice-recording) with `{ "status": "inProgress" }` |
| Play or download recording audio | [`GET …/recordings/{recordingSid}`](https://developer.kustomer.com/api/voice/get-voice-recording-media) |

Related: [Conversations and messages](https://developer.kustomer.com/docs/concepts/conversations-and-messages), [Messages](https://developer.kustomer.com/api/core-resources#messages)

### Permissions

Fewest roles for a read-only integration: `org.permission.apps.read`. For every endpoint: `org.permission.apps.read`.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | string | yes | Kustomer voice account ID. Use the call message's `attributes.meta.twilioKustomerAccountId`. |
| `recordingSid` | string | yes | Recording SID for the call. Use the call message's `attributes.meta.recordingSid`. |

## Request body

Content type: `application/json` (required)

- `status` (string, required): `paused` to pause recording, or `inProgress` to resume. One of: `paused`, `inProgress`.

Example:

```json
{
  "status": "paused"
}
```

## Responses

### 200

Recording status after the update.

- `status` (string, required): Recording status after the update. `paused` when paused, `in-progress` when recording, or `completed` when the recording has finished (including when a pause request is blocked and the current status is returned unchanged). One of: `paused`, `in-progress`, `completed`.

```json
{
  "status": "paused"
}
```

### 400

Bad Request - Invalid request parameters or body

### 401

Unauthorized - Missing or invalid authentication, or missing a required role

### 404

Not Found - Account or recording does not exist

## Example request

```bash
curl --request PATCH \
  --url 'https://api.kustomerapp.com/v1/twilio/voice/accounts/507f1f77bcf86cd799439011/recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' \
  --header "Authorization: Bearer $KUSTOMER_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "status": "paused"
}'
```
