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

# Aircall import (in certification)

> Coming soon: import Aircall calls into PyAI with two-event coalescing, authenticated recording refresh, Recap summaries, and Trace scorecards.

<Note>
  The Aircall importer is in live certification and opens when the gates
  pass. This guide documents the exact setup so you are ready on day one.
</Note>

The Aircall importer will bring every completed call into PyAI with the same
shape as JustCall: transcript, Recap summary, and Trace scorecard under one
stable call id. Aircall's two-event lifecycle is coalesced, so a late
recording asset merges into the same call.

## What you will need

* **Aircall API id and API token** (Basic auth), or an **Aircall access
  token** (Bearer): Aircall Dashboard → **Integrations → API keys**.
* The **webhook token** Aircall shows when you install the webhook
  (subscription token, sent in every delivery's body).

## Connect (when it opens)

1. In PyAI Console, open **Integrations** and choose **Aircall**, then enter
   the credentials (Basic or Bearer).
2. Copy the generated webhook URL.
3. In the Aircall Dashboard, open **Integrations → Webhook → Install**, set
   the URL, and enable **`call.ended`** and
   **`call.comm_assets_generated`**.
4. Aircall shows a unique subscription token; paste it into the PyAI
   connection as the **Aircall webhook token**.
5. Calls import from then on, with recordings refreshed through the
   authenticated Aircall API before download (Aircall's one-hour media URLs
   never break an import).

## Troubleshooting (planned)

* **Assets never coalesce.** Only the two events above are required; other
  Aircall events are ignored by design. If assets lag, the import retries
  automatically.
* **Token rejected.** The subscription token in the connection must match
  the one Aircall shows for this exact webhook; reinstalling the webhook
  mints a new token, so update the connection after reinstalls.
