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

# Download recordings

> Get a short-lived link to a meeting's recording, and export every recording of your company.

`GET /calls/{callId}/recording` returns a link to download the meeting's whole recording. The API doesn't send the file itself: you download it from the link.

## Before you start

Recordings are the most sensitive data Triple Session holds, so a key can't download them by default. When you create the key, tick **Download meeting recordings** (`recordings.read`). To also list meetings, as the export below does, tick **Meetings** (`calls.read`).

## Get a download link

```bash theme={null}
curl "https://app.triplesession.com/api/public/v2/calls/CALL_ID/recording" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```json theme={null}
{
  "data": {
    "url": "https://…/source/…?X-Amz-Expires=900&X-Amz-Signature=…",
    "expires_at": "2026-11-30T12:15:00.000Z",
    "content_type": "video/mp4"
  }
}
```

| Field | Meaning |
| - | - |
| `url` | The signed link to the file. Download it with a plain `GET`, without your `Authorization` header. |
| `expires_at` | When the link stops working, 15 minutes after it was issued. |
| `content_type` | The file's type: `video/mp4` for video meetings, `audio/mpeg` or `audio/mp4` for audio-only ones. |

> [!NOTE]
>
> The link is checked only when a download starts. A download that starts before `expires_at` finishes even if it takes longer. If the link expired before you used it, request a new one.

Each request returns a new link, so don't cache the response or store the link. Every link issued is recorded in your company's API audit trail with the meeting and its expiry.

## When there is no link

| Status | Why |
| - | - |
| `400` | The key is limited to selected workspaces and the request has no `workspace_id`. |
| `403` | The key doesn't have **Download meeting recordings** (`recordings.read`). |
| `404` | The meeting doesn't exist, is private, belongs to a workspace outside the key's access, or has no stored recording. A recording still being processed answers `404` until it is ready, and one that failed to process answers `404` too. The message says which. |
| `429` | You reached the recording download limit below. Wait for `Retry-After` seconds. |

## Limits

Recording downloads have their own limit, on top of the [normal rate limits](https://docs.triplesession.com/api-v2/conventions.md#rate-limits):

| Applies to | Per minute | Per hour |
| - | - | - |
| Each API key | 10 | 300 |
| All keys of your company together | 20 | 600 |

At 600 an hour, your company can export about 14,000 recordings a day. The limit counts link requests, not downloads: downloading from a link you already have doesn't count. If you need higher limits, email **[support@triplesession.com](mailto:support@triplesession.com)**.

## Export all recordings

This script pages through your meetings with [`updated_since`](https://docs.triplesession.com/api-v2/sync-calls), requests a link for each one and saves the file. It waits 6 seconds between links to stay under 10 a minute, and waits for `Retry-After` when a limit is reached anyway. Store the returned cursor and pass it on your next run to download only new meetings.

```javascript theme={null}
import { createWriteStream } from "node:fs";
import { Readable } from "node:stream";
import { pipeline } from "node:stream/promises";

const BASE_URL = "https://app.triplesession.com/api/public/v2";
const headers = { Authorization: `Bearer ${process.env.TRIPLE_SESSION_API_KEY}` };
const EXTENSIONS = { "video/mp4": "mp4", "audio/mpeg": "mp3", "audio/mp4": "m4a" };
const sleep = (seconds) => new Promise((resolve) => setTimeout(resolve, seconds * 1000));

async function get(path) {
  while (true) {
    const response = await fetch(`${BASE_URL}${path}`, { headers });

    if (response.status === 429) {
      await sleep(Number(response.headers.get("Retry-After") ?? 60));
      continue;
    }

    return response;
  }
}

async function downloadRecording(callId) {
  const response = await get(`/calls/${callId}/recording`);

  if (response.status === 404) return; // private, no recording, not ready yet, or failed
  if (!response.ok) throw new Error((await response.json()).error.message);

  const { data } = await response.json();
  const file = await fetch(data.url); // no Authorization header
  if (!file.ok) throw new Error(`Download failed for ${callId}: ${file.status}`);

  const extension = EXTENSIONS[data.content_type] ?? "bin";
  await pipeline(Readable.fromWeb(file.body), createWriteStream(`${callId}.${extension}`));
}

export async function exportRecordings({ updatedSince = "2020-01-01", afterId } = {}) {
  while (true) {
    const params = new URLSearchParams({ updated_since: updatedSince, limit: "100" });
    if (afterId) params.set("after_id", afterId);

    const response = await get(`/calls?${params}`);
    if (!response.ok) throw new Error((await response.json()).error.message);

    const { data } = await response.json();

    for (const call of data) {
      if (!call.is_replaced) {
        await downloadRecording(call.id);
        await sleep(6); // 10 links a minute per key
      }
    }

    if (data.length > 0) {
      updatedSince = data[data.length - 1].updated_at;
      afterId = data[data.length - 1].id;
    }
    if (data.length < 100) return { updatedSince, afterId };
  }
}
```

A meeting whose recording is still being processed is skipped. Keep its `id` and request its link again later.

> [!TIP]
>
> A key limited to selected workspaces must send `workspace_id` on both `GET /calls` and `GET /calls/{callId}/recording`. Run one export per workspace, each with its own cursor.


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