API reference
REST API.
The Nestled API runs as Supabase Edge Functions. All endpoints accept and return JSON.
POST /query-chatbot
Send a question and get an answer grounded in your chatbot knowledge base.
curl https://[project].supabase.co/functions/v1/query-chatbot -H "Content-Type: application/json" -d '{"chatbot_id":"<id>","token":"<embed_token>","query":"Your question"}'Request body
| Field | Type | Required | Description |
|---|---|---|---|
chatbot_id | string | Yes | UUID of the chatbot. |
token | string | Yes | Embed token from the dashboard. |
query | string | Yes | User question. Max 500 chars. |
Response
{ "answer": "string", "sources_used": 3, "show_branding": true }GET /widget-config
Fetch appearance config for a chatbot. The widget calls this on init.
curl "https://[project].supabase.co/functions/v1/widget-config?chatbot_id=<id>&token=<token>"
Error codes
| Status | Meaning |
|---|---|
400 | Missing or invalid fields. |
401 | Invalid token. |
429 | Monthly query limit exceeded. |
503 | Chatbot not ready yet. |