Documentation
Everything you need to put your assistant on a website, build on the API and connect bookings to your own tools.
Quickstart
- Create an assistant in the dashboard and pick a starting template.
- Add knowledge: upload documents, add your website, or paste FAQs. Mark what website visitors may see as Website visitors; keep the rest Team only.
- Test it in the Test chat tab. Switch on Preview as visitor to see exactly what customers will get.
- Restrict it to your domain(s) under Website widget & API → Allowed websites.
- Install it by pasting the snippet before
</body>.
Knowledge sources
| Type | Notes |
|---|---|
| PDF, Word (.docx) | Text and tables are extracted. Scanned PDFs without a text layer are read with OCR. |
| Text, Markdown, CSV, JSON, HTML | JSON arrays are split into one readable block per record so each stays together. |
| Images (PNG, JPG, GIF, WebP) | Read with a vision model (OCR), useful for menus, price lists and posters. |
| Website | Reads the visible text of a page, optionally following same-site links up to a page limit. Sites built with JavaScript (React, Vue, Angular and other single-page apps) are loaded in a headless browser automatically when the raw page has little text. Can re-sync daily or weekly. Private and internal network addresses are blocked, including for everything the browser loads. |
| Text / FAQ | Paste anything. “Add answer” buttons across the dashboard create FAQ entries that are searchable immediately. |
Static vs. live facts. Documents are indexed and re-synced on a schedule. Fast-changing facts such as availability should not live in documents. That is why booking availability is checked live by the assistant when a visitor asks.
Public vs. team-only
Every knowledge source has two audience checkboxes: Website visitors (the widget and public API) and Team (the dashboard chat). Tick one or both; at least one is required. A source ticked only for Team is never available to visitors, and one ticked only for Visitors won't be used in the team's own test chat (use Preview as visitor to test it).
The same assistant behaves differently depending on who is talking to it:
| Channel | Knowledge it can use | Actions it can take |
|---|---|---|
| Website visitors (widget & API) | Only sources ticked for Website visitors | Only the actions you enable under What can visitors do? |
| Dashboard test chat | All sources | All actions for this assistant |
| Ask your data | None | Read-only analytics queries |
These rules are enforced on the server: unavailable actions are never offered to the AI and are rejected if requested, and team-only text is never retrieved for visitors.
Embed the widget
<script src="https://YOUR-HOST/widget.js" data-key="pk_live_…" async></script>
Add it to every page where the chat bubble should appear. It renders inside a Shadow DOM so your site's CSS can't break it, and it never injects HTML from messages.
Options
| Attribute | Description |
|---|---|
data-key | Required. The assistant's public key. |
data-position | right (default) or left. |
data-color | Accent colour override, e.g. #0ea5e9. Defaults to the colour set in the dashboard. |
data-open | true opens the chat automatically. |
data-api | Override the server address (normally inferred from the script URL). |
JavaScript API
Eyra.open(); // open the chat window
Eyra.close(); // close it
Eyra.send("Hello!"); // send a message programmatically
Human handoff
When a visitor asks for a person, the widget first shows a short form asking for their full name and email (both required). Once they submit it, the header shows “Waiting for a team member…” and the conversation appears in your Inbox as Needs human, with the visitor's name and email attached. If nobody is available the assistant says so honestly and the request is kept.
When a team member clicks Take over (or replies), the header changes to “Sam connected”, a note says they've joined, and their replies appear in the chat with their first name. Hand back to assistant returns the visitor to the AI. The widget checks for these changes every few seconds while it is open.
Team & access
Access works like AWS IAM. A permission is a single action (for example inbox:reply); a role is a named set of permissions; a group is a set of people. You attach roles to a person or a group, for all assistants or only specific ones. A person's effective access is the combination of every role attached to them directly or through a group. The workspace owner always has full access.
| Built-in role | For |
|---|---|
| Administrator | Everything, including managing the team. |
| Support Agent | Customer service reps. They see only the Inbox. |
| Support Lead | Support Agent plus transferring/taking over any conversation, deleting, insights and bookings. |
| Content Editor | Knowledge, test chat and insights. |
| Read-only | View everything, change nothing. |
Create your own roles in Team & access → Roles and duplicate a built-in one to customise it. Invite people from Members: you get a one-time link to share (it expires in 7 days). Everything is enforced on the server, nobody can grant permissions they don't hold themselves, and every change is written to the Activity log.
One person per conversation
A conversation is handled by one team member at a time. Replying or clicking Take this conversation claims it; everyone else sees “Sam is handling this” and can read but not reply, and also sees who is currently viewing it. The handler can transfer it to a colleague (the picker shows who is available and how busy they are), hand it back to the AI, or resolve it. Anyone with the Assign & take over permission can reassign any conversation.
Availability
Support reps have an Available / Away switch above their profile. If their dashboard is closed or idle for about 90 seconds they show as Offline. Everyone with inbox access can see who is available, in the Inbox and in the transfer picker.
Customer notes
Team members can add private notes to a customer. Notes show who wrote them and when, are visible to the whole team, follow the customer (matched by email) across their other conversations, and are never shown to visitors. Only the author (or someone with assign permission) can delete a note.
Content-Security-Policy
Content-Security-Policy
If your site sets a CSP, allow the Eyra host in script-src and connect-src. The widget uses constructable stylesheets, so no unsafe-inline is needed for its styles in modern browsers.
Test it on another website
The browser treats pages from different addresses as different origins, which is how a real customer site behaves. To test without deploying:
- Create a tiny page that contains the snippet and serve it on another port, for example
python3 -m http.server 9000. - Open it at
http://localhost:9000. The bubble should appear. - Under Allowed websites, add
example.comand reload: the widget is blocked. Addlocalhostand it works again.
To test on a real site, expose your server over HTTPS (a tunnel such as Cloudflare Tunnel or ngrok works), set PUBLIC_BASE_URL in the server's .env so the snippet shows the public address, add the site's domain to Allowed websites, and paste the snippet. Sites served over HTTPS must load the widget over HTTPS.
REST API (streaming)
Build your own interface by calling the public API. Responses stream as Server-Sent Events.
POST /public/v1/chat
| Field | Description |
|---|---|
public_key | The assistant's public key (pk_…). |
session_id | A random 16–64 character id (letters, digits, _ and -) you generate once per visitor and reuse. It continues the conversation. |
message | The visitor's message (up to the configured maximum length). |
page_url | Optional. Shown in your Inbox for context. |
curl -N https://YOUR-HOST/public/v1/chat \
-H 'Content-Type: application/json' \
-H 'Origin: https://your-site.com' \
-d '{"public_key":"pk_live_…","session_id":"3f9a1c0e7b2d4a58b6c1e9d0f2a7b4c3","message":"What are your opening hours?"}'
Events
| type | Payload |
|---|---|
meta | conversation_id |
status | tool: what the assistant is doing, e.g. check_availability |
delta | text: the next piece of the answer |
done | text, citations (always empty on the public channel: customers never see sources; your team sees them in the dashboard and Inbox), unanswered, handoff, needs_contact, tools_used |
error | message: safe to show to the visitor |
JavaScript example
const res = await fetch("https://YOUR-HOST/public/v1/chat", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ public_key, session_id, message })
});
const reader = res.body.getReader(), dec = new TextDecoder();
let buf = "";
for (;;) {
const { done, value } = await reader.read();
if (done) break;
buf += dec.decode(value, { stream: true });
const frames = buf.split("\n\n"); buf = frames.pop();
for (const f of frames) if (f.startsWith("data: ")) {
const ev = JSON.parse(f.slice(6));
if (ev.type === "delta") append(ev.text);
}
}
Other endpoints
| Endpoint | Purpose |
|---|---|
GET /public/v1/config?public_key= | Name, greeting, theme and suggested questions for your UI. |
GET /public/v1/poll?public_key=&session_id=&after= | Replies from a team member who took over the conversation, plus takeover, agent (their first name) and needs_contact. Poll every few seconds while a handoff is active. |
POST /public/v1/contact | Body {public_key, session_id, name, email}. When the done event has needs_contact: true, collect the visitor's full name (two or more words) and a valid email and send them here; only then does the conversation reach your team. |
Errors
| Status | Meaning |
|---|---|
| 403 | The chatbot is disabled or the request's origin isn't in the allowed websites list. |
| 404 | Unknown public key. |
| 422 | Invalid session id, empty message, or message too long. |
| 429 | Per-visitor rate limit or the assistant's daily message cap was reached. |
Bookings
Enable booking in the dashboard, add services, set your timezone and business hours, then allow the booking actions under What can visitors do?. The assistant will:
- List services and ask what the customer wants and when.
- Check live free slots (respecting hours, capacity and minimum notice).
- Read the details back and wait for an explicit “yes”.
- Create the booking safely, without double-booking, and tell the customer.
You can also add and cancel bookings manually from the Booking page. Customers can cancel only by supplying the email or phone number used when booking.
Booking webhooks
Set a webhook URL under Booking → Webhook and we'll send a POST with a JSON body whenever a booking is created or cancelled, handy for Zapier, Make, n8n, Google Calendar automations or your own API.
{
"event": "booking.created", // or "booking.cancelled"
"agent_id": 12,
"timezone": "Asia/Kathmandu",
"booking": {
"id": 481,
"service": "Teeth whitening",
"start": "2026-12-04T15:30", // business-local time
"end": "2026-12-04T16:30",
"customer_name": "Maya Rai",
"customer_email": "[email protected]",
"customer_phone": "",
"status": "confirmed",
"notes": ""
}
}
Webhooks are sent once with a 10-second timeout and are not retried or signed. Use a long, unguessable URL and treat the receiving endpoint as untrusted input.
Security checklist
- Add your domain(s) under Allowed websites. (This stops casual copying; it can be forged outside a browser.)
- Keep the messages per day cap low enough to be a safe spending ceiling.
- Mark only genuinely public content as Website visitors. Never upload secrets to any knowledge source.
- Only enable the visitor actions you need. Cancellation requires the booking's email/phone.
- Tell visitors they're chatting with an AI assistant and give them a way to reach a person.
- Rotate the public key if it is ever abused; the old key stops working immediately.
Troubleshooting
| Symptom | Fix |
|---|---|
| Website source fails with “No readable text” or mentions JavaScript | The site builds its pages in the browser. Make sure the server's browser renderer is available (pip install playwright; it uses an installed Chrome, or run playwright install chromium) and that JS_RENDER isn't off, then click Re-sync. If the site needs a login or blocks bots, add the content as Text/FAQ or files instead. |
| No chat bubble appears | Open the browser console (F12). The widget logs disabled or domain not allowed (403), a wrong key, or an unreachable server. |
403 on config or chat | The site isn't listed under Allowed websites, or the chatbot is switched off. |
| Works locally, not on my live site | Your site is HTTPS but the server address is HTTP or not publicly reachable. Serve the server over HTTPS and set PUBLIC_BASE_URL. |
| Answers just quote passages | The server is in demo mode. Add GEMINI_API_KEY or ANTHROPIC_API_KEY to .env and restart. |
| “Temporarily unavailable” | The AI model is overloaded or the key/quota is exhausted. The dashboard test chat shows the exact reason. A backup model is used automatically when configured. |
| “I can only help with questions about our business” | Nothing relevant was found in public knowledge. Check the source's visibility, or add the answer from Insights → Knowledge gaps. |
| 429 Too Many Requests | A visitor hit the rate limit, or the daily cap was reached. Adjust under Safety & limits. |