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

# Zoho CRM REST API

> Client-mode REST API connector for Zoho CRM v7 (Cases, Accounts, Deals, Tasks)

Technical Preview

## Overview

Client-mode REST API connector for Zoho CRM v7 (Cases, Accounts, Deals, Tasks). `BASE_ADDRESS` defaults to `https://www.zohoapis.com`. Auth: **OAuth 2.0 Bearer**. Pass secrets only at runtime via MQTT JSON placeholders or Hub `GET SECRET` — never commit real credentials.

## Auth

OAuth 2.0 Bearer. Prefer Hub secrets / `GET SECRET`. Never hard-code tokens into the `.lot`.

## Basic Syntax

```lot wrap theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}

DEFINE ROUTE ZohoCrmRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://www.zohoapis.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
        # Auth: Authorization Bearer {value.json.access_token} — prefer Hub secrets / GET SECRET.
        # Optional Basic: WITH USERNAME "YOUR_USER" / WITH PASSWORD GET SECRET "APP_PASSWORD"
    ADD EVENT Createcase
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Createcase"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Createcase"
        WITH METHOD "POST"
        WITH ENDPOINT "/crm/v7/Cases"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{payload}"
    ADD EVENT Listcases
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Listcases"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Listcases"
        WITH METHOD "GET"
        WITH ENDPOINT "/crm/v7/Cases"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Updateaccount
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Updateaccount"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Updateaccount"
        WITH METHOD "PUT"
        WITH ENDPOINT "/crm/v7/Accounts/{value.json.id}"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    # ... additional EVENTs in package .lot ...
```

## MQTT topics

Request topics under `integrations/zoho-crm/request/...`; responses on `integrations/zoho-crm/response/...`.

## Template reference

Generated from the shipped broker template `zoho-crm` (`-routeCode ZOHO_CRM`). It lists every event the template defines.

### Auth

OAuth 2.0 Bearer

Auth headers used by the template: `Authorization: Bearer {value.json.access_token}`.

### Template parameters

| Placeholder | Type | Description | Required |
| - | - | - | - |
| `RouteName` | string | Name of the Zoho CRM connector | no |
| `BaseUrl` | string | Zoho CRM base URL without trailing slash (e.g. [https://www.zohoapis.com](https://www.zohoapis.com)) | yes |

`BASE_ADDRESS` default: `https://www.zohoapis.com`.

### Events

| Event | Method | Endpoint | Request topic | Response topic | Payload fields |
| - | - | - | - | - | - |
| `Createcase` | POST | `/crm/v7/Cases` | `integrations/zoho-crm/request/Createcase` | `integrations/zoho-crm/response/Createcase` | `access_token`, `body` |
| `Listcases` | GET | `/crm/v7/Cases` | `integrations/zoho-crm/request/Listcases` | `integrations/zoho-crm/response/Listcases` | `access_token` |
| `Updateaccount` | PUT | `/crm/v7/Accounts/{value.json.id}` | `integrations/zoho-crm/request/Updateaccount` | `integrations/zoho-crm/response/Updateaccount` | `access_token`, `body`, `id` |
| `Getaccount` | GET | `/crm/v7/Accounts/{value.json.id}` | `integrations/zoho-crm/request/Getaccount` | `integrations/zoho-crm/response/Getaccount` | `access_token`, `id` |
| `Searchdeals` | GET | `/crm/v7/Deals/search?criteria={value.json.criteria}` | `integrations/zoho-crm/request/Searchdeals` | `integrations/zoho-crm/response/Searchdeals` | `access_token`, `criteria` |
| `Createtask` | POST | `/crm/v7/Tasks` | `integrations/zoho-crm/request/Createtask` | `integrations/zoho-crm/response/Createtask` | `access_token`, `body` |
| `Listcontacts` | GET | `/crm/v7/Contacts` | `integrations/zoho-crm/request/Listcontacts` | `integrations/zoho-crm/response/Listcontacts` | `access_token` |
| `Createlead` | POST | `/crm/v7/Leads` | `integrations/zoho-crm/request/Createlead` | `integrations/zoho-crm/response/Createlead` | `access_token`, `body` |

### Deploy

Get the template card (JSON with `template` and `metadata`) from the broker, then deploy the connector:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_pub -t '$SYS/Coreflux/Command' -m "-routeCode ZOHO_CRM"
```

The deployable connector from the REST API app, with `BASE_ADDRESS` already filled in:

```lot theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
DEFINE ROUTE ZohoCrmRestApi WITH TYPE REST_API
    ADD REST_API_CONFIG
        WITH BASE_ADDRESS "https://www.zohoapis.com"
        WITH ENABLE_CLIENT "true"
        WITH USE_SSL "true"
        WITH REQUEST_TIMEOUT '30'
        WITH DEFAULT_CONTENT_TYPE "application/json"
    ADD EVENT Createcase
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Createcase"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Createcase"
        WITH METHOD "POST"
        WITH ENDPOINT "/crm/v7/Cases"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT Listcases
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Listcases"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Listcases"
        WITH METHOD "GET"
        WITH ENDPOINT "/crm/v7/Cases"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Updateaccount
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Updateaccount"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Updateaccount"
        WITH METHOD "PUT"
        WITH ENDPOINT "/crm/v7/Accounts/{value.json.id}"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT Getaccount
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Getaccount"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Getaccount"
        WITH METHOD "GET"
        WITH ENDPOINT "/crm/v7/Accounts/{value.json.id}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Searchdeals
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Searchdeals"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Searchdeals"
        WITH METHOD "GET"
        WITH ENDPOINT "/crm/v7/Deals/search?criteria={value.json.criteria}"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Createtask
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Createtask"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Createtask"
        WITH METHOD "POST"
        WITH ENDPOINT "/crm/v7/Tasks"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
    ADD EVENT Listcontacts
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Listcontacts"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Listcontacts"
        WITH METHOD "GET"
        WITH ENDPOINT "/crm/v7/Contacts"
        WITH HEADERS
            ADD "Accept" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
    ADD EVENT Createlead
        WITH SOURCE_TOPIC "integrations/zoho-crm/request/Createlead"
        WITH DESTINATION_TOPIC "integrations/zoho-crm/response/Createlead"
        WITH METHOD "POST"
        WITH ENDPOINT "/crm/v7/Leads"
        WITH HEADERS
            ADD "Content-Type" "application/json"
            ADD "Authorization" "Bearer {value.json.access_token}"
        WITH BODY "{value.json.body}"
```

Deploy it with `-addRoute` (do not include `ADD METADATA`).

### Usage example

Call `Createcase` by publishing a JSON payload to its request topic, and read the reply on the response topic:

```bash theme={"theme":"css-variables","languages":{"custom":["/languages/lot.json"]}}
mosquitto_sub -t 'integrations/zoho-crm/response/Createcase' &
mosquitto_pub -t 'integrations/zoho-crm/request/Createcase' -m '{"access_token": "<access_token>", "body": {}}'
```

## Related

* [REST API Connectors](/latest/lot-language/routes/rest-api-routes)
* [REST API apps index](/latest/lot-language/routes/rest-api-apps)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.