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

MethodPathScopeDescription
GET/workspacesworkspaces:readList workspaces. Filter with external_id.
POST/workspacesworkspaces:writeCreate a workspace: name, optional external_id and metadata. Organisation keys only. Idempotency-Key required.
GET/workspaces/{id}workspaces:readRetrieve a workspace.
PATCH/workspaces/{id}workspaces:writeUpdate 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:writeDelete 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

MethodPathScopeDescription
GET/botsbots:readList bots. Filter with workspace.
POST/botsbots:writeCreate a bot in a workspace. Idempotency-Key required.
GET/bots/{id}bots:readRetrieve a bot.
PATCH/bots/{id}bots:writeUpdate any of the bot fields below. Sends bot.updated.
DELETE/bots/{id}bots:writeDeactivate a bot. The widget and the API stop answering for it; its knowledge and history are kept.
GET/bots/{id}/widgetbots:readThe widget embed snippet, embed ID and allowed domains.
FieldTypeDescription
workspacestringWorkspace to create the bot in. Optional for workspace-bound keys. Create only.
namestring1 to 120 characters. Required on create.
instructionsstringThe bot's instructions, up to 20,000 characters.
modelstringA model enabled for your organisation. Defaults to the platform default.
temperaturenumber0 to 1.5. Default 0.3.
toolsstring[]Optional tools: web_search, send_email, if enabled for your organisation.
handoffobjectmode (ai_until_agent_joins or pause_ai), notify_emails (up to 10), timeout_minutes (1 to 1440), offline_message (up to 500 characters).
allowed_domainsstring[]Up to 30 hostnames where the widget may load, such as example.com, *.example.com or localhost:3000.
widget_enabledbooleanWhether the website widget is on. Default false.
personastring or nullReplaces 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_firstbooleanDefault 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.
retentionstringstandard (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.
actionsobject[]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

MethodPathScopeDescription
PUT/bots/{id}/knowledge/documents/{external_id}knowledge:writeCreate 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/documentsknowledge:writeCreate 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/documentsknowledge:readList documents, newest first. Filter with status (processing, ready, failed, deleting) or external_id.
GET/bots/{id}/knowledge/documents/{external_id}knowledge:readRetrieve a document's status, error and words.
DELETE/bots/{id}/knowledge/documents/{external_id}knowledge:writeDelete one document. The bot stops using it at once.
DELETE/bots/{id}/knowledge/documentsknowledge:writeDelete up to 100 documents: JSON body external_ids. Unknown IDs are returned in not_found.
POST/bots/{id}/knowledge/urlknowledge:writeCrawl 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:writeRemove a crawled URL, exactly as it was added, and its pages.
POST/bots/{id}/knowledge/filesknowledge:writeUpload 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:writeRemove an uploaded file by name.
POST/bots/{id}/knowledge/textknowledge:writeSet 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/textknowledge:writeRemove the text block.
POST/bots/{id}/knowledge/qaknowledge:writeSet the Q&A pairs: pairs (1 to 500 items of question and answer). Replaces the previous set. Idempotency-Key required.
DELETE/bots/{id}/knowledge/qaknowledge:writeRemove every Q&A pair.
GET/bots/{id}/knowledge/sourcesknowledge:readList the websites, files, text and Q&A added with the calls above, newest first, paginated.
DELETE/bots/{id}/knowledge/sources/{source_id}knowledge:writeDelete a whole source (src_...) from that list.
GET/knowledge_jobs/{id}knowledge:readA 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.

Upload files
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.

MethodPathScopeDescription
GET/actionsactions:manageList your actions with the number of bots using each.
POST/actionsactions:manageCreate an action: name, url, optional description, method, inputs, headers, body, fields, citations, timeout_ms, confirm. Returns the signing secret once.
GET/actions/{id}actions:manageRetrieve an action. Header values are shown as ********.
PATCH/actions/{id}actions:manageUpdate any field. headers merges: a value sets a header, null removes it, headers you leave out are kept.
DELETE/actions/{id}actions:manageDelete the action. Bots linked to it lose the tool.
POST/actions/{id}/rotateactions:manageNew signing secret. The previous one also signs for 24 hours.
POST/actions/{id}/testactions:manageRun 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

MethodPathScopeDescription
GET/conversationsconversations:readList conversations. Filter with bot and end_user (your external ID).
POST/conversationschat:writeStart 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:readRetrieve a conversation with its end user, context and handoff state.
GET/conversations/{id}/messagesconversations:readMessage history, newest first.
POST/conversations/{id}/messageschat:writeSend 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

MethodPathScopeDescription
POST/conversations/{id}/handoff/requesthandoff:writeAsk for a human: reason, optional summary and urgency (low, normal, high). Sends handoff.requested.
POST/conversations/{id}/handoff/accepthandoff:writeA human agent takes over: agent_name. The assistant stops replying. Sends handoff.accepted.
POST/conversations/{id}/human_messageshandoff:writeReply as the human agent: content and agent_name. Requires an accepted handoff. Sends message.created.
POST/conversations/{id}/handoff/resolvehandoff:writeHand the conversation back to the assistant: optional agent_name. Sends handoff.resolved.

Webhooks

MethodPathScopeDescription
GET/webhook_endpointswebhooks:manageList webhook endpoints.
POST/webhook_endpointswebhooks:manageRegister an endpoint: url, events, optional workspace and description. Returns the signing secret once.
GET/webhook_endpoints/{id}webhooks:manageRetrieve an endpoint.
PATCH/webhook_endpoints/{id}webhooks:manageUpdate url, events, description or status (enabled, disabled).
DELETE/webhook_endpoints/{id}webhooks:manageDelete an endpoint and its pending deliveries.
POST/webhook_endpoints/{id}/rotate_secretwebhooks:manageIssue a new signing secret. The previous one keeps signing for 24 hours.
POST/webhook_endpoints/{id}/testwebhooks:manageSend a signed ping event now and report the answer.
GET/webhook_eventswebhooks:manageList events with their delivery status. Filter with type.
POST/webhook_events/{id}/redeliverwebhooks:manageQueue an event again for every enabled endpoint subscribed to it.

API keys

MethodPathScopeDescription
GET/api_keyskeys:manageList keys in the current environment. Secrets are never returned.
POST/api_keyskeys:manageCreate 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:manageRetrieve a key.
DELETE/api_keys/{id}keys:manageRevoke a key.
POST/api_keys/{id}/rotatekeys:manageIssue 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

MethodPathScopeDescription
GET/usageusage:readMonth-to-date live usage, limits and a per-workspace breakdown. Pass period=YYYY-MM for another month.
GET/healthnoneService status and current API version. No authentication.