# Recordings

List meeting recordings, download them with a checksum, and delete Insurge's copy once you have your own.

When a meeting is recorded, Insurge keeps an MP4 of the screen the visitor saw, with the agent's voice and the visitor's microphone. These endpoints let you copy each recording into your own storage and then delete Insurge's copy. Insurge deletes its copy anyway at the end of its retention period, at the time in `expires_at`, so copy recordings before then.

| Endpoint | Scope |
|---|---|
| `GET /api/v1/recordings` | `recordings:read` |
| `GET /api/v1/meetings/{meeting_id}/recording` | `recordings:read` |
| `GET /api/v1/meetings/{meeting_id}/recording.mp4` | `recordings:read` |
| `DELETE /api/v1/meetings/{meeting_id}/recording` | `recordings:delete` |

Neither scope is on for a new key. Switch on **Download recordings** and, to delete, **Delete recordings** when you [create the key](/docs/integrations/api-keys).

## The recording object

Recordings are described the same way here, in [Get a meeting](/docs/developers/api/meetings#get-a-meeting) and in the [recording webhooks](/docs/developers/webhooks#recordingready-and-recordingdeleted).

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | No | none (never recorded), processing (being put together), completed (ready to download), failed, expired (removed at the end of retention) or deleted. |
| `content_type` | `string \| null` | No | video/mp4 when completed, otherwise null. |
| `size_bytes` | `number \| null` | No | The file size. Kept after a delete as a record of what was deleted. |
| `sha256` | `string \| null` | No | The SHA-256 of the file, in hex. Older recordings may have none. Kept after a delete. |
| `completed_at` | `number \| null` | No | When the recording became ready, in Unix seconds. |
| `expires_at` | `number \| null` | No | When Insurge deletes its copy anyway. Only set while the recording is completed. |
| `deleted_at` | `number \| null` | No | When it was deleted or expired. |
| `deleted_by` | `object \| null` | No | Who deleted it: kind and id. See the table below. |
| `download_path` | `string \| null` | No | Where to download it, relative to https://api.insurgeai.com. Only set while completed. |

| `deleted_by.kind` | Meaning | `deleted_by.id` |
|---|---|---|
| `api_key` | Deleted through this API | The id of the key that deleted it |
| `user` | A workspace admin deleted it on the meeting's page in the dashboard | That person's user id |
| `insurge` | Insurge deleted it | `null` |
| `retention` | It reached the end of retention (`status` is `expired`) | `null` |

## Copy recordings to your storage

### Find out a recording is ready

Subscribe to the `recording.ready` webhook, or page through [List recordings](#list-recordings) for recordings made before you subscribed.

### Download it and check it

Download the MP4 and compute its SHA-256 as you write it. Compare it with the `X-Content-SHA256` header (also `recording.sha256`).

### Store your copy

Upload it to your own storage and check the upload succeeded.

### Delete Insurge's copy

Call `DELETE` with `?sha256=` set to the digest of your copy. Nothing is deleted unless it matches. A `recording.deleted` webhook confirms it.

Only the video is deleted. The meeting, its transcript and its brief stay in Insurge, so the dashboard and analytics keep working.

**Python**

```python title="Copy, check, then delete"
import hashlib
import os

import requests

API = "https://api.insurgeai.com"
H = {"Authorization": f"Bearer {os.environ['INSURGE_API_KEY']}"}  # recordings:read + recordings:delete


def copy_then_delete(meeting_id: str) -> None:
    path, digest = f"{meeting_id}.mp4", hashlib.sha256()
    url = f"{API}/api/v1/meetings/{meeting_id}/recording.mp4"
    with requests.get(url, headers=H, stream=True, timeout=60) as r:
        r.raise_for_status()
        expected = r.headers.get("X-Content-SHA256")
        with open(path, "wb") as f:
            for chunk in r.iter_content(1 << 20):
                f.write(chunk)
                digest.update(chunk)
    actual = digest.hexdigest()
    if expected and actual != expected:
        raise RuntimeError("download corrupted; not deleting")
    upload_to_your_storage(path)  # your code: S3, GCS, Azure, a NAS...
    # Older recordings have no stored digest: then delete without the check.
    params = {"sha256": actual} if expected else {}
    r = requests.delete(
        f"{API}/api/v1/meetings/{meeting_id}/recording",
        headers=H, params=params, timeout=30,
    )
    r.raise_for_status()


# Back-fill what was recorded before you subscribed to recording.ready.
cursor = None
while True:
    params = {"limit": 100, **({"cursor": cursor} if cursor else {})}
    r = requests.get(f"{API}/api/v1/recordings", headers=H, params=params, timeout=30)
    r.raise_for_status()
    page = r.json()
    for item in page["recordings"]:
        copy_then_delete(item["meeting_id"])
    cursor = page["next_cursor"]
    if not cursor:
        break
```

**Node.js**

```js title="Copy, check, then delete"
import crypto from "node:crypto";
import fs from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const API = "https://api.insurgeai.com";
const headers = { Authorization: `Bearer ${process.env.INSURGE_API_KEY}` };

async function copyThenDelete(meetingId) {
  const res = await fetch(`${API}/api/v1/meetings/${meetingId}/recording.mp4`, { headers });
  if (!res.ok) throw new Error(`download failed: ${res.status}`);
  const expected = res.headers.get("x-content-sha256");
  const hash = crypto.createHash("sha256");
  const path = `${meetingId}.mp4`;
  await pipeline(
    Readable.fromWeb(res.body),
    async function* (source) {
      for await (const chunk of source) {
        hash.update(chunk);
        yield chunk;
      }
    },
    fs.createWriteStream(path),
  );
  const actual = hash.digest("hex");
  if (expected && actual !== expected) throw new Error("download corrupted; not deleting");
  await uploadToYourStorage(path); // your code: S3, GCS, Azure, a NAS...
  // Older recordings have no stored digest: then delete without the check.
  const query = expected ? `?sha256=${actual}` : "";
  const del = await fetch(`${API}/api/v1/meetings/${meetingId}/recording${query}`, {
    method: "DELETE",
    headers,
  });
  if (!del.ok) throw new Error(`delete failed: ${del.status} ${await del.text()}`);
}

// Back-fill what was recorded before you subscribed to recording.ready.
let cursor = null;
do {
  const qs = new URLSearchParams({ limit: "100", ...(cursor ? { cursor } : {}) });
  const res = await fetch(`${API}/api/v1/recordings?${qs}`, { headers });
  if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
  const page = await res.json();
  for (const item of page.recordings) await copyThenDelete(item.meeting_id);
  cursor = page.next_cursor;
} while (cursor);
```

Run `copy_then_delete` from your `recording.ready` handler after you have answered the webhook, not inside it. Copy one recording at a time: a workspace can have at most 4 downloads open at once, and each key can make 60 requests a minute.

## List recordings

`GET /api/v1/recordings` returns recorded meetings, oldest first.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | No | Which recordings: processing, completed, failed, expired or deleted, several separated by commas, or all. Default: `completed`. |
| `since` | `number` | No | Only meetings that started at or after this time, in Unix seconds. |
| `until` | `number` | No | Only meetings that started before this time, in Unix seconds. |
| `cursor` | `string` | No | The next_cursor of the previous page. |
| `limit` | `number` | No | Recordings per page, 1 to 500. Default: `100`. |

**cURL**

```bash title="List completed recordings"
curl 'https://api.insurgeai.com/api/v1/recordings?limit=100' \
  -H "Authorization: Bearer $INSURGE_API_KEY"
```

**Node.js**

```js title="List completed recordings"
const res = await fetch("https://api.insurgeai.com/api/v1/recordings?limit=100", {
  headers: { Authorization: `Bearer ${process.env.INSURGE_API_KEY}` },
});
const { recordings, next_cursor } = await res.json();
```

**Python**

```python title="List completed recordings"
r = requests.get(
    "https://api.insurgeai.com/api/v1/recordings",
    params={"limit": 100},
    headers={"Authorization": f"Bearer {os.environ['INSURGE_API_KEY']}"},
    timeout=30,
)
page = r.json()
```

```json title="200 OK"
{
  "recordings": [
    {
      "meeting_id": "9b2e7c4d1a3f4b6e8d0c2a4e6f8b1d3c",
      "lead_id": "3f6c1a9e2b7d4e5f8a9b0c1d2e3f4a5b",
      "agent_id": "product-tour",
      "channel": "web",
      "started_at": 1796119200.4,
      "ended_at": 1796119612.4,
      "duration_s": 412.0,
      "recording": {
        "status": "completed",
        "content_type": "video/mp4",
        "size_bytes": 48211934,
        "sha256": "9f2c4be1d07a5e3c8b6f1a2d4e7c9b0a3f5e8d1c6b4a2e9f7d0c3b5a8e1f4d26",
        "completed_at": 1796119671.7,
        "expires_at": 1796724000.4,
        "deleted_at": null,
        "deleted_by": null,
        "download_path": "/api/v1/meetings/9b2e7c4d1a3f4b6e8d0c2a4e6f8b1d3c/recording.mp4"
      }
    }
  ],
  "count": 1,
  "next_cursor": null
}
```

Each item has the meeting's `meeting_id`, `lead_id`, `agent_id`, `started_at`, `ended_at` and `duration_s`, its `channel` (`web` for your Insurge pages, otherwise the meeting platform), and the `recording` object.

To get the next page, pass `next_cursor` back as `cursor`. It is `null` when there are no more. Unlike an offset, a cursor stays correct while you delete the recordings you have already copied.

| Status | When |
|---|---|
| `400` | `cursor is not one this API returned.` |
| `403` | The key doesn't have `recordings:read`. |
| `422` | `status` names something other than the values above. |

## Get a recording's details

`GET /api/v1/meetings/{meeting_id}/recording` returns the recording object of one meeting. A meeting that was never recorded answers `200` with `status: "none"`.

**cURL**

```bash title="Get a recording's details"
curl 'https://api.insurgeai.com/api/v1/meetings/your_meeting_id/recording' \
  -H "Authorization: Bearer $INSURGE_API_KEY"
```

**Node.js**

```js title="Get a recording's details"
const res = await fetch(
  `https://api.insurgeai.com/api/v1/meetings/${meetingId}/recording`,
  { headers: { Authorization: `Bearer ${process.env.INSURGE_API_KEY}` } },
);
const { recording } = await res.json();
```

**Python**

```python title="Get a recording's details"
r = requests.get(
    f"https://api.insurgeai.com/api/v1/meetings/{meeting_id}/recording",
    headers={"Authorization": f"Bearer {os.environ['INSURGE_API_KEY']}"},
    timeout=30,
)
recording = r.json()["recording"]
```

```json title="200 OK"
{
  "meeting_id": "9b2e7c4d1a3f4b6e8d0c2a4e6f8b1d3c",
  "recording": {
    "status": "completed",
    "content_type": "video/mp4",
    "size_bytes": 48211934,
    "sha256": "9f2c4be1d07a5e3c8b6f1a2d4e7c9b0a3f5e8d1c6b4a2e9f7d0c3b5a8e1f4d26",
    "completed_at": 1796119671.7,
    "expires_at": 1796724000.4,
    "deleted_at": null,
    "deleted_by": null,
    "download_path": "/api/v1/meetings/9b2e7c4d1a3f4b6e8d0c2a4e6f8b1d3c/recording.mp4"
  }
}
```

`404 Meeting not found: <id>` when there is no such meeting in your workspace.

## Download a recording

`GET /api/v1/meetings/{meeting_id}/recording.mp4` returns the whole file (`200`), or exactly the byte range you ask for with a `Range` header (`206`), so a broken download can carry on where it stopped.

**cURL**

```bash title="Download a recording"
curl 'https://api.insurgeai.com/api/v1/meetings/your_meeting_id/recording.mp4' \
  -H "Authorization: Bearer $INSURGE_API_KEY" \
  -o recording.mp4
```

To carry on a broken download, run the same command with `-C -` added.

**Node.js**

See `copyThenDelete` in [Copy recordings to your storage](#copy-recordings-to-your-storage). It streams the file to disk and checks its digest.

**Python**

See `copy_then_delete` in [Copy recordings to your storage](#copy-recordings-to-your-storage). It streams the file to disk and checks its digest.

```http title="Response headers"
HTTP/1.1 200 OK
content-type: video/mp4
content-length: 48211934
content-disposition: attachment; filename="meeting-2026-12-01-9b2e7c4d.mp4"
accept-ranges: bytes
cache-control: private, no-store
etag: "9f2c4be1d07a5e3c8b6f1a2d4e7c9b0a3f5e8d1c6b4a2e9f7d0c3b5a8e1f4d26"
x-content-sha256: 9f2c4be1d07a5e3c8b6f1a2d4e7c9b0a3f5e8d1c6b4a2e9f7d0c3b5a8e1f4d26
```

- `X-Content-SHA256` and `ETag` carry the file's SHA-256. They are absent for older recordings that have no stored digest.
- A `206` answer also has `Content-Range: bytes <start>-<end>/<size>`.
- A client that takes more than 2 minutes to accept one 4 MB chunk is cut off. Carry on with a `Range` request.
- At most 4 downloads can be open at once per workspace. A fifth answers `429` with `Retry-After: 30`.

| Status | When |
|---|---|
| `404` | `Recording not ready`: the recording isn't `completed` (still processing, failed, deleted or expired). `Recording file not found`: the file is missing. `Meeting not found: <id>`. |
| `416` | The `Range` can't be satisfied, for example it starts past the end of the file. The answer has no body and `Content-Range: bytes */<size>`. |
| `429` | 4 downloads are already open for your workspace. Wait for `Retry-After`. |
| `503` | `Recording temporarily unavailable`. Try again shortly. |

## Delete Insurge's copy

`DELETE /api/v1/meetings/{meeting_id}/recording` deletes Insurge's stored copy of the recording. It needs the `recordings:delete` scope.

**This can't be undone**

The video is removed from Insurge for good. The meeting, its transcript and its brief stay. Always pass `sha256` so nothing is deleted unless Insurge's copy matches the one you kept.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `meeting_id` | `string` | Yes | The meeting's id, in the path. |
| `sha256` | `string` | No | Query parameter: the SHA-256 of your copy, 64 hex characters. Nothing is deleted unless it matches the stored digest. |

**cURL**

```bash title="Delete Insurge's copy, only if it matches yours"
curl -X DELETE 'https://api.insurgeai.com/api/v1/meetings/your_meeting_id/recording?sha256=9f2c4be1d07a5e3c8b6f1a2d4e7c9b0a3f5e8d1c6b4a2e9f7d0c3b5a8e1f4d26' \
  -H "Authorization: Bearer $INSURGE_API_KEY"
```

**Node.js**

```js title="Delete Insurge's copy, only if it matches yours"
const res = await fetch(
  `https://api.insurgeai.com/api/v1/meetings/${meetingId}/recording?sha256=${sha256OfYourCopy}`,
  { method: "DELETE", headers: { Authorization: `Bearer ${process.env.INSURGE_API_KEY}` } },
);
if (res.status === 412) throw new Error("Insurge's copy doesn't match yours; nothing deleted");
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
```

**Python**

```python title="Delete Insurge's copy, only if it matches yours"
r = requests.delete(
    f"https://api.insurgeai.com/api/v1/meetings/{meeting_id}/recording",
    params={"sha256": sha256_of_your_copy},
    headers={"Authorization": f"Bearer {os.environ['INSURGE_API_KEY']}"},
    timeout=30,
)
if r.status_code == 412:
    raise RuntimeError("Insurge's copy doesn't match yours; nothing deleted")
r.raise_for_status()
```

```json title="200 OK"
{
  "meeting_id": "9b2e7c4d1a3f4b6e8d0c2a4e6f8b1d3c",
  "recording": {
    "status": "deleted",
    "content_type": null,
    "size_bytes": 48211934,
    "sha256": "9f2c4be1d07a5e3c8b6f1a2d4e7c9b0a3f5e8d1c6b4a2e9f7d0c3b5a8e1f4d26",
    "completed_at": 1796119671.7,
    "expires_at": null,
    "deleted_at": 1796128200.9,
    "deleted_by": {
      "kind": "api_key",
      "id": "7a1c3e5b9d2f4a6c8e0b1d3f5a7c9e2b"
    },
    "download_path": null
  }
}
```

- The answer is the recording object after the delete, with `status: "deleted"` and `deleted_by` naming your key.
- Calling it again, or on a recording that already expired, answers `200` with the same object and does nothing. It is safe to retry.

| Status | When | What to do |
|---|---|---|
| `400` | `sha256 must be 64 hexadecimal characters.` | Send the hex digest, not base64. |
| `404` | `Meeting not found: <id>`, or `This meeting has no stored recording.` (never recorded, or the recording failed). | Nothing to delete. |
| `409` | `The recording is still being processed.` | Wait for `recording.ready`, then try again. |
| `409` | `The recording changed while it was being deleted.` | Fetch the recording's details and decide again. |
| `412` | `sha256 does not match the stored recording; nothing was deleted.` Also for an older recording with no stored digest. | Download again and compare. For a recording with no digest, check your copy yourself and delete without `sha256`. |
| `503` | `The recording could not be deleted. Try again.` Nothing changed. | Try again. |

A workspace admin can also delete a recording on the meeting's page in the dashboard: **Delete** beside the recording, then **Delete recording** to confirm.
