> ## 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.

# Sync meetings

> Export meetings from a date range, then keep your copy up to date by fetching only what changed.

`GET /calls` supports two ways to copy meetings into another system: a one-off export of a date range, and an incremental sync that returns only meetings created or changed since your last run. Both need a key with the **Meetings** (`calls.read`) scope.

## Export a date range

Use `date_from` and `date_to` with the meeting's creation time. `date_to` is exclusive, so this returns November 2026:

```bash theme={null}
curl "https://app.triplesession.com/api/public/v2/calls?date_from=2026-11-01&date_to=2026-12-01&limit=100" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Both accept a date (`2026-11-01`, the start of that day in UTC) or a date-time with a timezone (`2026-11-01T09:00:00Z`). Meetings come newest first. Request the next `page` until you reach `total_pages`.

## Keep a copy up to date

Meetings can change after they are created, or be replaced by a re-scored copy. To pick up those changes without exporting everything again, sync with `updated_since` and `after_id`.

**1. Start the sync**

Send `updated_since` with a time before your oldest meeting, or with the time of your last export. Meetings come oldest change first.

**2. Ask for the next batch**

Take the `updated_at` and `id` of the last meeting in the response. Send them as `updated_since` and `after_id`. Send `updated_at` exactly as you received it.

**3. Stop when the batch is short**

When a response returns fewer meetings than `limit`, you are up to date. Store the last `updated_at` and `id`, and start from them on your next run.

`after_id` is needed because many meetings can share one `updated_at`: the time alone can't move the sync forward.

```javascript theme={null}
const BASE_URL = "https://app.triplesession.com/api/public/v2";

async function syncCalls(cursor) {
  let { updatedSince, afterId } = cursor;

  while (true) {
    const params = new URLSearchParams({ updated_since: updatedSince, limit: "100" });
    if (afterId) params.set("after_id", afterId);

    const response = await fetch(`${BASE_URL}/calls?${params}`, {
      headers: { Authorization: `Bearer ${process.env.TRIPLE_SESSION_API_KEY}` },
    });

    if (response.status === 429) {
      const seconds = Number(response.headers.get("Retry-After") ?? 60);
      await new Promise((resolve) => setTimeout(resolve, seconds * 1000));
      continue;
    }
    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 deleteCall(call.id);
      else await upsertCall(call);
    }

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

`upsertCall` and `deleteCall` stand for your own storage code.

## Handle changed and replaced meetings

* **Match meetings by `id`.** A meeting can come back with nothing visibly changed. Overwrite your copy.
* **Remove replaced meetings.** Changing a meeting's scorecard creates a new meeting with a new `id`. The old one arrives with `is_replaced: true`. Delete it from your copy. The new one arrives as its own meeting, with `replaces_call_id` set to the old `id`.

Replaced meetings appear only in a sync with `updated_since`. Every other request returns current meetings only.

## Workspace-scoped keys

A key limited to selected workspaces must send `workspace_id` on every `GET /calls` request. Run one sync per workspace and store a separate `updated_at` and `id` for each.


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