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.
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.
/connect or tap π Connect CRM; in the browser chat tap π Connect CRM (or type /connect). Choose π§ My own CRM via API..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).pipelines.list) and shows the pipelines it sees./accounts.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"
}
}
}
}
{
"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": "β¦"
}
}
| auth.type | Fields | Notes |
|---|---|---|
oauth2_code | authorize_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_credentials | token_url, client_id, client_secret, scopes | Server-to-server, token cached until it expires. |
bearer | token | Authorization: Bearer β¦ |
api_key | key, header | Default header X-API-Key. |
basic | username, password | HTTP Basic. |
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.
| Operation | Placeholders Kai supplies | Response paths |
|---|---|---|
pipelines.list | β | items, id, name, stages, stage_id, stage_name, stage_type (won/lost), won_stages[], lost_stages[] |
pipelines.stages | pipeline_id | items, stage_id, stage_name, stage_type |
pipelines.create / update / delete / add_stage / update_stage / delete_stage | name, stages[], pipeline_id, status_id | id |
leads.list | pipeline_id, page | items, id, name, price, stage_id, pipeline_id, updated_at, next, page_size |
leads.search | query, pipeline_id | items, id, name, price, stage_id, pipeline_id, updated_at |
leads.create / update / delete / link | name, price, pipeline_id, status_id, responsible_id, custom_fields[], lead_id, contact_id, company_id | id |
contacts.create / update / delete | name, phone, email, responsible_id, contact_id | id |
companies.create / update / delete | name, responsible_id, company_id | id |
tasks.create / complete / delete | text, task_type, due_days, due_date, due_datetime, due_ts, entity_id, entity_type, responsible_id, task_id | id |
tasks.list (optional β deal health, meeting brief) | entity_id, entity_type | items, id, text, done, due |
notes.create | entity, entity_id, text, note_type | β |
notes.list (optional β deal health, meeting brief) | entity_id, entity_type | items, text |
tags.create / add | name, entity, entity_id, tag | β |
fields.list / create / update / delete / set_value | entity, name, field_type, enums[], field_id, entity_id, value | items, 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.
β’ 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.
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).
{
"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
}
]
}
]
}
}
}
}
}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"
}
}
}
}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.
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.
| Key | Meaning |
|---|---|
event | Path to the event name in your payload (default event). |
map | Your 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_id | Paths to fields of the entity (defaults: data.id, data.stage_idβ¦). |
event_id | Path to a unique delivery id β repeated deliveries within 10 minutes are ignored. |
signing, signing_secret | HMAC-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.
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.