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

# Zoho CRM integration

> Attach a note with the call TL;DR and recap to the matching Zoho CRM contact after every completed call. Works in every Zoho data center.

The Zoho CRM integration attaches a note to the matching contact after every
completed call: the TL;DR as the title and the full recap as the body. PyAI
refreshes its own OAuth access from your self-client credentials, in any Zoho
data center (.com, .eu, .in, and the rest).

## What you need

* A **Zoho self-client** with a refresh token:
  1. Open [api-console.zoho.com](https://api-console.zoho.com) → **Self
     Client**.
  2. Create a token with the `ZohoCRM.modules.all` scope (or the narrower
     contacts/notes scopes).
  3. Note the **client id**, **client secret**, and the **refresh token**
     (generate it from the self-client's code exchange if needed).
* Your **data-center hosts** if you are not on .com (for example,
  `accounts.zoho.eu` and `www.zohoapis.eu`). The defaults cover .com.

## Connect

1. In PyAI Console, open **Integrations** and find **Zoho CRM** under CRM.
2. Click **Connect**, enter the client id, client secret, and refresh token,
   and pick your events.
3. Press **Test**. A sample note posts to a matched contact.
4. Done. Notes attach after every completed call.

## Troubleshooting

* **Error: invalid\_client / invalid token.** The refresh token expired or was
  revoked, or the client secret changed. Regenerate from the self-client and
  update the connection (omitted secrets are preserved).
* **Error: INVALID\_DATA / 400.** Usually a scope problem: the token lacks the
  notes module scope. Re-issue with `ZohoCRM.modules.all`.
* **Notes land unattached.** No contact matched the caller's phone. The note
  still posts with the full recap and call reference.
* **Wrong data center.** If tokens mint but API calls 404, your account is in
  another DC; set the accounts and API hosts for your region when connecting.
