Connect your own CRM to Kai

Kai works with amoCRM, Kommo and Bitrix24 out of the box. If you run your own or a private CRM with a REST API, describe it with a connector spec β€” a JSON that tells Kai where the API lives, how to authorize and which endpoint does what. After that Kai configures your CRM in chat exactly like the built-in ones. Available on the Max plan; discussing and drafting the spec is free for everyone.

Try it first: Kai Sandbox CRM

No CRM at hand? Open the chat β€” Telegram or the browser chat β€” and tap πŸ”— Connect CRM β†’ πŸ”§ My own CRM via API β†’ πŸ§ͺ Try Kai Sandbox CRM. Kai spins up a small test CRM on its server with pipelines, leads, tasks and signed events, connects it exactly like a real custom CRM and gives you a live page with its state. Everything below works there too β€” the fastest way to see what Kai will do with your CRM before you write a line of the spec.

Before you start β€” what you need

How to connect β€” step by step

  1. In Telegram send /connect or tap πŸ”— Connect CRM; in the browser chat tap πŸ”— Connect CRM (or type /connect). Choose πŸ”§ My own CRM via API.
  2. Send the spec: paste the JSON as text or attach a .json file. No spec yet? Paste your API docs as plain text (a few paragraphs) β€” Kai drafts the spec, you check it and send it back. Or tap 🧩 Build the spec step by step: Kai asks for the base URL, auth and two paths (pipelines, leads), calls them and reads the field names itself β€” no JSON to write (with OAuth 2.0 the fields are read right after you authorize).
  3. Kai validates the spec (https, public host, placeholders, secrets) and tells you exactly what to fix if something is off.
  4. OAuth 2.0: tap Authorize and sign in on your CRM's side. Other auth types: Kai runs a live check right away (pipelines.list) and shows the pipelines it sees.
  5. Done β€” ask Kai for anything you'd ask with amoCRM: Β«show pipelinesΒ», Β«create a lead …», Β«when a lead moves to … β€” create a taskΒ». If an operation isn't in your spec, Kai says so and tells you what to add.
  6. Switch between your CRMs any time with /accounts.

Minimal spec

Enough to connect and see your pipelines; everything else can be added later:

{
  "name": "My CRM",
  "base_url": "https://crm.example.com/api/v1",
  "auth": {
    "type": "bearer",
    "token": "<your API token>"
  },
  "entities": {
    "pipelines": {
      "list": {
        "method": "GET",
        "path": "/pipelines",
        "items": "data",
        "id": "id",
        "name": "name",
        "stages": "stages",
        "stage_id": "id",
        "stage_name": "name",
        "stage_type": "type"
      }
    }
  }
}

Spec template

{
  "name": "My CRM",
  "base_url": "https://crm.example.com/api/v1",
  "auth": {
    "type": "oauth2_code",
    "authorize_url": "https://crm.example.com/oauth/authorize",
    "token_url": "https://crm.example.com/oauth/token",
    "client_id": "kai",
    "client_secret": "…",
    "scopes": "crm.read crm.write"
  },
  "headers": {
    "Accept": "application/json"
  },
  "entities": {
    "pipelines": {
      "list": {
        "method": "GET",
        "path": "/pipelines",
        "items": "data",
        "id": "id",
        "name": "name",
        "stages": "stages",
        "stage_id": "id",
        "stage_name": "name",
        "stage_type": "type",
        "won": "won",
        "lost": "lost"
      }
    },
    "leads": {
      "list": {
        "method": "GET",
        "path": "/leads",
        "query": {
          "pipeline_id": "{{pipeline_id}}",
          "page": "{{page}}"
        },
        "items": "data",
        "id": "id",
        "name": "title",
        "price": "amount",
        "stage_id": "stage_id",
        "updated_at": "updated_at",
        "next": "meta.next_page"
      },
      "create": {
        "method": "POST",
        "path": "/leads",
        "body": {
          "title": "{{name}}",
          "amount": "{{price}}",
          "pipeline_id": "{{pipeline_id}}",
          "stage_id": "{{status_id}}"
        },
        "id": "data.id"
      },
      "update": {
        "method": "PATCH",
        "path": "/leads/{{lead_id}}",
        "body": {
          "title": "{{name}}",
          "amount": "{{price}}",
          "stage_id": "{{status_id}}"
        }
      },
      "delete": {
        "method": "DELETE",
        "path": "/leads/{{lead_id}}"
      }
    },
    "contacts": {
      "create": {
        "method": "POST",
        "path": "/contacts",
        "body": {
          "name": "{{name}}",
          "phone": "{{phone}}",
          "email": "{{email}}"
        },
        "id": "data.id"
      }
    },
    "tasks": {
      "create": {
        "method": "POST",
        "path": "/tasks",
        "body": {
          "text": "{{text}}",
          "due": "{{due_date}}",
          "lead_id": "{{entity_id}}"
        },
        "id": "data.id"
      },
      "complete": {
        "method": "POST",
        "path": "/tasks/{{task_id}}/complete"
      }
    },
    "notes": {
      "create": {
        "method": "POST",
        "path": "/leads/{{entity_id}}/notes",
        "body": {
          "text": "{{text}}"
        }
      }
    },
    "fields": {
      "list": {
        "method": "GET",
        "path": "/fields",
        "items": "data",
        "id": "id",
        "name": "name",
        "type": "type"
      },
      "create": {
        "method": "POST",
        "path": "/fields",
        "body": {
          "name": "{{name}}",
          "type": "{{field_type}}"
        },
        "id": "data.id"
      }
    }
  },
  "events": {
    "event": "event",
    "map": {
      "lead.created": "add_lead",
      "lead.stage_changed": "status_lead",
      "lead.updated": "update_lead",
      "contact.created": "add_contact"
    },
    "id": "data.id",
    "stage_id": "data.stage_id",
    "old_stage_id": "data.old_stage_id",
    "pipeline_id": "data.pipeline_id",
    "price": "data.amount",
    "name": "data.title",
    "event_id": "id",
    "signing": true,
    "signing_secret": "…"
  }
}

Authorization

auth.typeFieldsNotes
oauth2_codeauthorize_url, token_url, client_id, client_secret, scopes Authorization code + PKCE (S256). Redirect URI to register on your side: <Kai host>/oauth/custom/callback. Refresh tokens are used automatically.
oauth2_client_credentialstoken_url, client_id, client_secret, scopesServer-to-server, token cached until it expires.
bearertokenAuthorization: Bearer …
api_keykey, headerDefault header X-API-Key.
basicusername, passwordHTTP Basic.

Operations, placeholders and response paths

Each operation is {"method","path","query","body","headers"} plus response paths. Placeholders {{name}} are filled from the action Kai performs; {{secret.xxx}} comes from the secrets block of your spec. Response paths are dotted: data.items, result.0.id.

OperationPlaceholders Kai suppliesResponse paths
pipelines.listβ€”items, id, name, stages, stage_id, stage_name, stage_type (won/lost), won_stages[], lost_stages[]
pipelines.stagespipeline_iditems, stage_id, stage_name, stage_type
pipelines.create / update / delete / add_stage / update_stage / delete_stagename, stages[], pipeline_id, status_idid
leads.listpipeline_id, pageitems, id, name, price, stage_id, pipeline_id, updated_at, next, page_size
leads.searchquery, pipeline_iditems, id, name, price, stage_id, pipeline_id, updated_at
leads.create / update / delete / linkname, price, pipeline_id, status_id, responsible_id, custom_fields[], lead_id, contact_id, company_idid
contacts.create / update / deletename, phone, email, responsible_id, contact_idid
companies.create / update / deletename, responsible_id, company_idid
tasks.create / complete / deletetext, task_type, due_days, due_date, due_datetime, due_ts, entity_id, entity_type, responsible_id, task_idid
tasks.list (optional β€” deal health, meeting brief)entity_id, entity_typeitems, id, text, done, due
notes.createentity, entity_id, text, note_typeβ€”
notes.list (optional β€” deal health, meeting brief)entity_id, entity_typeitems, text
tags.create / addname, entity, entity_id, tagβ€”
fields.list / create / update / delete / set_valueentity, name, field_type, enums[], field_id, entity_id, valueitems, id, name, type
users.listβ€”items, id, name, email

Only pipelines.list is mandatory. Anything you don't describe, Kai will honestly report as unavailable for your CRM and tell you what to add.

Security

β€’ Only https and only public hosts: every URL is checked against private, loopback, link-local and cloud metadata addresses β€” both when you save the spec and before every request (DNS is re-resolved).

β€’ Host pinning: requests go only to the host of base_url; paths must be relative; redirects are disabled.

β€’ Templates are not code: only placeholders, no access to Kai's environment, database or other users. The request contains only the parameters of your own action.

β€’ Secrets are stored encrypted, never logged and are redacted from error messages.

β€’ Limits: spec ≀ 64 KB, request body ≀ 256 KB, response ≀ 1 MB, timeout 15 s, 60 calls per minute per connector; responses must be JSON.

β€’ OAuth: signed state (15 minutes), PKCE, fixed redirect URI; the code is exchanged only on Kai's server.

Ready-made specs: HubSpot and Pipedrive

Two real CRMs with open APIs, described end to end β€” paste, put your token in place of Β«<…>Β», send. Useful as a working example of nested fields (properties.dealname), POST-based listing, a separate stages endpoint and a search endpoint whose items are wrapped (item.id).

HubSpot (service key from Development β†’ Keys β†’ Service keys, Bearer; new private apps can't be created since Oct 26, 2026)
{
  "name": "HubSpot",
  "base_url": "https://api.hubapi.com",
  "auth": {
    "type": "bearer",
    "token": "<HubSpot service key: Development > Keys > Service keys>"
  },
  "entities": {
    "pipelines": {
      "list": {
        "method": "GET",
        "path": "/crm/v3/pipelines/deals",
        "items": "results",
        "id": "id",
        "name": "label",
        "stages": "stages",
        "stage_id": "id",
        "stage_name": "label"
      }
    },
    "leads": {
      "list": {
        "method": "POST",
        "path": "/crm/v3/objects/deals/search",
        "body": {
          "filterGroups": [
            {
              "filters": [
                {
                  "propertyName": "pipeline",
                  "operator": "EQ",
                  "value": "{{pipeline_id}}"
                }
              ]
            }
          ],
          "properties": [
            "dealname",
            "amount",
            "dealstage",
            "pipeline",
            "hs_lastmodifieddate"
          ],
          "limit": 100
        },
        "items": "results",
        "id": "id",
        "name": "properties.dealname",
        "price": "properties.amount",
        "stage_id": "properties.dealstage",
        "pipeline_id": "properties.pipeline",
        "updated_at": "properties.hs_lastmodifieddate"
      },
      "search": {
        "method": "POST",
        "path": "/crm/v3/objects/deals/search",
        "body": {
          "query": "{{query}}",
          "properties": [
            "dealname",
            "amount",
            "dealstage",
            "pipeline"
          ],
          "limit": 20
        },
        "items": "results",
        "id": "id",
        "name": "properties.dealname",
        "price": "properties.amount",
        "stage_id": "properties.dealstage",
        "pipeline_id": "properties.pipeline"
      },
      "create": {
        "method": "POST",
        "path": "/crm/v3/objects/deals",
        "body": {
          "properties": {
            "dealname": "{{name}}",
            "amount": "{{price}}",
            "pipeline": "{{pipeline_id}}",
            "dealstage": "{{status_id}}"
          }
        },
        "id": "id"
      },
      "update": {
        "method": "PATCH",
        "path": "/crm/v3/objects/deals/{{lead_id}}",
        "body": {
          "properties": {
            "dealname": "{{name}}",
            "amount": "{{price}}",
            "dealstage": "{{status_id}}"
          }
        }
      }
    },
    "contacts": {
      "create": {
        "method": "POST",
        "path": "/crm/v3/objects/contacts",
        "body": {
          "properties": {
            "firstname": "{{name}}",
            "phone": "{{phone}}",
            "email": "{{email}}"
          }
        },
        "id": "id"
      }
    },
    "tasks": {
      "create": {
        "method": "POST",
        "path": "/crm/v3/objects/tasks",
        "body": {
          "properties": {
            "hs_task_subject": "{{text}}",
            "hs_task_status": "NOT_STARTED",
            "hs_timestamp": "{{due_datetime}}"
          },
          "associations": [
            {
              "to": {
                "id": "{{entity_id}}"
              },
              "types": [
                {
                  "associationCategory": "HUBSPOT_DEFINED",
                  "associationTypeId": 216
                }
              ]
            }
          ]
        },
        "id": "id"
      }
    },
    "notes": {
      "create": {
        "method": "POST",
        "path": "/crm/v3/objects/notes",
        "body": {
          "properties": {
            "hs_note_body": "{{text}}",
            "hs_timestamp": "{{due_datetime}}"
          },
          "associations": [
            {
              "to": {
                "id": "{{entity_id}}"
              },
              "types": [
                {
                  "associationCategory": "HUBSPOT_DEFINED",
                  "associationTypeId": 214
                }
              ]
            }
          ]
        }
      }
    }
  }
}
Pipedrive (API token, header x-api-token)
{
  "name": "Pipedrive",
  "base_url": "https://api.pipedrive.com/v1",
  "auth": {
    "type": "api_key",
    "key": "<API token from Settings β†’ Personal preferences β†’ API>",
    "header": "x-api-token"
  },
  "entities": {
    "pipelines": {
      "list": {
        "method": "GET",
        "path": "/pipelines",
        "items": "data",
        "id": "id",
        "name": "name"
      },
      "stages": {
        "method": "GET",
        "path": "/stages",
        "query": {
          "pipeline_id": "{{pipeline_id}}"
        },
        "items": "data",
        "stage_id": "id",
        "stage_name": "name"
      }
    },
    "leads": {
      "list": {
        "method": "GET",
        "path": "/deals",
        "query": {
          "pipeline_id": "{{pipeline_id}}",
          "status": "all_not_deleted",
          "limit": 500
        },
        "items": "data",
        "id": "id",
        "name": "title",
        "price": "value",
        "stage_id": "stage_id",
        "pipeline_id": "pipeline_id",
        "updated_at": "update_time",
        "won_stages": [],
        "lost_stages": []
      },
      "search": {
        "method": "GET",
        "path": "/deals/search",
        "query": {
          "term": "{{query}}",
          "limit": 20
        },
        "items": "data.items",
        "id": "item.id",
        "name": "item.title",
        "price": "item.value",
        "stage_id": "item.stage.id",
        "pipeline_id": "item.pipeline.id"
      },
      "create": {
        "method": "POST",
        "path": "/deals",
        "body": {
          "title": "{{name}}",
          "value": "{{price}}",
          "pipeline_id": "{{pipeline_id}}",
          "stage_id": "{{status_id}}"
        },
        "id": "data.id"
      },
      "update": {
        "method": "PUT",
        "path": "/deals/{{lead_id}}",
        "body": {
          "title": "{{name}}",
          "value": "{{price}}",
          "stage_id": "{{status_id}}"
        }
      },
      "delete": {
        "method": "DELETE",
        "path": "/deals/{{lead_id}}"
      }
    },
    "contacts": {
      "create": {
        "method": "POST",
        "path": "/persons",
        "body": {
          "name": "{{name}}",
          "phone": "{{phone}}",
          "email": "{{email}}"
        },
        "id": "data.id"
      }
    },
    "tasks": {
      "create": {
        "method": "POST",
        "path": "/activities",
        "body": {
          "subject": "{{text}}",
          "type": "task",
          "due_date": "{{due_date}}",
          "deal_id": "{{entity_id}}"
        },
        "id": "data.id"
      },
      "list": {
        "method": "GET",
        "path": "/activities",
        "query": {
          "deal_id": "{{entity_id}}",
          "done": 0
        },
        "items": "data",
        "id": "id",
        "text": "subject",
        "done": "done",
        "due": "due_date"
      }
    },
    "notes": {
      "create": {
        "method": "POST",
        "path": "/notes",
        "body": {
          "content": "{{text}}",
          "deal_id": "{{entity_id}}"
        }
      },
      "list": {
        "method": "GET",
        "path": "/notes",
        "query": {
          "deal_id": "{{entity_id}}"
        },
        "items": "data",
        "text": "content"
      }
    }
  }
}
EspoCRM (self-hosted, API key; no pipeline endpoint β€” a static pipeline)
{
  "name": "EspoCRM",
  "base_url": "https://your-espocrm.example.com/api/v1",
  "auth": {
    "type": "api_key",
    "key": "<API key of an API User>",
    "header": "X-Api-Key"
  },
  "entities": {
    "pipelines": {
      "list": {
        "static": [
          {
            "id": "default",
            "name": "Sales",
            "stages": [
              {
                "id": "Prospecting",
                "name": "Prospecting"
              },
              {
                "id": "Qualification",
                "name": "Qualification"
              },
              {
                "id": "Proposal",
                "name": "Proposal"
              },
              {
                "id": "Negotiation",
                "name": "Negotiation"
              },
              {
                "id": "Closed Won",
                "name": "Closed Won",
                "type": "won"
              },
              {
                "id": "Closed Lost",
                "name": "Closed Lost",
                "type": "lost"
              }
            ]
          }
        ]
      }
    },
    "leads": {
      "list": {
        "method": "GET",
        "path": "/Opportunity",
        "query": {
          "maxSize": "200",
          "select": "name,amount,stage,modifiedAt"
        },
        "items": "list",
        "id": "id",
        "name": "name",
        "price": "amount",
        "stage_id": "stage",
        "updated_at": "modifiedAt",
        "page_size": 200
      },
      "search": {
        "method": "GET",
        "path": "/Opportunity",
        "query": {
          "maxSize": "20",
          "where[0][type]": "textFilter",
          "where[0][value]": "{{query}}"
        },
        "items": "list",
        "id": "id",
        "name": "name",
        "price": "amount",
        "stage_id": "stage"
      },
      "create": {
        "method": "POST",
        "path": "/Opportunity",
        "body": {
          "name": "{{name}}",
          "amount": "{{price}}",
          "stage": "{{status_id}}",
          "closeDate": "2030-12-31"
        },
        "id": "id"
      },
      "update": {
        "method": "PUT",
        "path": "/Opportunity/{{lead_id}}",
        "body": {
          "stage": "{{status_id}}",
          "amount": "{{price}}"
        }
      },
      "delete": {
        "method": "DELETE",
        "path": "/Opportunity/{{lead_id}}"
      }
    },
    "contacts": {
      "create": {
        "method": "POST",
        "path": "/Contact",
        "body": {
          "firstName": "{{name}}",
          "phoneNumber": "{{phone}}",
          "emailAddress": "{{email}}"
        },
        "id": "id"
      }
    },
    "tasks": {
      "create": {
        "method": "POST",
        "path": "/Task",
        "body": {
          "name": "{{text}}",
          "status": "Not Started",
          "dateEnd": "{{due_date}} 12:00:00",
          "parentType": "Opportunity",
          "parentId": "{{entity_id}}"
        },
        "id": "id"
      },
      "list": {
        "method": "GET",
        "path": "/Task",
        "query": {
          "maxSize": "50",
          "where[0][type]": "equals",
          "where[0][attribute]": "parentId",
          "where[0][value]": "{{entity_id}}"
        },
        "items": "list",
        "id": "id",
        "text": "name",
        "done": "status",
        "due": "dateEnd"
      }
    }
  }
}

Some self-hosted CRMs (EspoCRM among them) have no pipelines endpoint at all β€” the stage is an enum field on the deal. Describe the pipeline inline: pipelines.list with a static array of pipelines and their stages (mark the closing ones with "type":"won" / "lost"), and Kai never calls an endpoint for it. Required extra fields (like EspoCRM's closeDate) go into the create body as literals.

Events (automations and outbound integrations)

Add an events block to the spec and make your CRM POST events as JSON to the address Kai shows after connecting (…/hook/custom/<token>). One event per request or an array of up to 20.

KeyMeaning
eventPath to the event name in your payload (default event).
mapYour event name β†’ Kai event: add_lead, status_lead, update_lead, add_contact, add_company, add_task.
id, stage_id, old_stage_id, pipeline_id, price, name, responsible_idPaths to fields of the entity (defaults: data.id, data.stage_id…).
event_idPath to a unique delivery id β€” repeated deliveries within 10 minutes are ignored.
signing, signing_secretHMAC-SHA256 of the raw body in the X-Kai-Signature: sha256=<hex> header. Recommended.

Protection on Kai's side: the secret token in the URL, optional HMAC, 120 events per minute per connector, body up to 64 KB, JSON only, de-duplication by event_id, background processing with a ceiling.

Limitations

Widgets, webhooks inside your CRM and roles are not available for custom CRMs. Pipeline analytics, lead counting, deal search and deal health work through leads.list / leads.search; tasks and notes of a deal are read back only if you describe tasks.list / notes.list (the sandbox does). Kai only ever does what your spec describes β€” nothing else.