API & Zapier
Read conversations and leads or chat with your agent from your own code — and connect Zapier.
Every agent can expose a small REST API. Generate a key under Integrations → Developer → API access — it's shown once, so copy it straight into your secrets manager.
All requests carry the key as a bearer token and are scoped to that one agent:
curl https://kelma.chat/api/v1/me \
-H "Authorization: Bearer kel_your_key"
Endpoints
GET /api/v1/me— key check + agent identity.GET /api/v1/conversations— newest conversations first, with the AI summary, sentiment and intent when available. Filters:?channel=widget|whatsapp|telegram|api…,?limit=(max 100),?before=<ISO date>to page.GET /api/v1/conversations/{id}/messages— the full transcript, oldest first.GET /api/v1/leads— newest leads first;fieldsholds the captured details,kindisform,callbackorhandoff.POST /api/v1/chat— send a visitor message, get the agent's reply:
curl -X POST https://kelma.chat/api/v1/chat \
-H "Authorization: Bearer kel_your_key" \
-H "Content-Type: application/json" \
-d '{"message": "Do you deliver to Gozo?", "session_id": "user-42"}'
session_id is your thread key — reuse it and the agent keeps the conversation's context. These chats appear in your inbox on the API channel, use your knowledge, tools and memories, and count towards your plan like any other message. reply comes back null when the agent deliberately stays quiet (a human has taken the conversation over, or the plan is out of messages).
Rate limits: 600 read requests and 120 chat requests per hour per agent.
Zapier (and Make, n8n…)
Two ways to connect, no custom app needed:
- Push (instant): the Lead webhook tile sends every captured lead to a "Webhooks by Zapier" catch-hook the moment it happens — best for lead alerts, CRM rows, mailing lists.
- Poll: point a "Webhooks by Zapier" Retrieve Poll at
/api/v1/leadsor/api/v1/conversationswith your bearer key — Zapier de-duplicates on theidfield automatically.
Keep the key server-side only — never ship it in a browser or app binary. If it leaks, Regenerate replaces it instantly and the old key stops working.