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

# Pipedrive integration

> Log a completed call activity in Pipedrive after every call: TL;DR subject, full recap in the note, attached to the person matched by phone. Two-minute setup.

The Pipedrive integration logs a completed **call activity** after every
call: the TL;DR as the subject, the full recap in the note, attached to the
person matched by phone number. Your activity feed stays honest without reps
logging calls they never had time to write up.

## What you need

* Your **Pipedrive API token**: **Settings → Personal preferences → API** →
  copy the token.
* Your **company domain** (the `yourcompany.pipedrive.com` host; entering
  just `yourcompany` works too).

## Connect

1. In PyAI Console, open **Integrations** and find **Pipedrive** under CRM.
2. Click **Connect**, enter the company domain and token, and pick your
   events.
3. Press **Test**. A sample activity logs to Pipedrive.
4. Done. Activities log after every completed call.

## What lands

```
Activity (type: call, done)
Subject: Customer asked to reschedule Friday's installation
Person:  Jane Doe (matched by phone)
Note:
The customer called to move their appointment. The agent offered
Tuesday or Wednesday morning; the customer chose Wednesday 9-11am.

Next steps: Confirm the new slot by SMS and update the calendar invite.
```

## Troubleshooting

* **Error: 401.** The API token is wrong or was regenerated. Copy the current
  token from Personal preferences → API and update the connection.
* **Activities land unattached.** No Pipedrive person matched the caller's
  phone number. The activity still logs with the full recap and call
  reference; attach it in Pipedrive when the person exists.
* **Duplicate-looking activities after a Zapier setup.** If the same calls
  also flow through a Zapier automation, you have two writers; pick one per
  call type.
