Skip to main content

API overview

Everything the dashboard does, it does through this API. If you want to automate chatbot creation, bulk-load content, or pull leads into your CRM, this is how.

You do not need the API to use SiteMesh

Creating chatbots, training them and embedding the widget are all done from the dashboard with no code. This section is for automation.

Base URL

https://apimesh.byteleaps.tech/api

Every path in this section is relative to that.

Response envelope

Every response uses the same shape.

Success:

{
"success": true,
"data": {
"chatbot": { }
}
}

The data object contains one or more named keys — chatbot, chatbots, messages, sources — depending on the endpoint. Each endpoint page documents what it returns.

Some endpoints that perform an action return a message instead of data:

{
"success": true,
"message": "Chatbot and all related data deleted successfully"
}

Error:

{
"success": false,
"error": {
"message": "Chatbot not found"
}
}

Unexpected server errors also carry a correlation id:

{
"success": false,
"error": {
"message": "Internal Server Error",
"errorId": "3f2b9a1c-..."
}
}

Quote that errorId when reporting a problem — it identifies the exact failure in the server logs.

Status codes

CodeMeaning
200Success
201Created
400Bad request — validation failed, unsupported file type, file too large
401Not authenticated, or an invalid/revoked widget key
403Authenticated but not allowed — wrong owner, or domain not authorised
404Not found
429Rate limit exceeded, or message allowance used up
500Server error

Two kinds of authentication

The API has two distinct halves.

Dashboard endpoints manage your account: creating chatbots, adding data sources, reading leads. They authenticate with a session cookie and act on your behalf.

Widget endpoints are what the embedded widget calls: sending a message, fetching config. They authenticate with a widget key sent in a header, and are scoped to a single chatbot.

Authentication

Request bodies

Send JSON with Content-Type: application/json, except for file uploads which use multipart/form-data.

Request bodies are limited to 1 MB. File uploads have their own, much larger limits — see Data sources.

Rate limits

All endpoints are rate-limited, with different allowances for authentication, chat, ingestion and everything else.

Rate limits

Reference

SectionCovers
AuthenticationRegistering, signing in, sessions, widget keys
ChatbotsCreate, read, update, delete; status, history, leads
Data sourcesAdding and managing training content
Widget keysGenerating and revoking embed keys
Widget chatThe endpoints the widget itself calls
Rate limitsLimits, 429 handling, size caps
Widget configwindow.ChatbotConfig reference