API reference
Eloqra exposes a small REST API for provisioning accounts and managing projects programmatically — handy for AI agents and scripted setups. All endpoints live under the /v1 base and return a JSON envelope.
Base URL#
Every successful response is wrapped in an envelope with a message and a data payload:
Authentication#
Authenticated endpoints require two headers: your account ID and an API key. You'll find both in the dashboard under Settings → API.
Requests missing either header, or with an invalid key, return 401 Unauthorized. The one exception is agent-init below, which is public so an agent can create an account before any key exists.
POST/v1/auth/agent-init
Public. Start an account from just an email — used by AI agents to provision Eloqra before a key exists. Rate limited per IP and per email.
For a brand-new email, Eloqra creates the account, issues an API key, and emails a claim link. The plaintext key is returned once — store it.
If the email already belongs to a real account, no key is issued — the agent should ask the user to paste their existing key from Settings → API.
GET/v1/me
Return the authenticated account's ID and email. Useful for verifying credentials.
GET/v1/projects
List the projects on your account, most recent first.
POST/v1/projects
Create a new project. All fields are optional; a slug is generated from the business name if you don't pass one.
GET/v1/projects/:id
Fetch a single project you own by its ID.
GET/v1/projects/:id/embed-snippet
Return the ready-to-paste embed snippet for a project.
The script value is the same one-line async snippet shown in the dashboard — it sets window.ELOQRA_CHAT_CONFIG with your project ID and loads eloqra-chat.js. No container element is needed; paste it before the closing </body> tag and the chat bubble appears on every page.