API reference
Every endpoint of the Heyllo API, grouped by resource, with the scope it requires.
Paths are relative to https://api.heyllo.co/v1. Endpoints marked "Idempotency-Key required" reject requests without that header; see Idempotency. Lists are paginated with limit and cursor; see Pagination.
Workspaces
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /workspaces | workspaces:read | List workspaces. Filter with external_id. |
POST | /workspaces | workspaces:write | Create a workspace: name, optional external_id and metadata. Organisation keys only. Idempotency-Key required. |
GET | /workspaces/{id} | workspaces:read | Retrieve a workspace. |
PATCH | /workspaces/{id} | workspaces:write | Update name, external_id, metadata, or status (active or suspended). While suspended, calls on its bots and conversations return 403 workspace_suspended. |
DELETE | /workspaces/{id} | workspaces:write | Delete a workspace. Its bots stop answering and its keys are revoked at once. Organisation keys only. |
metadata holds up to 20 keys of your own, each with a string (up to 500 characters), number, boolean or null value. external_id must be unique among your workspaces; a duplicate returns 409 workspace_exists.
Bots
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /bots | bots:read | List bots. Filter with workspace. |
POST | /bots | bots:write | Create a bot in a workspace. Idempotency-Key required. |
GET | /bots/{id} | bots:read | Retrieve a bot. |
PATCH | /bots/{id} | bots:write | Update any of the bot fields below. Sends bot.updated. |
DELETE | /bots/{id} | bots:write | Deactivate a bot. The widget and the API stop answering for it; its knowledge and history are kept. |
GET | /bots/{id}/widget | bots:read | The widget embed snippet, embed ID and allowed domains. |
| Field | Type | Description |
|---|---|---|
workspace | string | Workspace to create the bot in. Optional for workspace-bound keys. Create only. |
name | string | 1 to 120 characters. Required on create. |
instructions | string | The bot's instructions, up to 20,000 characters. |
model | string | A model enabled for your organisation. Defaults to the platform default. |
temperature | number | 0 to 1.5. Default 0.3. |
tools | string[] | Optional tools: web_search, send_email, if enabled for your organisation. |
handoff | object | mode (ai_until_agent_joins or pause_ai), notify_emails (up to 10), timeout_minutes (1 to 1440), offline_message (up to 500 characters). |
allowed_domains | string[] | Up to 30 hostnames where the widget may load, such as example.com, *.example.com or localhost:3000. |
widget_enabled | boolean | Whether the website widget is on. Default false. |
persona | string or null | Replaces Heyllo's built-in support assistant identity at the top of the bot's prompt, up to 2,000 characters. May use {{context.<key>}} from the conversation context, {{bot.name}} and {{business.name}}. null restores the default. |
kb_first | boolean | Default true: the bot searches its knowledge base before answering questions about the business. Set false for bots that answer from actions and have no knowledge base. |
retention | string | standard (default) or no_tool_data. With no_tool_data, Heyllo keeps only the end user's messages and the bot's final replies: no tool calls or action responses, no remembered facts, no conversation summaries, and no citations stored with replies (replies still return them). For data that must stay in your system. |
actions | object[] | The actions the bot can call, up to 10: id (act_...) and optional params (any JSON object up to 4 KB, for {{params.*}}). Replaces the whole list; [] unlinks all. Organisation keys only, and only returned to them. |
Knowledge
| Method | Path | Scope | Description |
|---|---|---|---|
PUT | /bots/{id}/knowledge/documents/{external_id} | knowledge:write | Create or replace one document under your own ID: content (up to 100,000 characters), optional title, url and metadata. 202 with a job when it is indexed, 200 when nothing changed. |
POST | /bots/{id}/knowledge/documents | knowledge:write | Create or replace up to 100 documents: documents (items as above, each with external_id). Unchanged documents are skipped. Idempotency-Key required. |
GET | /bots/{id}/knowledge/documents | knowledge:read | List documents, newest first. Filter with status (processing, ready, failed, deleting) or external_id. |
GET | /bots/{id}/knowledge/documents/{external_id} | knowledge:read | Retrieve a document's status, error and words. |
DELETE | /bots/{id}/knowledge/documents/{external_id} | knowledge:write | Delete one document. The bot stops using it at once. |
DELETE | /bots/{id}/knowledge/documents | knowledge:write | Delete up to 100 documents: JSON body external_ids. Unknown IDs are returned in not_found. |
POST | /bots/{id}/knowledge/url | knowledge:write | Crawl a website: url (http or https) and max_depth (0 to 3, default 1). Adding the same URL again replaces it. Idempotency-Key required. |
DELETE | /bots/{id}/knowledge/url?url= | knowledge:write | Remove a crawled URL, exactly as it was added, and its pages. |
POST | /bots/{id}/knowledge/files | knowledge:write | Upload up to 10 files, 25 MB in total, as multipart/form-data in a files field. A file with the same name replaces the earlier one. Idempotency-Key required. |
DELETE | /bots/{id}/knowledge/files?name= | knowledge:write | Remove an uploaded file by name. |
POST | /bots/{id}/knowledge/text | knowledge:write | Set the bot's text block: content up to 100,000 characters. A bot has one text block, so this replaces the previous one. Use documents for many separate texts. Idempotency-Key required. |
DELETE | /bots/{id}/knowledge/text | knowledge:write | Remove the text block. |
POST | /bots/{id}/knowledge/qa | knowledge:write | Set the Q&A pairs: pairs (1 to 500 items of question and answer). Replaces the previous set. Idempotency-Key required. |
DELETE | /bots/{id}/knowledge/qa | knowledge:write | Remove every Q&A pair. |
GET | /bots/{id}/knowledge/sources | knowledge:read | List the websites, files, text and Q&A added with the calls above, newest first, paginated. |
DELETE | /bots/{id}/knowledge/sources/{source_id} | knowledge:write | Delete a whole source (src_...) from that list. |
GET | /knowledge_jobs/{id} | knowledge:read | A knowledge job's status (queued, processing, completed, failed), progress and words. |
See Knowledge for when to use documents, sources or an action. Every /url, /files, /text and /qa call accepts an optional description (up to 500 characters) and returns 202 with a knowledge job. Supported file types: PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, CSV, TXT, MD, HTML, JSON, RTF and ODT. A job that has not finished after an hour is marked failed.
curl https://api.heyllo.co/v1/bots/bot_k3x9q2m7v1p8z4w6t5r0y2/knowledge/files \
-H "Authorization: Bearer $HEYLLO_API_KEY" \
-H "Idempotency-Key: kb-cust-881-files-1" \
-F "[email protected]" \
-F "[email protected]"Actions
Your own APIs, which bots call as tools. See Actions for the fields and placeholders. Every call here needs an organisation-wide key; workspace- or bot-bound keys get 403 key_bound.
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /actions | actions:manage | List your actions with the number of bots using each. |
POST | /actions | actions:manage | Create an action: name, url, optional description, method, inputs, headers, body, fields, citations, timeout_ms, confirm. Returns the signing secret once. |
GET | /actions/{id} | actions:manage | Retrieve an action. Header values are shown as ********. |
PATCH | /actions/{id} | actions:manage | Update any field. headers merges: a value sets a header, null removes it, headers you leave out are kept. |
DELETE | /actions/{id} | actions:manage | Delete the action. Bots linked to it lose the tool. |
POST | /actions/{id}/rotate | actions:manage | New signing secret. The previous one also signs for 24 hours. |
POST | /actions/{id}/test | actions:manage | Run it once as a bot would: inputs, optional bot (uses its params and workspace) or params. Returns the status, timing, the URL called and what the agent would read. |
Link a bot with PATCH /bots/{id} and actions: [{"id": "act_...", "params": {...}}].
Conversations
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /conversations | conversations:read | List conversations. Filter with bot and end_user (your external ID). |
POST | /conversations | chat:write | Start a conversation: bot, optional end_user (external_id, name, email) and optional context (up to 10 string values, keys a-z0-9_ up to 40 characters, values up to 256; fixed for the conversation, see Conversation context). Sends conversation.created. |
GET | /conversations/{id} | conversations:read | Retrieve a conversation with its end user, context and handoff state. |
GET | /conversations/{id}/messages | conversations:read | Message history, newest first. |
POST | /conversations/{id}/messages | chat:write | Send the end user's message and run the agent, streamed or synchronous. See Streaming. Idempotency-Key required. |
A message has a role of user, assistant, human_agent or system. A conversation's handoff.status is none, requested, active or resolved.
Handoff
| Method | Path | Scope | Description |
|---|---|---|---|
POST | /conversations/{id}/handoff/request | handoff:write | Ask for a human: reason, optional summary and urgency (low, normal, high). Sends handoff.requested. |
POST | /conversations/{id}/handoff/accept | handoff:write | A human agent takes over: agent_name. The assistant stops replying. Sends handoff.accepted. |
POST | /conversations/{id}/human_messages | handoff:write | Reply as the human agent: content and agent_name. Requires an accepted handoff. Sends message.created. |
POST | /conversations/{id}/handoff/resolve | handoff:write | Hand the conversation back to the assistant: optional agent_name. Sends handoff.resolved. |
Webhooks
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /webhook_endpoints | webhooks:manage | List webhook endpoints. |
POST | /webhook_endpoints | webhooks:manage | Register an endpoint: url, events, optional workspace and description. Returns the signing secret once. |
GET | /webhook_endpoints/{id} | webhooks:manage | Retrieve an endpoint. |
PATCH | /webhook_endpoints/{id} | webhooks:manage | Update url, events, description or status (enabled, disabled). |
DELETE | /webhook_endpoints/{id} | webhooks:manage | Delete an endpoint and its pending deliveries. |
POST | /webhook_endpoints/{id}/rotate_secret | webhooks:manage | Issue a new signing secret. The previous one keeps signing for 24 hours. |
POST | /webhook_endpoints/{id}/test | webhooks:manage | Send a signed ping event now and report the answer. |
GET | /webhook_events | webhooks:manage | List events with their delivery status. Filter with type. |
POST | /webhook_events/{id}/redeliver | webhooks:manage | Queue an event again for every enabled endpoint subscribed to it. |
API keys
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /api_keys | keys:manage | List keys in the current environment. Secrets are never returned. |
POST | /api_keys | keys:manage | Create a key: name, scopes, optional workspace or bot, ip_allowlist and expires_at. Returns the secret once. Idempotency-Key required. |
GET | /api_keys/{id} | keys:manage | Retrieve a key. |
DELETE | /api_keys/{id} | keys:manage | Revoke a key. |
POST | /api_keys/{id}/rotate | keys:manage | Issue a replacement; the old key keeps working for expire_old_in_seconds. Idempotency-Key required. |
See Authentication for scopes, binding and rotation.
Usage and status
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /usage | usage:read | Month-to-date live usage, limits and a per-workspace breakdown. Pass period=YYYY-MM for another month. |
GET | /health | none | Service status and current API version. No authentication. |