REST API endpoints
The reference for every route of the Botello REST API, with its parameters, required scope, and an example request and response.
- Plans
- All plans
- Roles
- Owner, Admin
The Botello REST API exposes ten authenticated routes, plus its OpenAPI description: read conversations, leads, contacts and knowledge sources, add knowledge, and chat with the assistant. All of them respond in JSON, are scoped to the key’s workspace, and never include internal test conversations or training conversations.
Writing a server integration: CRM sync, data export, content import, chatbot in your own application or kiosk.
Before you start
- You have an API key with the right scope: see API keys.
- Base URL:
https://api.botello.ch/api/v1. - All routes require
Authorization: Bearer bk_live_…(orX-Api-Key), exceptGET /openapi.json. - Request bodies are JSON:
Content-Type: application/json.
Overview
| Method | Route | Scope | Purpose |
|---|---|---|---|
GET | /openapi.json | none | OpenAPI 3.1 description of the API |
GET | /conversations | read | List conversations |
GET | /conversations/{id}/messages | read | One conversation and its messages |
GET | /leads | read | List leads |
GET | /contacts | read | List messaging channel contacts |
GET | /contacts/{id} | read | One contact |
GET | /knowledge/sources | read | Knowledge sources |
POST | /knowledge/urls | write | Add a URL to crawl |
POST | /knowledge/texts | write | Add a text |
POST | /knowledge/qa | write | Add a question and its answer |
POST | /chat/messages | write | Send a message to the assistant and get its reply |
Pagination
Lists accept limit and offset, and return { data, total, limit, offset }, newest first.
Prop
Type
async function* allLeads() {
for (let offset = 0; ; offset += 100) {
const res = await fetch(`https://api.botello.ch/api/v1/leads?limit=100&offset=${offset}`, {
headers: { Authorization: `Bearer ${process.env.BOTELLO_API_KEY}` },
});
if (!res.ok) throw new Error(`Botello ${res.status}`); // see Errors and limits
const page = await res.json();
yield* page.data;
if (offset + page.data.length >= page.total) return;
}
}GET /openapi.json
The OpenAPI 3.1 description of the API, without authentication. Import it into Postman, Insomnia or a client generator.
curl https://api.botello.ch/api/v1/openapi.jsonGET /conversations
The assistant’s conversations, newest first. Scope read.
Prop
Type
curl "https://api.botello.ch/api/v1/conversations?limit=2&channel=web" \
-H "Authorization: Bearer $BOTELLO_API_KEY"{
"data": [
{
"id": "8f4c1b7e-3333-4a2b-9c3d-000000000003",
"channel": "web",
"teamStatus": "open",
"contactId": null,
"createdAt": "2026-11-12T14:02:11.000Z",
"updatedAt": "2026-11-12T14:09:47.000Z"
}
],
"total": 1,
"limit": 2,
"offset": 0
}teamStatus is open, pending or closed. contactId is set for messaging channels (the channel contact).
GET /conversations/{id}/messages
One conversation and its messages, oldest first (1000 at most). Scope read.
curl https://api.botello.ch/api/v1/conversations/8f4c1b7e-3333-4a2b-9c3d-000000000003/messages \
-H "Authorization: Bearer $BOTELLO_API_KEY"{
"conversation": {
"id": "8f4c1b7e-3333-4a2b-9c3d-000000000003",
"channel": "web",
"teamStatus": "open",
"createdAt": "2026-11-12T14:02:11.000Z"
},
"messages": [
{
"id": "8f4c1b7e-7777-4a2b-9c3d-000000000007",
"role": "user",
"content": "Do you have this model in size 40?",
"createdAt": "2026-11-12T14:02:11.000Z"
},
{
"id": "8f4c1b7e-7777-4a2b-9c3d-000000000008",
"role": "assistant",
"content": "Yes, the Classic Watch comes in 40 mm…",
"createdAt": "2026-11-12T14:02:15.000Z"
}
]
}role is user (the visitor), assistant (the AI) or agent (a member of your team). A conversation from another workspace, a test conversation, one that cannot be found or an ID that is not a UUID returns 404 CONVERSATION_NOT_FOUND.
GET /leads
The assistant’s leads. Scope read. Parameters: pagination.
curl "https://api.botello.ch/api/v1/leads?limit=1" \
-H "Authorization: Bearer $BOTELLO_API_KEY"{
"data": [
{
"id": "8f4c1b7e-5555-4a2b-9c3d-000000000005",
"name": "Jane Example",
"email": "jane@example.com",
"phone": "+41790000000",
"source": "handoff",
"status": "new",
"score": 0,
"createdAt": "2026-11-12T14:05:02.000Z"
}
],
"total": 37,
"limit": 1,
"offset": 0
}source tells you where the lead came from:
source | Origin | Label in the admin |
|---|---|---|
gate | Form before the chat | Pre-chat email |
handoff | Contact request to the team, in the chat | Contact request |
order_tracking | Order tracking in the chat | Order tracking |
newsletter | Newsletter sign-up | Newsletter |
whatsapp_flow | WhatsApp form | WhatsApp form |
manual | Default value, when no origin is given | Manual |
The field is open-ended: other values may appear, for example chat or widget on older leads (shown as Chatbot and Widget in the admin). Tolerate them.
status is the follow-up your team keeps in the admin: new (default), contacted, qualified, converted or lost.
GET /contacts
The workspace’s messaging channel contacts (WhatsApp, Instagram, Messenger). Scope read. Parameters: pagination.
curl "https://api.botello.ch/api/v1/contacts?limit=1" \
-H "Authorization: Bearer $BOTELLO_API_KEY"{
"data": [
{
"id": "8f4c1b7e-4444-4a2b-9c3d-000000000004",
"channel": "whatsapp",
"name": "Jane Example",
"username": null,
"phone": "+41790000000",
"tags": ["vip"],
"marketingConsent": "opted_in",
"createdAt": "2026-10-07T08:00:00.000Z"
}
],
"total": 214,
"limit": 1,
"offset": 0
}marketingConsent is unknown (default, no answer), pending (consent given outside the channel, waiting for the customer to confirm in the channel), opted_in (accepts marketing messages) or opted_out (refuses them).
GET /contacts/{id}
One contact. Scope read. Same fields as an item of GET /contacts. Not found, or an ID that is not a UUID: 404 CONTACT_NOT_FOUND.
curl https://api.botello.ch/api/v1/contacts/8f4c1b7e-4444-4a2b-9c3d-000000000004 \
-H "Authorization: Bearer $BOTELLO_API_KEY"GET /knowledge/sources
All knowledge base sources: URLs, texts, Q&As. Scope read. No pagination.
curl https://api.botello.ch/api/v1/knowledge/sources \
-H "Authorization: Bearer $BOTELLO_API_KEY"{
"urls": [
{
"id": "0b2c…",
"url": "https://www.example.ch/shipping",
"status": "crawled",
"lastCrawled": "2026-11-10T03:00:00.000Z",
"linkCount": 12,
"createdAt": "2026-09-01T10:00:00.000Z"
}
],
"texts": [
{ "id": "5d1e…", "title": "Return policy", "createdAt": "2026-09-02T09:00:00.000Z" }
],
"qa": [
{
"id": "9a7f…",
"title": "Delivery times",
"questions": ["What are your delivery times?"],
"answer": "2 to 3 business days in Switzerland.",
"createdAt": "2026-09-03T08:00:00.000Z"
}
]
}A URL’s status is pending (waiting to be crawled), crawling (crawl in progress), crawled (done), error (failed) or cancelled (crawl cancelled).
POST /knowledge/urls
Adds a URL to crawl. It is saved like a site added from the admin (Add a website), and crawled on the next run. Scope write.
Prop
Type
curl -X POST https://api.botello.ch/api/v1/knowledge/urls \
-H "Authorization: Bearer $BOTELLO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.example.ch/faq"}'{ "id": "1c9d…", "url": "https://www.example.ch/faq", "status": "pending" }Specific errors: 400 URL_INVALID, 400 URL_NOT_PUBLIC, 400 URL_UNRESOLVABLE.
POST /knowledge/texts
Adds a text to the knowledge base. Scope write.
Prop
Type
curl -X POST https://api.botello.ch/api/v1/knowledge/texts \
-H "Authorization: Bearer $BOTELLO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Holiday opening hours", "content": "From 24 December to 2 January, the shop closes at 4 pm."}'{ "id": "7e4a…", "title": "Holiday opening hours" }POST /knowledge/qa
Adds a question and its answer. Scope write.
Prop
Type
curl -X POST https://api.botello.ch/api/v1/knowledge/qa \
-H "Authorization: Bearer $BOTELLO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"question": "Do you deliver to Liechtenstein?", "answer": "Yes, in 3 to 4 business days."}'{ "id": "3f8b…", "title": "Do you deliver to Liechtenstein?" }POST /chat/messages
Sends a message to the assistant and waits for its complete reply (no streaming). It is the same engine as the widget and the messaging channels. Scope write. Specific limit: 20 messages per minute per key.
Prop
Type
curl -X POST https://api.botello.ch/api/v1/chat/messages \
-H "Authorization: Bearer $BOTELLO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message": "Hello, what are your delivery times?", "sessionId": "client-42"}'{
"conversationId": "8f4c1b7e-3333-4a2b-9c3d-00000000000c",
"sessionId": "client-42",
"reply": "Hello! In Switzerland, allow 2 to 3 business days…",
"suggestions": ["What are the shipping costs?"],
"handoff": false,
"language": "en"
}Prop
Type
Threads are separated per key: two keys sending the same sessionId get two different conversations. Each message counts towards your workspace’s message quota.
Specific errors: 409 CHATBOT_INACTIVE (assistant disabled), 429 QUOTA_EXCEEDED (message quota reached), 429 RATE_LIMITED (more than 20 messages per minute).
Troubleshooting
| What you see | Likely cause | Fix |
|---|---|---|
401 API_KEY_INVALID | Key missing, copied incorrectly or revoked | See API keys |
403 API_KEY_SCOPE_MISSING | read or write missing | Use a key with the right scope |
400 VALIDATION_ERROR | Parameter out of bounds (limit=500, sessionId with spaces…) | Read details: it names the field and the rule |
404 NO_CHATBOT | The workspace has no assistant | Contact the Botello team |
| The conversation does not continue | Different sessionId from one message to the next | Reuse the same sessionId for the same user |
| A Studio conversation does not appear | Preview and test conversations are excluded | Normal |