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.

bash
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

FieldTypeRequiredDescription
chatbot_idstringYesUUID of the chatbot.
tokenstringYesEmbed token from the dashboard.
querystringYesUser question. Max 500 chars.

Response

json
{ "answer": "string", "sources_used": 3, "show_branding": true }

GET /widget-config

Fetch appearance config for a chatbot. The widget calls this on init.

bash
curl "https://[project].supabase.co/functions/v1/widget-config?chatbot_id=<id>&token=<token>"

Error codes

StatusMeaning
400Missing or invalid fields.
401Invalid token.
429Monthly query limit exceeded.
503Chatbot not ready yet.