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

# CRM  Integration and Action

Integrate Zoho CRM with Gnani Agents to automatically create and manage customer records during or after conversations — making lead capture and support tracking seamless.

***

## **1. Why Integrate Zoho CRM?**

By connecting Zoho CRM to Gnani Agents, your agent can:

* **Automatically create leads, contacts, or deals** while talking to customers.
* Reduce manual data entry by **capturing customer details in real time**.
* Improve lead follow-up speed and support resolution times.

***

## **2. Set Up Zoho CRM Integration**

1. **Open Integration Settings**
   * Go to **Add CRM Integration** in your Gnani Agents dashboard.
   * Select **Zoho** as the operator and enter a name for your integration.
2. **Get Zoho Credentials**
   * Open the Zoho API Console.
   * Create a **Self Client** by following Zoho’s Self Client guide.
3. **Copy Client ID & Client Secret**
   * In the **Client Secret** tab, locate your **Client ID** and **Client Secret**.
   * Paste both into the integration form in Gnani Agents.
4. **Enter Account Server URL**
   * Choose the correct **Account Server URL** based on your primary region from Zoho’s region list.
5. **Generate Account SOID**
   * Follow **Step 1** in this Zoho guide to generate your **Account SOID**, then paste it into Gnani Agents.
6. **Specify Required Scopes**
   * From Zoho’s scope list, add the required scopes for your action (e.g., `ZohoCRM.modules.ALL`).
7. **Save**
   * Click **Save** to complete the integration.

***

## **3. Create a CRM Action**

1. **Navigate to Actions**
   * Go to **Manage Agents → Select Agent → Action Tab**.
2. **Create Action**
   * Click **+** to open the **Create Action** card.
3. **Fill in Details**
   * **Name:** Use only letters, numbers, or underscores.
   * **Description:** Describe when the action should trigger.
     * Example: *"Trigger this action when the user provides new lead details."*
4. **Select Integration**
   * Choose your **Zoho CRM** integration.
5. **Choose Trigger**
   * **Post-Call:** Executes after the conversation ends.
     * If **Post-Call** is selected, you can:
       * Add **Variables** (sent to the API).
   * **On-Call:** Executes during the conversation.
     * If **On-Call** is selected, you can:
       * Write a message in the **Speak During Action** section.
       * Add **Before API Call Variables** (sent to the API).
       * Add **After API Call Variables** (received from the API).
6. **Set CRM-Specific Fields**
   * **Select Action:** Choose the CRM action type (e.g., `CREATE` for adding new records).
   * **Module Name:** Specify the CRM module where the record should be created (e.g., `Leads`, `Accounts`, `Contacts`, `Deals`).
   * **Payload:** Define the data in JSON format. Example:
     ```json theme={null}
     {
     "Company":"Example Corp",
     "Name": "Smith",
     "Email": "john.smith@example.com"
     } 
     ```

***

## **4. Test Your CRM Action**

Testing ensures the integration works correctly before using it in live conversations.

1. **Open Testing Mode**
   * Go to **Manage Agents → Select Agent → Test**.
2. **Start a Test Conversation**
   * Chat or speak with your agent in the test interface.
3. **Trigger the Action**
   * Use the same instructions or keywords from your Action’s **Description** to activate it.
4. **Verify in Zoho CRM**
   * Log in to Zoho CRM and check if the record was created or updated as expected.
5. **Check Action Logs**
   * In Gnani Agents, click **More Options (⋮)** on the Action card → **View Logs**.
   * Review execution details and any API errors.

***

✅ **Your Zoho CRM integration is now ready!** Your agent can capture leads and customer details without manual effort.
