Build intelligent chatbots with a powerful REST API. Authentication, real-time chat, webhooks, analytics, and live agent support.

REST API v1 โœ“ 30+ Endpoints OpenAPI 3.1

โšก Quick Start

Get your API key from the dashboard, then make your first request:

# 1. Authenticate curl -X POST https://konan.ma/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"email": "you@example.com", "password": "your-password"}' # Response: {"token": "eyJhbGc...", "user": {...}} # 2. Create a bot curl -X POST https://konan.ma/api/v1/bots \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "Support Bot", "domain": "support"}' # 3. Send a message curl -X POST https://konan.ma/api/v1/chat \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"bot_id": "BOT_ID", "message": "Hello!"}'

๐Ÿ” Authentication

๐ŸŽซ JWT Bearer Token

Obtain a token via POST /auth/login. Include in all requests:
Authorization: Bearer <token>

๐Ÿ”‘ API Key

Generate from the dashboard. Include in requests:
X-API-Key: <your-api-key>

๐ŸŒ Public Widget

The chat widget uses bot-specific public tokens. No user authentication required for visitor chat sessions.

๐Ÿ“ก API Endpoints

POST/auth/registerCreate new account
POST/auth/loginLogin, get JWT token
GET/auth/meGet current user
POST/auth/forgot-passwordRequest password reset
POST/auth/reset-passwordReset password with code
POST/auth/verify-emailVerify email with code
POST/auth/totp/setupEnable 2FA (TOTP)
POST/auth/totp/verifyVerify 2FA code
GET/botsList your bots
POST/botsCreate a new bot
GET/bots/{id}Get bot details
PUT/bots/{id}Update bot config
DELETE/bots/{id}Delete a bot
POST/bots/{id}/activateActivate bot
POST/bots/{id}/duplicateClone a bot
POST/chatSend message, get AI response
POST/chat/streamStreaming AI response (SSE)
GET/chat/history/{session_id}Get conversation history
GET/chat/sessions/{bot_id}List bot sessions
DELETE/chat/sessions/{session_id}Delete a session
POST/webhooksRegister a webhook URL
GET/webhooks/{bot_id}List bot webhooks
PUT/webhooks/{id}Update webhook config
DELETE/webhooks/{id}Delete a webhook
POST/webhooks/{id}/testSend test ping
GET/webhooks/{bot_id}/deliveriesDelivery logs
GET/inbox/conversations/{bot_id}List inbox conversations
GET/inbox/stats/{bot_id}Inbox statistics
PUT/inbox/sessions/{id}/assignAssign to agent
POST/inbox/auto-assign/{bot_id}Round-robin assignment
PUT/inbox/sessions/{id}/statusUpdate session status
PUT/inbox/sessions/{id}/tagsUpdate session tags
GET/inbox/notes/{session_id}List internal notes
POST/inbox/notes/{session_id}Create internal note
GET/inbox/canned-responses/{bot_id}List canned responses
POST/inbox/canned-responsesCreate canned response
GET/inbox/summary/{session_id}AI conversation summary
GET/inbox/viewsSaved inbox filters
GET/analytics/{bot_id}Bot analytics overview
GET/analytics/{bot_id}/conversationsConversation metrics
GET/analytics/{bot_id}/messagesMessage volume over time
GET/analytics/{bot_id}/csatCustomer satisfaction scores
GET/analytics/{bot_id}/topicsTop topics & intents
GET/teamsList your teams
POST/teamsCreate a team
POST/teams/{id}/inviteInvite member
GET/teams/{id}/membersList members
DELETE/teams/{id}/members/{uid}Remove member
POST/teams/{id}/share-botShare bot with team
GET/contactsList contacts
POST/contactsCreate contact
GET/contacts/{id}Get contact details
PUT/contacts/{id}Update contact
DELETE/contacts/{id}Delete contact
POST/presence/heartbeatSend heartbeat ping
GET/presence/teamTeam online status
PUT/presence/statusSet my status
GET/presence/availableAvailable agents
GET/notificationsList notifications
GET/notifications/unread-countUnread badge count
PUT/notifications/read/{id}Mark as read
PUT/notifications/read-allMark all read
GET/notifications/preferencesGet notification prefs
PUT/notifications/preferencesUpdate notification prefs

๐Ÿ“ก Webhook Events

EventDescriptionTrigger
new_messageNew chat message receivedVisitor or bot sends a message
new_sessionNew conversation startedFirst message from a visitor
handoff_requestedAI escalation to humanBot requests human agent
feedback_receivedVisitor left feedbackThumbs up/down or CSAT rating
kb_updatedKnowledge base changedDocument added/updated/deleted
automation_triggeredAutomation rule firedCondition met on a session
ticket_createdSupport ticket openedAgent or visitor creates ticket
task_createdTask assignedAgent creates a task
contact_updatedContact info changedContact created or updated
mentionAgent @mentioned@mention in internal note
session_assignedConversation assignedSession assigned to an agent

โšก Rate Limits

100
requests / minute
Standard endpoints
30
requests / minute
Chat / AI endpoints
5
requests / minute
Auth (login, register)
10 MB
max request body
File uploads included

โŒ Error Codes

CodeMeaningSolution
400Bad RequestCheck request body and parameters
401UnauthorizedInclude valid token or API key
403ForbiddenUpgrade plan or check permissions
404Not FoundCheck resource ID or path
409ConflictResource already exists
413Payload Too LargeReduce file/body size (max 10 MB)
429Rate LimitedSlow down, check rate limits above
500Server ErrorRetry later, contact support