AI chat API and webhooks
Keys, chat calls, product upload, signed webhooks and error codes of the Jukto AI chat API for your own code.
On this page
The public chat API lets your own code talk to the Jukto AI chat: your own chat window, an app, or a product upload from your server. Base address: https://jukto.site/api/chatbot/v1. Every answer carries the header X-Jukto-Api-Version.
Chat calls#
| Call | Key | What it does |
|---|---|---|
GET /widget | public | The chat look and texts, and whether the AI answers |
POST /chat/sessions | public or secret | Starts a chat; returns its id and token |
POST /chat/sessions/:id/messages | public or secret | Sends { text }; the answer comes back in the same call as replies |
GET /chat/sessions/:id/messages?after= | public or secret | Messages after a number, for a person's replies after a hand-over |
POST /chat/sessions/:id/lead | public or secret | An order (kind: ORDER, with an address) or a call back (kind: HANDOVER) |
With the public key, every call on a chat also needs the chat's token in X-Session-Token.
curl -X POST https://jukto.site/api/chatbot/v1/chat/sessions \
-H "Authorization: Bearer sk_live_..." -H "Content-Type: application/json" -d '{"locale":"bn"}'Products#
PUT /productswith the secret key: up to 500 products a call. Each hasexternalId,name,price(taka), and may havesalePrice,description,category,inStock,stock,variants,imageUrlsandproductUrl. The sameexternalIdupdates the product.DELETE /products/:externalIdremoves one.
Webhooks#
Set a webhook address on the On your own website page. Jukto sends lead.captured (an order request) and handover.requested (a call back) as JSON. A failed delivery is tried again up to six times, waiting longer each time.
Errors#
| Code | Status | Meaning |
|---|---|---|
CHATBOT_KEY_INVALID | 401 | The key is missing, wrong or stopped |
ORIGIN_NOT_ALLOWED | 403 | The page's domain is not on the public key |
SECRET_KEY_IN_BROWSER | 403 | A secret key was sent from a web page |
MODULE_DISABLED | 403 | The chatbot is turned off for this website |
RATE_LIMITED | 429 | Too many calls; wait and try again |

Comments (0)
Anyone can comment. Please do not post phone numbers, passwords or customer details.