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

# Apollo integration

> Create a follow-up call task on the matching Apollo contact after every completed call: TL;DR title, full recap in the note, due next day, high priority.

The Apollo integration creates a **follow-up call task** on the matching
Apollo contact after every completed call: the TL;DR as the title, the full
recap in the note, due the next day, marked high priority so it does not sink
in the queue.

## What you need

* An **Apollo API key**: Apollo → **Settings → Integrations → API** (or
  Developer settings) → create/copy the key.
* Your **task owner user id** (the Apollo user the tasks are assigned to):
  Apollo → **Settings → Users**, or list users via the API with your key.

## Connect

1. In PyAI Console, open **Integrations** and find **Apollo** under Sales
   engagement.
2. Click **Connect**, paste the API key and the task owner user id, and pick
   your events.
3. Press **Test**. A sample task lands on a matched contact.
4. Done. Tasks land after every completed call.

## How the contact is matched

1. If the call carries an `apollo_contact_id` or `apollo_id` CRM field, that
   contact is used directly.
2. Otherwise PyAI searches your Apollo contacts by the caller's phone number.
3. No match → the delivery fails **visibly** on the integration card (never
   silently dropped), so you can enrich the contact and let the next call
   land.

## Troubleshooting

* **Error: no Apollo contact matched this call.** Enrich/add the contact in
  Apollo, or pass `apollo_contact_id` in the call's CRM fields for an exact
  match. This error is permanent (not retried) by design.
* **Error: 401.** The API key is wrong or rotated. Create a fresh key and
  update the connection.
* **Tasks assigned to the wrong person.** Update the task owner user id in
  the connection (credentials are preserved).
* **AMD tasks look odd.** AMD events create tasks titled with the verdict and
  confidence (for example, voicemail at 92%) — useful as retry queues;
  unsubscribe AMD on this connection if you only want conversation follow-ups.
