Skip to content
API

Build agents from your own code.

Everything the dashboard does to an agent, over HTTPS: create it, change it, publish it, give it tools, read its calls, and get told when a call ends.

Authentication

Create a key in Developer. Send it on every request. The key decides the workspace; nothing in the body can change it.

Every request
Authorization: Bearer kot_...
Content-Type: application/json
LimitPer 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

MethodPathWhat it does
GET/v1/calls?limit=50Your calls, newest first (up to 200)
GET/v1/calls/{call_id}One call with its transcript and analysis
GET/v1/agentsYour agents and their status
POST/v1/agentsCreate an agent; add "publish": true to put it live
PATCH/v1/agents/{agent_id}Change any editable setting
POST/v1/agents/{agent_id}/publishPublish the current version
POST/v1/agents/{agent_id}/slim-promptSuggest a shorter prompt with the facts moved to the knowledge base (nothing is applied)
GET/v1/toolsYour tools
POST/v1/toolsCreate a tool
PATCH/v1/tools/{tool_id}Change a tool

Create and publish an agent

POST /v1/agents
{
  "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.

FieldNotes
industryecommerce, 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, toolIdsAttach knowledge bases and tools you created
webhookUrlWhere the order and the call summary go
pronunciations[{term, replacement}]: how a word is said
glossaryYour own terms and how they get misheard
speechSpeed, welcomeDelayS, interruptible, minWordsBeforeInterruption, endCallAfterSilenceS, noiseCancellation, maxCallDurationS, monthlyMinutesHow the call feels and what it may spend
direction, campaignKindInbound, or an outbound campaign
deliveryInsideDhakaBdt, deliveryOutsideDhakaBdt, dynamicData, voiceId, voiceTemperatureThe rest of the editable settings

Tools

POST /v1/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.

EventWhen
call_startedThe call is answered
call_endedThe call ends, with the transcript
call_analyzedThe summary and the collected details are ready
What arrives
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

StatusMeaning
400The body is wrong; the message names the field
401Missing, invalid or revoked key
404Not found, or not in your workspace
429Rate limit; retry after reset_at

Ready to connect it?

Create a key in Developer and make your first call.

Start free

Let tonight’s call be the one you did not miss.