API reference
These are the endpoints behind the widget. They live under your Mikabot app domain, accept JSON, and return JSON. Use them when you build your own chat surface or track products you render yourself.
How a request is accepted
Every chat request is validated against the chatbot’s configuration before it is answered. Requests that fail validation are not answered, and appear in the chatbot’s failed logs — the fastest way to diagnose a widget that stays silent.
Send a message
POST /api/chat/send
{
"message": "Which watering can suits a small balcony?",
"store_id": "st_your_chatbot_key",
"page_url": "https://yourshop.com/collections/tools",
"session_id": "visitor-session-id",
"conversation_history": [],
"detected_language": "en"
}
message— the visitor’s textstore_id— your chatbot keypage_url— the page the visitor is on, used for the domain check and shown in your chat logssession_id— groups turns into one conversation. Generate one per visitor.conversation_history— earlier turns. Send an empty array for a one-off question.detected_language— overrides automatic detection
The answer is returned in the response field, together with any products the bot decided to show.
Store information
POST /api/ai-responses/store-info returns the public details used in greetings and placeholders. Send store_id, language, and page_url.
Product tracking
Use these when you render product cards yourself and still want the numbers in your dashboard.
POST /api/product/click
product_external_id(required) — the product’s ID in your feedclick_type(required) —buy_now,view_product, orask_aisession_id,page_url,detected_language(optional)
POST /api/product/impressions
products(required) — an array, each entry with aproduct_external_idimpression_type(required) —display,search_result, ordirect_hitsession_id,page_url,detected_language(optional)
GET /api/product/click-stats
period(optional) —today,week,month, orallproduct_id(optional) — limit the totals to one product
Errors
402with codemessage_limit_reached— the monthly message limit of the billing account is used up. Chat stops until the next period.503with codeapi_unavailable— the AI provider is temporarily unavailable.- Other failures return an
errorfield with a readable message.
Requests that error are not counted against your monthly message limit.
Related
- Widget runtime — how the widget calls these endpoints
- Data and privacy — what each request stores