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

# Export Calls

> The call log as a file, filtered exactly as `GET /calls` is filtered. Required
scope `calls:read`, or `calls:metrics`, whose file leaves From, To, Lead name, Summary
and Carrier call ID empty, carries no Extracted columns, and refuses the `caller`,
`callee`, `search` and `lead_id` filters. `Lead name` is filled only for a key that also holds
`leads:read`; without it the column is empty on every row, as `GET /calls` reads
such a key's lead as `{id}`, and a `lead_id` filter does not bring the name back.

It carries the same fields as the dashboard's Export CSV, in the same order, so the
two line up column for column. Every line under the headings is one call: the total
is the `X-Total-Cost-USD` header, not a line among the rows. They are not
byte for byte alike: this file has fixed English headings and the API's own values;
the dashboard's is written in the reader's language, heads its start
`Started (ISO 8601)` (with the workspace's offset) and adds `Started (<zone>)`
second, heads its duration `Duration (seconds)`, writes the screen's words for
direction, status, source and no agent, and `Yes`/`No` for `true`/`false`.

Answers `text/csv; charset=utf-8` with a UTF-8 byte-order mark, which is what makes
a spreadsheet read Hebrew agent and disposition names as Hebrew. Rows stream as they
are read, so a large window starts arriving immediately.

**One moment.** The file holds the calls that existed when the request arrived; a
call that starts while it streams belongs to the next export, never half to this
one. `X-Total-Rows` is therefore exactly the number of call rows in the file.

**Columns.** `Started` (ISO 8601 with its offset, always `+00:00` — the file is not
localised, so it carries no workspace timezone), `Agent` (the agent's name, empty
when the call has none), `A/B` (`A`, `B`, or empty), `Direction` and `Status` (the
API's own values, e.g. `web_call`, `no_answer`), `Disposition` (the outcome's
label), `From`, `To`, `Duration` (whole seconds), `Cost (USD)` (dollars and cents;
`0.00` on a call that ended without a charge, empty only while the charge is pending),
`Source`, `Shared link ID`,
`Call ID` (the key to `GET /calls/{id}` — join on this), `Lead name` (empty when the
call has no lead or it was deleted, and for a key without `leads:read`), `Summary`, `Cost status` (`charged`,
`not_charged` or `pending`, exactly as `cost_status` on `GET /calls`), `Ended by`
(`caller`, `agent`, `system`, `operator`, `unknown`, or empty when nothing recorded
it, exactly as `ended_by` on `GET /calls`), `Agent ID` (the agent's id beside its
name, so two agents with one name stay two in a pivot), `Provider` (`external`,
`telnyx`, or empty on a browser call, exactly as `provider` on `GET /calls`), `Carrier
account` (the carrier account's name on an `external` call, for a key with
`carrier_accounts:read`; empty otherwise), `Carrier call ID` (on an `external` call, the
id Telnyx gave it on your account, as `carrier_call_id`), then one `Extracted: <field>` column
per field any call in the file collected, named for its key in `extracted_data`
(a string as written, a number or `true`/`false` as the API returns it, anything
nested as JSON, empty when the call did not collect it). In `Lead name`, `Summary`
and the `Extracted:` columns a value opening with `=`, `+`, `-`, `@` or a tab is
written with a leading apostrophe so a spreadsheet does not run it as a formula; a
phone number or a plain number is written as it is. The first twenty-one columns
never move; the `Extracted:` set depends on the window, so read those by heading.
There is no `Total` line: what the rows cost together is the `X-Total-Cost-USD`
header.

**Row limit.** At most 10000 calls per export. A window holding more is refused
with `400 CALLS_EXPORT_TOO_LARGE` naming the count — never truncated, because a
file cut short carries totals that are wrong and says nothing about it. Page a
larger export by splitting the window with `from` and `to`: a call's start time
never changes, so consecutive windows skip nothing. `to` is inclusive, so a call
that started at exactly a boundary is in both neighbouring files — de-duplicate on
`Started` before adding their `X-Total-Cost-USD` values up.

`limit`, `offset`, `cursor` and `updated_since` are refused here with
`400 CALLS_QUERY_INVALID`. An export is one whole window of call starts, not a page
of it and not what changed since it last ran: to read pages, or the calls that have
changed, use `GET /calls`.


The call log as a file, filtered exactly the way [List Calls](https://docs.goyappr.com/api-reference/calls/list.md) is
filtered. It carries the same fields as the dashboard's **Export CSV**, in the same order,
so a report built here and a file downloaded from the screen line up column for column. Every
line under the headings is one call — there is no `Total` line among them, so a column sum
or a pivot over the file is right as it stands. They are not byte for byte alike: this file is written for a
program — fixed English headings, the API's own values — and the dashboard's for a person, in
the reader's language. Every difference is listed under
[The dashboard's file](#the-dashboards-file); read the dashboard's file by position, or map its
headings, rather than matching them by name against this one.

Required scope: `calls:read`. The file names a call's lead only for a key that also holds
`leads:read`: without it `Lead name` is empty on every row, as `GET /calls` reads such a key's
lead as `{id}` — filtering by `lead_id` does not bring the name back.

**Personal data.** `Lead name` is not the only column that names people. `Summary` is what
the caller said, retold, and often carries their name; the `Extracted:` columns hold what the
call collected (a name, an email, an address); `From` and `To` are phone numbers. Holding
`calls:read` without `leads:read` empties `Lead name` only, not these. Treat the file as
personal data, as you would the calls themselves.

It exists so that handing a client a month of calls stops being a join. Before it, every
report meant paging `GET /calls`, calling
[`GET /billing/consumption`](https://docs.goyappr.com/api-reference/billing/consumption) for the money and
[`GET /dispositions`](https://docs.goyappr.com/api-reference/dispositions/list) for the labels, then joining the three
locally — once per client, every month.

```bash theme={null}
# September, one client's agent, as a file
curl -L "https://api.goyappr.com/calls/export?agent_id=$AGENT_ID&from=2026-09-01T00:00:00Z&to=2026-10-01T00:00:00Z" \
  -H "Authorization: Bearer $YAPPR_API_KEY" \
  -o september.csv

# Only the calls that booked something
curl -L "https://api.goyappr.com/calls/export?disposition=Booked&from=2026-09-01T00:00:00Z" \
  -H "Authorization: Bearer $YAPPR_API_KEY" -o booked.csv
```

## Columns

| Column | What it holds |
| - | - |
| `Started` | When the call started — the API's `started_at`, which is when its row was created unless the call recorded a start of its own — ISO 8601 with its offset — always `+00:00` here, because the file is not localised and carries no workspace timezone. Convert on your side if the report needs local time. |
| `Agent` | The agent's name. **Empty** when the call has no agent (the dashboard's file writes a word there). Match on empty, not on a word. |
| `A/B` | `A`, `B`, or empty on a number with no split. |
| `Direction` | `inbound`, `outbound`, `web_call` — the API's own values, not the screen's labels. |
| `Status` | `completed`, `failed`, `no_answer`, `transferred`, `dnc_blocked`, `ringing`, `in_progress`, or `pending_connection` on a browser session minted with `POST /calls` that no browser has connected to yet. |
| `Disposition` | The outcome's label, exactly as `GET /dispositions` returns it. Empty when the call has none. |
| `From` / `To` | The two numbers, E.164. Empty on a browser call. `To` is empty, too, on a call that arrived on a [SIP endpoint](https://docs.goyappr.com/api-reference/sip-endpoints/create.md) (what a call on a username-and-password trunk dialled shows in the dashboard's call log); its `From` is whatever your phone system sent as the caller, and empty when the caller ID was only a username-and-password trunk's own username. |
| `Duration` | Whole seconds, exactly as `duration_seconds` on `GET /calls` and `GET /calls/{id}` reads them. **Empty** on every call that was never answered — nobody picked up, the number was blocked, or no browser connected (a browser session nobody opened, a rehearsal whose steps failed first) — and on a call still under way; a number, `0` included, on every call that was answered, as `answered_at` on `GET /calls/{id}` says, whatever stage its failure names. |
| `Cost (USD)` | Dollars and cents as a bare decimal, so a spreadsheet can add it up. `0.00` on a call that ended without a charge — it failed, nobody answered, it was blocked, it never connected, or it ended more than a day ago with no charge recorded. **Empty** only while the charge is still pending. `Cost status` says which. |
| `Source` | `test`, `shared_link`, `api`, `phone_inbound`, `phone_outbound`, `unknown`. |
| `Shared link ID` | The link the call came through, on a `shared_link` call. Empty on every other kind. |
| `Call ID` | The call's `id` — the key to [Get Call](https://docs.goyappr.com/api-reference/calls/get.md), its recording and its deliveries. Join on this, never on `Started`. |
| `Lead name` | The name of the lead the call was with. Empty when the call is not tied to a lead, or the lead has since been deleted — exactly when `GET /calls` returns `lead: null` — and on every row for a key without `leads:read`, which reads a call's lead as `{id}`. |
| `Summary` | The call's written summary, as `summary` on [`GET /calls/{id}`](https://docs.goyappr.com/api-reference/calls/get) (list rows do not carry it). Empty until the call has been analysed. |
| `Cost status` | `charged`, `not_charged` or `pending` — exactly `cost_status` on [List Calls](https://docs.goyappr.com/api-reference/calls/list.md), so the file and the API give one answer about the same call. `not_charged` rows read `0.00`; `pending` rows are the only empty `Cost (USD)` cells, and none stays `pending` more than a day after its call ended. |
| `Ended by` | Who stopped the call — `caller`, `agent`, `system`, `operator` or `unknown`, exactly `ended_by` on [Get Call](https://docs.goyappr.com/api-reference/calls/get.md#who-ended-the-call-and-why). **Empty** when nothing recorded it: a call still running, or one no producer attributed. |
| `Agent ID` | The agent's `id`, beside its name in `Agent`. Two agents can share a name; pivot on this column, not on `Agent`, and they stay two. Empty when the call has no agent. |
| `Provider` | Whose carrier the phone side ran on, exactly `provider` on [Get Call](https://docs.goyappr.com/api-reference/calls/get.md#whose-carrier-it-ran-on): `external` (your own Telnyx account), `telnyx` (a number bought from Yappr, or a SIP endpoint). `none` on a browser call, which has no phone side (`provider` is null there). |
| `Carrier account` | On an `external` call, the name of the [carrier account](https://docs.goyappr.com/api-reference/carrier-accounts/get.md) it ran on. Empty on every other call, and for a key without `carrier_accounts:read`. |
| `Carrier call ID` | On an `external` call, the id Telnyx gave the call on your Telnyx account (`carrier_call_id`): search your Telnyx records by it to match the call to what Telnyx billed. Empty on every other call, and for a key without `carrier_accounts:read`. |
| `Extracted: <field>` | One column per field any call in the file collected, named for the key in `extracted_data`, in the order the calls first mention them. A string as written; a number or `true` / `false` as the API returns it; a nested value as JSON. Empty on a call that did not collect that field. The set of these columns depends on the calls in the window, so read them by heading, not by position. |

`Lead name`, `Summary` and the `Extracted:` columns hold text that callers, lead forms and
the extraction model wrote. A value there that opens with `=`, `+`, `-` or `@` (or a tab)
is written with a leading apostrophe — `'=HYPERLINK(…)` — so a spreadsheet shows it rather
than running it as a formula; strip one leading `'` from those columns if you read the file
as data. A phone number or a plain number (`+972 52-577-5376`, `-3`) is written as it is,
and `From` / `To` are never changed.

The first twenty-one columns always come in this order; columns are only ever added after them.
The file opens with a UTF-8 byte-order mark, which is what makes a spreadsheet read Hebrew
agent and disposition names as Hebrew.

## Totals and the file's name

What the calls in the file cost together is the **`X-Total-Cost-USD`** response header —
dollars and cents over the rows whose cost is recorded, the same sum a column total over
`Cost (USD)` gives — and **`X-Total-Rows`** is how many calls the file holds. Neither is a
line in the file. (The file used to end with a `Total` line inside the data, so a column sum
counted the month twice and a pivot showed a blank-agent group worth the whole month.)

`Content-Disposition` names the file for what it holds: the filters, then the window —
`calls-agent-9b29b0c9-no_answer-2026-09-01_2026-09-30.csv`, where the agent (and an outcome
filter) is the first eight characters of its id, because names are not unique. A file filtered
by `carrier_account_id` carries it the same way: `calls-carrier-7c1e4a2b-2026-09-20_2026-09-26.csv`, and one
filtered by `provider` says which: `calls-provider-external-2026-09-01_2026-09-30.csv`. A window sent with only
`from` runs to now and is named to today (`calls-2026-09-01_2026-10-01.csv`); one with only `to` is
`calls-until-2026-09-30.csv`. With no filters and no window it is `calls.csv`. All three headers are exposed to browser clients, so
`fetch()` reads them as well as `curl`.

An `agent_id` this workspace does not have is `404 AGENT_NOT_FOUND` (it was `CALL_AGENT_UNKNOWN`), exactly as on
[List Calls](https://docs.goyappr.com/api-reference/calls/list.md) — never a file of headings that reads as *this client
spent \$0*.

## The dashboard's file

**Export CSV** on Call Logs writes the same fields in the same order, with one column more.
What differs, heading by heading:

| | This file | The dashboard's file |
| - | - | - |
| Start | `Started`: ISO 8601 at `+00:00` | `Started (ISO 8601)`: ISO 8601 with the workspace's offset for that day, then one column more, `Started (<zone>)` — the same moment on the workspace's clock, written for reading, with the zone's name in the heading |
| Duration | `Duration` | `Duration (seconds)` — the same whole seconds |
| Headings | English, as listed above | In the reader's language — a Hebrew screen writes Hebrew headings |
| `Direction`, `Status`, `Source` | The API's values (`web_call`, `no_answer`, `phone_inbound`) | The screen's words for them, in the reader's language |
| `Disposition` | The label as `GET /dispositions` returns it | The label as the screen shows it, in the reader's language |
| No agent | Empty | `Unassigned agent`, in the reader's language |
| `Extracted:` true / false | `true` / `false` | `Yes` / `No`, in the reader's language |
| `Cost status` | `charged`, `not_charged`, `pending` | The screen's words for them, in the reader's language |
| `Ended by` | `caller`, `agent`, `system`, `operator`, `unknown` | The call details' words for them, in the reader's language; empty in both when nothing recorded it |
| `Provider` | `external`, `telnyx`, `none` | `Your carrier`, `Yappr` or `None (browser call)`, in the reader's language |
| `Status` of a browser session nobody joined | `pending_connection` | `Waiting to connect`, in the reader's language |
| File name | The filters by id (`calls-agent-9b29b0c9-…`), then the window | The agents by name and the other filters in the screen's words, then the days (`calls-Dental-intake-2026-09-01_2026-09-23.csv`) |

`Cost (USD)`, `From` / `To`, `Call ID`, `Lead name`, `Summary` and the `Extracted:` text and
numbers are written the same way in both, formula guard included.

## The row limit, and paging a larger export

One export carries at most **10000** calls. A window holding more is refused with
`400 CALLS_EXPORT_TOO_LARGE`, naming the count — it is never truncated, because a file cut
short carries totals that are wrong and nothing in it says so.

Page a larger export by splitting the window with `from` and `to`. A call's start time never
changes, so consecutive windows never skip one:

Give each window the *first day of the next month* as its `to`, rather than guessing a last
day — not every month has 31, and a date its month does not have (`2026-09-31`) is refused
with `400 CALLS_QUERY_INVALID`:

```bash theme={null}
for window in 2026-07-01:2026-08-01 2026-08-01:2026-09-01 2026-09-01:2026-10-01; do
  from=${window%%:*}; to=${window##*:}
  curl -L "https://api.goyappr.com/calls/export?from=${from}T00:00:00Z&to=${to}T00:00:00Z" \
    -H "Authorization: Bearer $YAPPR_API_KEY" -o "calls-$from.csv"
done
```

A date-only `to` covers that whole day (UTC) — `to=2026-08-31` ends at
`2026-08-31T23:59:59.999999Z` — so `from=2026-08-01&to=2026-08-31` then
`from=2026-09-01&to=2026-09-30` are two whole months that neither overlap nor leave a gap. A
date-only `to` used to stop at midnight at the start of its day and drop that day's calls.

`to` is inclusive, so windows written with times meet rather than abut: a call that started at exactly that
boundary midnight is written into **both** neighbouring files. Nothing is skipped, but the two
files overlap by that one instant — when you concatenate them, drop the rows whose `Started` is
exactly the boundary from one of the two, and expect the per-file `X-Total-Cost-USD` values to
count such a call twice if you simply add them up. (Ending a window a second earlier trades this for the
opposite risk: a call started in that second would be in neither file.)

`X-Total-Rows` on the response carries the number of calls in the file, so you can check what
you received without counting it.

The file is the calls that existed the moment you asked for it. A call that starts while it
is streaming belongs to your next export — it is never written into this one half-way, which
is what would make `X-Total-Cost-USD` and `X-Total-Rows` disagree with the rows in the file.

`limit`, `offset`, `cursor` and `updated_since` are **refused** here rather than ignored,
with `400 CALLS_QUERY_INVALID`: an export is one whole window of call starts, not a page of
it and not what changed since it last ran. A file answered for `updated_since` would carry
the whole `from`/`to` window while reading as *everything that changed* — the one shape this
endpoint exists to refuse. To read pages, or the calls that have changed, use
[List Calls](https://docs.goyappr.com/api-reference/calls/list.md).

## Refusals

Every filter is refused the way [List Calls](https://docs.goyappr.com/api-reference/calls/list.md) refuses it, so a query
that works there works here — except for its paging (`limit`, `offset`, `cursor`) and its
changed-since window (`updated_since`), which a file cannot answer. A filter this export does
not have, a filter sent with no value, a
`status` or `direction` outside its set, a `from` / `to` that is not a real ISO 8601 timestamp, and a `from` after `to` are
`400 CALLS_QUERY_INVALID`; an `ab_variant` that is not `a` or `b` is `400 INVALID_AB_VARIANT`.
`carrier_account_id` needs `carrier_accounts:read` (`403 INSUFFICIENT_SCOPE`), and an account
that is not in this workspace is `404 CARRIER_ACCOUNT_NOT_FOUND`, as on List Calls. `provider` is
`external`, `telnyx` or `none` (`400 CALLS_QUERY_INVALID` otherwise), and needs no other scope. `search` and
`lead_id` work and refuse exactly as on List Calls: a lead that is not in this workspace is
`404 NOT_FOUND`, never a file that reads as *no calls with this lead*, and a name in `search`
matches leads only for a key with `leads:read` (agents alone for any other key).
None of them is ignored — an ignored filter would answer a file that reads as *no call matched*.


## OpenAPI

````yaml GET /calls/export
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /calls/export:
    get:
      tags:
        - Calls
      summary: Export calls as CSV
      description: >
        The call log as a file, filtered exactly as `GET /calls` is filtered.
        Required

        scope `calls:read`, or `calls:metrics`, whose file leaves From, To, Lead
        name, Summary

        and Carrier call ID empty, carries no Extracted columns, and refuses the
        `caller`,

        `callee`, `search` and `lead_id` filters. `Lead name` is filled only for
        a key that also holds

        `leads:read`; without it the column is empty on every row, as `GET
        /calls` reads

        such a key's lead as `{id}`, and a `lead_id` filter does not bring the
        name back.


        It carries the same fields as the dashboard's Export CSV, in the same
        order, so the

        two line up column for column. Every line under the headings is one
        call: the total

        is the `X-Total-Cost-USD` header, not a line among the rows. They are
        not

        byte for byte alike: this file has fixed English headings and the API's
        own values;

        the dashboard's is written in the reader's language, heads its start

        `Started (ISO 8601)` (with the workspace's offset) and adds `Started
        (<zone>)`

        second, heads its duration `Duration (seconds)`, writes the screen's
        words for

        direction, status, source and no agent, and `Yes`/`No` for
        `true`/`false`.


        Answers `text/csv; charset=utf-8` with a UTF-8 byte-order mark, which is
        what makes

        a spreadsheet read Hebrew agent and disposition names as Hebrew. Rows
        stream as they

        are read, so a large window starts arriving immediately.


        **One moment.** The file holds the calls that existed when the request
        arrived; a

        call that starts while it streams belongs to the next export, never half
        to this

        one. `X-Total-Rows` is therefore exactly the number of call rows in the
        file.


        **Columns.** `Started` (ISO 8601 with its offset, always `+00:00` — the
        file is not

        localised, so it carries no workspace timezone), `Agent` (the agent's
        name, empty

        when the call has none), `A/B` (`A`, `B`, or empty), `Direction` and
        `Status` (the

        API's own values, e.g. `web_call`, `no_answer`), `Disposition` (the
        outcome's

        label), `From`, `To`, `Duration` (whole seconds), `Cost (USD)` (dollars
        and cents;

        `0.00` on a call that ended without a charge, empty only while the
        charge is pending),

        `Source`, `Shared link ID`,

        `Call ID` (the key to `GET /calls/{id}` — join on this), `Lead name`
        (empty when the

        call has no lead or it was deleted, and for a key without `leads:read`),
        `Summary`, `Cost status` (`charged`,

        `not_charged` or `pending`, exactly as `cost_status` on `GET /calls`),
        `Ended by`

        (`caller`, `agent`, `system`, `operator`, `unknown`, or empty when
        nothing recorded

        it, exactly as `ended_by` on `GET /calls`), `Agent ID` (the agent's id
        beside its

        name, so two agents with one name stay two in a pivot), `Provider`
        (`external`,

        `telnyx`, or empty on a browser call, exactly as `provider` on `GET
        /calls`), `Carrier

        account` (the carrier account's name on an `external` call, for a key
        with

        `carrier_accounts:read`; empty otherwise), `Carrier call ID` (on an
        `external` call, the

        id Telnyx gave it on your account, as `carrier_call_id`), then one
        `Extracted: <field>` column

        per field any call in the file collected, named for its key in
        `extracted_data`

        (a string as written, a number or `true`/`false` as the API returns it,
        anything

        nested as JSON, empty when the call did not collect it). In `Lead name`,
        `Summary`

        and the `Extracted:` columns a value opening with `=`, `+`, `-`, `@` or
        a tab is

        written with a leading apostrophe so a spreadsheet does not run it as a
        formula; a

        phone number or a plain number is written as it is. The first twenty-one
        columns

        never move; the `Extracted:` set depends on the window, so read those by
        heading.

        There is no `Total` line: what the rows cost together is the
        `X-Total-Cost-USD`

        header.


        **Row limit.** At most 10000 calls per export. A window holding more is
        refused

        with `400 CALLS_EXPORT_TOO_LARGE` naming the count — never truncated,
        because a

        file cut short carries totals that are wrong and says nothing about it.
        Page a

        larger export by splitting the window with `from` and `to`: a call's
        start time

        never changes, so consecutive windows skip nothing. `to` is inclusive,
        so a call

        that started at exactly a boundary is in both neighbouring files —
        de-duplicate on

        `Started` before adding their `X-Total-Cost-USD` values up.


        `limit`, `offset`, `cursor` and `updated_since` are refused here with

        `400 CALLS_QUERY_INVALID`. An export is one whole window of call starts,
        not a page

        of it and not what changed since it last ran: to read pages, or the
        calls that have

        changed, use `GET /calls`.
      operationId: exportCalls
      parameters:
        - in: query
          name: agent_id
          schema:
            type: string
            format: uuid
          description: >-
            Only this agent's calls. An id that is not an agent in this
            workspace is 404 AGENT_NOT_FOUND, as on GET /calls.
        - in: query
          name: status
          schema:
            type: string
            enum:
              - pending_connection
              - ringing
              - in_progress
              - completed
              - failed
              - no_answer
              - transferred
              - dnc_blocked
          description: >-
            pending_connection is a browser session minted with POST /calls that
            no browser has connected to yet. Anything outside the list is 400
            CALLS_QUERY_INVALID.
        - in: query
          name: direction
          schema:
            type: string
            enum:
              - inbound
              - outbound
              - web_call
        - in: query
          name: callee
          schema:
            type: string
          description: Destination number in E.164.
          example: '+972501234567'
        - in: query
          name: caller
          schema:
            type: string
          description: Source number in E.164.
          example: '+972551234567'
        - in: query
          name: ab_variant
          schema:
            type: string
            enum:
              - a
              - b
          description: >
            Which side of a number's A/B split took the call. Anything but a or
            b is 400 INVALID_AB_VARIANT, exactly as on GET /calls — never an
            empty file that reads as "no call ran that variant".
        - in: query
          name: disposition
          schema:
            type: string
          description: >
            Only calls that ended with this outcome, by its label exactly as GET
            /dispositions returns it. A label this workspace does not have is
            404 CALL_DISPOSITION_UNKNOWN rather than an empty file.
          example: Interested
        - in: query
          name: disposition_id
          schema:
            type: string
            format: uuid
          description: The same outcome filter by id. Send this or `disposition`, not both.
        - in: query
          name: source
          schema:
            type: string
            enum:
              - test
              - shared_link
              - api
              - phone_inbound
              - phone_outbound
        - in: query
          name: carrier_account_id
          schema:
            type: string
            format: uuid
          description: >
            Only calls on this carrier account (signed for, placed from or
            answered on one of its numbers), exactly as on GET /calls: needs
            carrier_accounts:read (403 INSUFFICIENT_SCOPE), and an account that
            is not in this workspace is 404 CARRIER_ACCOUNT_NOT_FOUND rather
            than an empty file. The file's name carries it:
            `calls-carrier-7c1e4a2b-….csv`, the first eight characters of the
            id.
        - in: query
          name: provider
          schema:
            type: string
            enum:
              - external
              - telnyx
              - none
          description: >
            Only calls on this carrier, exactly as on GET /calls: external,
            telnyx or none (a browser call). The file's name carries it:
            `calls-provider-external-….csv`.
        - in: query
          name: search
          schema:
            type: string
            minLength: 2
            maxLength: 100
          description: >
            The same search as GET /calls - the start of a call id (8 or more
            characters), a phone number at either end, or part of an agent's or
            a lead's name. A lead's name is searched only for a key with
            leads:read; for any other key a name matches agents alone.
          example: Tamar
        - in: query
          name: lead_id
          schema:
            type: string
            format: uuid
          description: >
            Only calls with this lead. A lead that is not in this workspace is
            404 NOT_FOUND rather than an empty file.
        - in: query
          name: from
          schema:
            type: string
            format: date-time
          description: >
            Calls created on or after this timestamp. A value that is not a real
            date — including a month-end its month does not have, like
            2026-09-31 — is 400 CALLS_QUERY_INVALID.
        - in: query
          name: to
          schema:
            type: string
            format: date-time
          description: >
            Calls created on or before this timestamp, inclusive. Refused the
            same way from is. A date-only value covers that whole day (UTC), up
            to 23:59:59.999999.
      responses:
        '200':
          description: >
            The file. `Content-Disposition` names it for its filters and its
            window

            (`calls-agent-9b29b0c9-no_answer-2026-09-01_2026-09-30.csv`; the
            agent and an

            outcome filter by the first eight characters of their id),
            `X-Total-Rows` carries

            the number of calls in it and `X-Total-Cost-USD` what they cost
            together. Every

            line under the headings is a call.
          headers:
            Content-Disposition:
              schema:
                type: string
              description: >-
                attachment;
                filename="calls-agent-9b29b0c9-2026-09-01_2026-09-30.csv"
            X-Total-Rows:
              schema:
                type: integer
              description: >
                Calls in the file. This, X-Total-Cost-USD and
                Content-Disposition are listed in Access-Control-Expose-Headers,
                so a browser client can read them too.
            X-Total-Cost-USD:
              schema:
                type: string
              description: >
                What the calls in the file cost together, in dollars and cents
                as a bare decimal (`36.57`) — the sum of the Cost (USD) column.
                It replaces the Total line the file used to end with.
          content:
            text/csv:
              schema:
                type: string
              example: >
                "Started","Agent","A/B","Direction","Status","Disposition","From","To","Duration","Cost
                (USD)","Source","Shared link ID","Call ID","Lead
                name","Summary","Cost status","Ended by","Agent
                ID","Provider","Carrier account","Carrier call ID","Extracted:
                preferred_day"

                "2026-09-14T08:03:11.123456+00:00","Dental
                intake","","outbound","completed","Booked","+972551234567","+972501234567","94","0.41","phone_outbound","","7ccf2af4-a6e2-40db-9f60-de21933d83c4","Dana
                Levi","Booked a cleaning for Tuesday
                morning.","charged","caller","3f9b1c2d-5e6a-4b7c-8d9e-0f1a2b3c4d5e","telnyx","","","Tuesday"
        '400':
          description: >
            `CALLS_QUERY_INVALID` — a filter this export does not have, a filter
            sent with no value, a `status` / `direction` / `source` outside its
            set, a `from` or `to` that is not a real timestamp, or `limit` /
            `offset`. `INVALID_AB_VARIANT` — `ab_variant` was not `a` or `b`.
            `CALLS_EXPORT_TOO_LARGE` — the window holds more than 10000 calls;
            nothing was written.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >
            `INSUFFICIENT_SCOPE` — the key holds neither `calls:read` nor
            `calls:metrics`, or holds only `calls:metrics` and filtered by
            `caller`, `callee`, `search` or `lead_id`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >
            `CALL_DISPOSITION_UNKNOWN` — the `disposition` label or
            `disposition_id` you filtered by is not a disposition in this
            workspace. `AGENT_NOT_FOUND` — the `agent_id` you filtered by is not
            an agent in this workspace. `CARRIER_ACCOUNT_NOT_FOUND` — the
            `carrier_account_id` is not a carrier account in this workspace.
            `NOT_FOUND` — the `lead_id` is not a lead in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
        - code
      description: >
        Every error response - the secret-key API and the browser data plane
        alike - carries a

        human-readable `error` and a stable machine `code`, and a refusal that
        names what is

        wrong with the request carries `issues[]` too. Branch on `code`, never
        on the `error`

        text. A refusal that names nothing more specific carries the code its
        status means:

        `BAD_REQUEST` (400), `UNAUTHORIZED` (401, the browser data plane; the
        secret-key API

        answers `MISSING_KEY`, `INVALID_KEY` or `EXPIRED_KEY`), `BILLING_ERROR`
        (402),

        `FORBIDDEN` (403), `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405),
        `CONFLICT` (409),

        `GONE` (410), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415),

        `UNPROCESSABLE_REQUEST` (422), `RATE_LIMIT` (429), `INTERNAL_ERROR`
        (500),

        `UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503), `UPSTREAM_TIMEOUT`
        (504). Some

        refusals add members of their own beside these (a call request's
        `status`, a workflow's

        `current_version`); the operation says which.
      properties:
        error:
          type: string
          description: The refusal, in one sentence for a person. Its wording may change.
        code:
          type: string
          description: The stable code to branch on.
        issues:
          type: array
          description: >
            Each thing at fault, on a 400 or 422 that names them: every query
            parameter or body field, not just the first. `path` is the
            parameter's name or the field's location.
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                description: >-
                  query_param_unknown, query_param_repeated, query_param_blank,
                  query_param_invalid, field_unknown, field_required,
                  field_invalid, or the route's own word.
              path:
                type: string
              message:
                type: string
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**. No key is `401 MISSING_KEY`; a key that
        is not one of ours, or is revoked, is `401 INVALID_KEY`; an expired one
        is `401 EXPIRED_KEY`. A valid key without the scope an operation needs
        is `403 INSUFFICIENT_SCOPE` on every operation, and the message names
        the scope. Every response, a 401 included, carries X-RateLimit-Limit,
        X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a
        minute per API key. Every 429, whatever its code, carries Retry-After
        (whole seconds, never zero): the per-key budget's `RATE_LIMIT` asks for
        what is left of the minute, a route's daily cap (`RATE_LIMITED`) for the
        time until that cap resets. All four headers are listed in
        Access-Control-Expose-Headers, so a browser can read them. A path the
        API does not serve (an unknown sub-path, an id left empty) is `404
        ROUTE_NOT_FOUND`, and a method a served path does not take is `405
        METHOD_NOT_ALLOWED` with an `Allow` header; both are answered before any
        scope check, and nothing is read or changed. A trailing slash is ignored
        where it cannot be an id left empty (`POST /calls/` is `POST /calls`)
        and refused where it can (`GET /calls/`). A doubled slash inside a path
        is merged into one before the request reaches the API (`GET //calls` is
        `GET /calls`).

````

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