API reference
Every endpoint of the HelpPuff API, one page per area. Each has a curl command and a TypeScript fetch call you can paste, the parameters and body fields, an example response with its type, and the errors. For keys, scopes, conventions and a quickstart, see The API. The same description, as OpenAPI 3.1 (for Postman, Insomnia or a client generator), is at /api/v1/openapi.json on your Worker.
Setup
The examples read two environment variables:
export HELPPUFF_URL="https://knowtific-helppuff-<site>.<you>.workers.dev" # your Worker
export HELPPUFF_API_KEY="hp_live_…" # from Settings → API keysThe TypeScript examples use fetch (Node 18+, Deno, Bun, Workers) and these shared types:
/** A message, as the widget's protocol defines it (see the Protocol page). */
type Message =
| { id: string; ts: number; role: 'agent' | 'user' | 'system'; type: 'text'; text: string }
| { id: string; ts: number; role: 'agent'; type: 'options'; text?: string; options: { label: string; value: string }[]; multi?: boolean }
| { id: string; ts: number; role: 'agent'; type: 'card'; title: string; body?: string; image?: { src: string; alt: string }; actions?: unknown[] }
| { id: string; ts: number; role: 'agent'; type: 'carousel'; cards: unknown[] }
| { id: string; ts: number; role: 'agent'; type: 'links'; title?: string; links: { label: string; url: string; description?: string }[] }
| { id: string; ts: number; role: 'agent'; type: 'form'; title?: string; fields: unknown[]; submitLabel?: string }
| { id: string; ts: number; role: 'agent' | 'system'; type: 'notice'; text: string; tone?: 'info' | 'warning' | 'error' };
/** Every error has this shape, with the HTTP status. */
type ApiError = {
error: {
code: 'bad_request' | 'unauthorized' | 'forbidden' | 'not_found' | 'conflict' | 'rate_limited' | 'quota_exceeded' | 'connector_error' | 'internal';
/** Safe to show to a person. */
message: string;
/** Seconds to wait, on 429. */
retryAfter?: number;
};
};Errors every endpoint can return
Errors are JSON in the ApiError shape above. message is safe to show to a person.
| Status | Code | When |
|---|---|---|
| 400 | bad_request | The body or a parameter is invalid; message says which. |
| 401 | unauthorized | No key, or a key that is unknown, revoked or expired. |
| 403 | forbidden | The key lacks this route's scope, belongs to another site, or is used from an address it does not allow. |
| 404 | not_found | No such record (or it belongs to another site). |
| 429 | rate_limited | Over the key's requests a minute. Wait retryAfter seconds (also in Retry-After). |
Areas
Account
Who the key is, and the API description itself.
- Who is calling:
GET /me
Chat
Talk to the assistant as a visitor, from your own server: start a conversation, send messages (JSON or streamed), close it.
- Start a conversation:
POST /conversations - Send a message:
POST /conversations/:id/messages - Close a conversation:
POST /conversations/:id/end
Conversations
Read, summarise and delete conversations, from the widget and the API alike.
- List conversations:
GET /conversations - Get a conversation:
GET /conversations/:id - Label a conversation, or set its attributes:
PATCH /conversations/:id - Summarise a conversation:
POST /conversations/:id/summary - Delete a conversation:
DELETE /conversations/:id
Live chat
A person on the team answers instead of the assistant: reply, take, give, close and hand back a live chat, and see who is available.
- Live chat now:
GET /live/status - Reply in a live chat:
POST /conversations/:id/reply - Take a conversation over:
POST /conversations/:id/takeover - Take or give a conversation:
POST /conversations/:id/assign - Close a conversation:
POST /conversations/:id/close - Hand back to the assistant:
POST /conversations/:id/handback - Telegram:
GET /live/telegram - Connect Telegram:
POST /live/telegram - Change Telegram options:
PATCH /live/telegram - Send a Telegram test:
POST /live/telegram/test - Disconnect Telegram:
DELETE /live/telegram
Labels and notes
Labels a site defines and puts on conversations (the AI can too), and the team's private notes on conversations and contacts.
- Add a note to a conversation:
POST /conversations/:id/notes - Edit a note:
PATCH /notes/:id - Delete a note:
DELETE /notes/:id - List labels:
GET /labels - Create a label:
POST /labels - Change a label:
PATCH /labels/:id - Delete a label:
DELETE /labels/:id - Add a note to a contact:
POST /leads/:id/notes
Leads
The people who gave contact details: your CRM's contacts, with custom attributes and site-defined tags. Keyed by email per site.
- List contact tags:
GET /contact-tags - Create a contact tag:
POST /contact-tags - Change a contact tag:
PATCH /contact-tags/:id - Delete a contact tag:
DELETE /contact-tags/:id - List leads:
GET /leads - Create a lead:
POST /leads - Get a lead:
GET /leads/:id - Update a lead:
PATCH /leads/:id - Delete a lead:
DELETE /leads/:id - Export leads as CSV:
GET /leads.csv
Jobs
Requests, quotes, projects or tickets on the site's pipeline: create them from your own forms and systems, move them through the stages, read their history.
- List jobs:
GET /jobs - Create a job:
POST /jobs - Get a job:
GET /jobs/:id - Change a job:
PATCH /jobs/:id - Move a job:
POST /jobs/:id/move - Add an update:
POST /jobs/:id/updates - Add a note to a job:
POST /jobs/:id/notes - A job's files:
GET /jobs/:id/files - Attach a file to a job:
POST /jobs/:id/files - Remove a file from a job:
DELETE /jobs/:id/files/:fileId - Delete a job:
DELETE /jobs/:id - The pipeline:
GET /jobs/pipeline - Change the pipeline:
PUT /jobs/pipeline - Use another template:
POST /jobs/pipeline/template - Let the AI set the pipeline up:
POST /jobs/setup
Appointments
Booking in the chat (Settings → Bookings: date picker): what is in force, the free times, appointments on jobs (from the chat, the dashboard, your systems or the synced calendar), and the sync. On only with the date picker; the assistant never books.
- How visitors book:
GET /bookings - Free times:
GET /bookings/slots - Check the calendar:
POST /bookings/test - List appointments:
GET /appointments - Get an appointment:
GET /appointments/:id - Book an appointment:
POST /appointments - Change an appointment:
PATCH /appointments/:id - Delete an appointment:
DELETE /appointments/:id - Read the synced calendar now:
POST /appointments/sync
Integrations
Keys for other services (Composio, Cal.com, Calendly), sealed and live at once, and Composio's connected calendar accounts.
- List integrations:
GET /integrations - Connect an integration:
PUT /integrations/:kind - Check an integration:
POST /integrations/:kind/test - Remove an integration:
DELETE /integrations/:kind - Composio's connected accounts:
GET /integrations/composio/accounts - Connect a calendar account:
POST /integrations/composio/connect - Cal.com webhook details:
GET /integrations/calcom/webhook
Callbacks
Visitors who asked to be called back, as tasks.
- List callback requests:
GET /callbacks - Update a callback request:
PATCH /callbacks/:id
Knowledge
What the assistant knows: the website it learned, uploaded files, hand-written knowledge and business details.
- Knowledge base status:
GET /knowledge/status - Find the website pages:
POST /knowledge/discover - Learn the website:
POST /knowledge/crawl - Try failed pages again:
POST /knowledge/crawl/retry - Cancel a crawl:
POST /knowledge/runs/:id/cancel - List learned pages:
GET /knowledge/pages - Chunks of a page:
GET /knowledge/pages/:id/chunks - Search the knowledge base:
POST /knowledge/search - Suggest starter questions:
POST /knowledge/suggest-questions - List hand-written knowledge:
GET /knowledge/manual - Add or replace hand-written knowledge:
POST /knowledge/manual - Remove hand-written knowledge:
DELETE /knowledge/manual/:id - Questions to answer:
GET /knowledge/gaps - Answer a question:
POST /knowledge/gaps/:id/answer - Dismiss a question, or open it again:
PATCH /knowledge/gaps/:id - List uploaded files:
GET /knowledge/files - Upload a file:
POST /knowledge/files - Remove an uploaded file:
DELETE /knowledge/files/:id - Business details:
GET /knowledge/facts - Set business details:
PUT /knowledge/facts - Read business details from the site:
POST /knowledge/facts/detect
Prompt
The business-specific instructions, versioned, and the agent file: the prompt, tools and behaviour settings as one file to export and import.
- The prompt and its versions:
GET /prompt - One prompt version:
GET /prompt/versions/:version - Publish a prompt version:
POST /prompt - Restore a prompt version:
POST /prompt/restore - Export the agent file:
GET /agent/export - Import an agent file:
POST /agent/import
Tools
Your own APIs, called before, during and after a chat ({{name}} in the prompt), and extract tools that save values from the finished conversation. What they return or save is kept on the conversation (data) and sent to webhooks.
- List tools:
GET /tools - Add a tool:
POST /tools - Change a tool:
PATCH /tools/:id - Remove a tool:
DELETE /tools/:id - Test a tool:
POST /tools/test
Settings
The assistant, widget, lead form, limits and IP lists, as one object.
- Test the model or the knowledge base:
POST /assistant/test - Suggest the home screen:
POST /home/suggest - The settings:
GET /settings - Change settings:
PUT /settings - List custom fields:
GET /attribute-definitions - Add a custom field:
POST /attribute-definitions - Rename a custom field:
PATCH /attribute-definitions - Remove a custom field:
DELETE /attribute-definitions
Webhooks
Endpoints that receive events as signed JSON, or as a request in their own format; and the email service that sends the team's email notifications.
- List webhook endpoints:
GET /webhooks - Add a webhook endpoint:
POST /webhooks - Change a webhook endpoint:
PATCH /webhooks/:id - Remove a webhook endpoint:
DELETE /webhooks/:id - Send a test event:
POST /webhooks/:id/test - Recent deliveries:
GET /webhooks/:id/deliveries - The email service:
GET /notifications/email - Set up the email service:
PUT /notifications/email - Remove the email service:
DELETE /notifications/email - Send a test email:
POST /notifications/email/test
Analytics
Totals, usage and the running version.
- Analytics over a period:
GET /overview - AI usage by day:
GET /usage - Running version:
GET /version - Check the widget is on the website:
GET /install-check
Team
Who can sign in to the dashboard.
- List dashboard accounts:
GET /admins - Add a dashboard account:
POST /admins - Change a role or name:
PATCH /admins/:email - Remove a dashboard account:
DELETE /admins/:email - Make a one-time sign-in link:
POST /admins/:email/sign-in-link
API keys
Keys for this API.
- List API keys:
GET /keys - Create an API key:
POST /keys - Revoke an API key:
DELETE /keys/:id
Audit
What changed, when, and who (or which key) changed it.
- Audit log:
GET /audit