Elaras/

REST API

A server-side REST API for managing every Elaras Ask resource programmatically — agents, personalities, skills, knowledge, flows, scenarios, webhooks, and sessions. Authenticated with a secret key and intended for backend use only.

Authentication

Create a key under Developer > API Keys in the dashboard. Keys are team-scoped and grant access to all resources in your team.

Pass the key as a Bearer token on every request:

Authorization: Bearer sk_live_your_key_here

Never use secret keys in client-side code.

Base URL

https://api.elaras.ai/api/developer/v1

Rate limits

60 requests per minute per team. Exceeding the limit returns a 429 response.


Sessions

Read conversations and send messages programmatically.

MethodPathDescription
GET/sessionsList all sessions for your team
GET/sessions/{session_id}Get a session with full message history
POST/sessions/{session_id}/messagesSend a message to a session

Send a message

POST /sessions/{session_id}/messages
{ "message": "Your order has shipped!" }

The AI processes the message and delivers its response asynchronously to the session's WebSocket channel. If the visitor has the widget open they receive it in real time.


Agents

Full CRUD for agents.

MethodPathDescription
GET/chatbotsList all agents
POST/chatbotsCreate an agent
GET/chatbots/{id}Get an agent
PUT/chatbots/{id}Update an agent
DELETE/chatbots/{id}Delete an agent
POST/chatbots/{id}/assign-modelAssign a personality to an agent

Create an agent

{
  "name": "Support Bot",
  "greeting_message": "Hi! How can I help?",
  "fallback_message": "I'm not sure about that — let me connect you with someone."
}
FieldRequiredDescription
nameYesDisplay name, max 100 chars
greeting_messageNoShown when the widget opens
fallback_messageNoUsed when the agent cannot help
memory_enabledNoEnable per-visitor memory
collect_leadsNoEnable lead capture

Assign a personality

{ "bot_model_version_id": 42 }

Skills

Skills live at the workspace level. Manage them directly, or attach them to specific agents.

MethodPathDescription
GET/skillsList workspace skills
POST/skillsCreate a skill
PUT/skills/{id}Update a skill
DELETE/skills/{id}Delete a skill
POST/skills/{id}/testTest a skill with custom params
GET/chatbots/{id}/skillsList skills attached to an agent
POST/chatbots/{id}/skillsAttach a skill to an agent
PUT/chatbots/{id}/skills/{skill_id}Update an agent-skill attachment
DELETE/chatbots/{id}/skills/{skill_id}Detach a skill from an agent

Create a skill

{
  "name": "get_order_status",
  "description": "Look up the status of a customer order. Call when the user asks about their order, delivery, or tracking.",
  "parameters": {
    "type": "object",
    "properties": {
      "order_id": { "type": "string", "description": "The order ID to look up" }
    },
    "required": ["order_id"]
  },
  "endpoint_url": "https://your-api.com/skills/order-status",
  "api_key": "your_signing_secret"
}
FieldRequiredDescription
nameYesLowercase snake_case, max 64 chars
descriptionYesPlain English — the AI reads this to decide when to call the skill
parametersNoJSON Schema object describing the parameters the AI should extract
output_schemaNoJSON Schema of what your endpoint returns — helps the AI reason about the response
endpoint_urlYesPublicly reachable URL Elaras will POST to
api_keyNoSent as Authorization: Bearer to your endpoint and used to sign requests

Knowledge

MethodPathDescription
GET/knowledgeList knowledge documents
POST/knowledge/urlAdd a URL
POST/knowledge/crawlCrawl a site
POST/knowledge/qaAdd a Q&A pair
GET/knowledge/{id}Get a document
DELETE/knowledge/{id}Delete a document
POST/knowledge/{id}/resyncRe-fetch and re-index a document
POST/knowledge/{id}/cloneClone a document
GET/knowledge/{id}/chunksList indexed chunks for a document

Add a URL

{ "url": "https://yoursite.com/faq", "name": "FAQ" }

Crawl a site

{ "url": "https://yoursite.com", "name": "Main site", "page_limit": 50 }

Add a Q&A pair

{ "question": "What are your opening hours?", "answer": "Monday to Friday, 9am–6pm." }

Flows

MethodPathDescription
GET/flowsList flows
POST/flowsCreate a flow
PUT/flows/{id}Update a flow
DELETE/flows/{id}Delete a flow
POST/flows/generateGenerate a flow from a description
POST/chatbots/{id}/flows/{flow_id}/attachAttach a flow to an agent

Generate a flow

{ "description": "Collect name, email, and support request, then confirm a callback time." }

Personalities

Personalities are the versioned model configurations assigned to agents.

MethodPathDescription
GET/modelsList personalities
POST/modelsCreate a personality
GET/models/{id}Get a personality
PUT/models/{id}Update a personality
DELETE/models/{id}Delete a personality
GET/models/{id}/versionsList versions
POST/models/{id}/versionsCreate a draft version
PUT/models/{id}/versions/{version_id}Update a draft version
POST/models/{id}/versions/{version_id}/publishPublish a version
POST/models/{id}/versions/{version_id}/cloneClone a version
DELETE/models/{id}/versions/{version_id}Delete a draft version

Create a personality

{ "name": "Support v2", "description": "Friendlier tone for the new support flow" }

Scenarios

Test cases for validating personality versions. Scoped to a personality (model-scoped) or directly to an agent.

Model-scoped:

MethodPathDescription
GET/models/{id}/scenariosList scenarios
POST/models/{id}/scenariosCreate a scenario
POST/models/{id}/scenarios/draftDraft scenarios with AI
GET/models/{id}/scenarios/{scenario_id}Get a scenario
PUT/models/{id}/scenarios/{scenario_id}Update a scenario
DELETE/models/{id}/scenarios/{scenario_id}Delete a scenario
GET/models/{id}/scenario-runsList test runs
POST/models/{id}/scenario-runsStart a test run
GET/models/{id}/scenario-runs/compareCompare two runs
GET/models/{id}/scenario-runs/{run_id}Get run results
POST/models/{id}/scenario-runs/{run_id}/cancelCancel a run

Agent-scoped:

MethodPathDescription
GET/chatbots/{id}/scenariosList scenarios
POST/chatbots/{id}/scenariosCreate a scenario
POST/chatbots/{id}/scenarios/draftDraft scenarios with AI
GET/chatbots/{id}/scenarios/{scenario_id}Get a scenario
PUT/chatbots/{id}/scenarios/{scenario_id}Update a scenario
DELETE/chatbots/{id}/scenarios/{scenario_id}Delete a scenario
GET/chatbots/{id}/scenario-runsList test runs
POST/chatbots/{id}/scenario-runsStart a test run
GET/chatbots/{id}/scenario-runs/{run_id}Get run results
POST/chatbots/{id}/scenario-runs/{run_id}/cancelCancel a run

Preview

Send a message to an agent's draft personality for testing, with a full reasoning trace in the response.

MethodPathDescription
POST/chatbots/{id}/previewSend a preview message
DELETE/chatbots/{id}/preview/{session_token}Clear a preview session

Webhooks

MethodPathDescription
GET/webhooksList webhooks
POST/webhooksCreate a webhook
PUT/webhooks/{id}Update a webhook
DELETE/webhooks/{id}Delete a webhook
GET/webhooks/{id}/deliveriesList delivery attempts
POST/webhooks/{id}/deliveries/{delivery_id}/redeliverRetry a delivery
POST/webhooks/{id}/testSend a test event
POST/webhooks/{id}/rotate-secretRotate the signing secret

Create a webhook

{
  "name": "CRM sync",
  "url": "https://your-api.com/webhooks/elaras",
  "events": ["lead.captured"]
}

See Webhooks for event payloads and signature verification.


Errors

All errors return the same shape:

{ "message": "Human-readable description." }
StatusMeaning
401Missing or invalid API key
403Valid key but insufficient scope
404Resource not found
422Validation error
429Rate limit exceeded
500Server error — retry with backoff