Authentication
Create a key in Developer. Send it on every request. The key decides the workspace; nothing in the body can change it.
Authorization: Bearer kot_...
Content-Type: application/json| Limit | Per hour |
|---|---|
| Reads (GET) | 1,000 |
| Writes (POST, PATCH) | 60 |
Over the limit you get 429 with reset_at. A missing or revoked key is 401.
Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /v1/calls?limit=50 | Your calls, newest first (up to 200) |
| GET | /v1/calls/{call_id} | One call with its transcript and analysis |
| GET | /v1/agents | Your agents and their status |
| POST | /v1/agents | Create an agent; add "publish": true to put it live |
| PATCH | /v1/agents/{agent_id} | Change any editable setting |
| POST | /v1/agents/{agent_id}/publish | Publish the current version |
| POST | /v1/agents/{agent_id}/slim-prompt | Suggest a shorter prompt with the facts moved to the knowledge base (nothing is applied) |
| GET | /v1/tools | Your tools |
| POST | /v1/tools | Create a tool |
| PATCH | /v1/tools/{tool_id} | Change a tool |
Create and publish an agent
{
"name": "রঙ্গন হাউস",
"industry": "fashion",
"systemPrompt": "তুমি রঙ্গন হাউসের ফোন সহকারী। ...",
"greeting": "আসসালামু আলাইকুম, রঙ্গন হাউস। কী জানতে চান?",
"speechSpeed": 0.9,
"priceGuard": true,
"catalog": [{"name": "লাল জামদানি", "priceBdt": 6500}],
"pronunciations": [{"term": "Rongon", "replacement": "রঙ্গন"}],
"publish": true
}
201 {"agent_id": "j97...", "status": "publishing"}Required: name, industry, systemPrompt, greeting. "publishing" means the push has started; poll GET /v1/agents until it says published. A PATCH is not live until you publish.
| Field | Notes |
|---|---|
| industry | ecommerce, fashion, pharmacy, restaurant, travel, clinic, parlour, service, coaching, realestate, bank, telecom, insurance, courier, support, generic |
| catalog | [{name, priceBdt, note?}], one row per price; one-time fees as their own named rows |
| knowledgeBaseIds, toolIds | Attach knowledge bases and tools you created |
| webhookUrl | Where the order and the call summary go |
| pronunciations | [{term, replacement}]: how a word is said |
| glossary | Your own terms and how they get misheard |
| speechSpeed, welcomeDelayS, interruptible, minWordsBeforeInterruption, endCallAfterSilenceS, noiseCancellation, maxCallDurationS, monthlyMinutes | How the call feels and what it may spend |
| direction, campaignKind | Inbound, or an outbound campaign |
| deliveryInsideDhakaBdt, deliveryOutsideDhakaBdt, dynamicData, voiceId, voiceTemperature | The rest of the editable settings |
Tools
{
"name": "check_stock",
"description": "কাস্টমার কোনো পণ্যের স্টক জানতে চাইলে",
"kind": "http",
"url": "https://your-shop.com/api/stock",
"method": "GET",
"read_only": true,
"parameters": {
"type": "object",
"properties": {"product": {"type": "string", "description": "পণ্যের নাম"}},
"required": ["product"]
}
}
201 {"tool_id": "..."}
then PATCH /v1/agents/{agent_id} {"toolIds": ["..."]}- kind is http or builtin. Built-ins: end_call, transfer_call.
- url must be http(s); method GET or POST.
- read_only: true for a lookup that runs at once. Without it, a tool is an action and is confirmed with the caller first.
- Optional spoken lines: start_message, delayed_message, complete_message, failed_message.
Webhooks
Set the URL in Developer. Every call sends events to it.
| Event | When |
|---|---|
| call_started | The call is answered |
| call_ended | The call ends, with the transcript |
| call_analyzed | The summary and the collected details are ready |
POST <your url>
x-kotha-event: call_ended
x-kotha-signature: <hex HMAC-SHA256 of the body with your secret>
{"event": "call_ended", "at": 1796402883655, "data": { ... }}Three tries (now, after half a minute, after five minutes), then the delivery stays failed and visible in Developer. Verify the signature before you trust the body.
Errors
| Status | Meaning |
|---|---|
| 400 | The body is wrong; the message names the field |
| 401 | Missing, invalid or revoked key |
| 404 | Not found, or not in your workspace |
| 429 | Rate limit; retry after reset_at |