Repository navigation
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.
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 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). |
Who the key is, and the API description itself.
-
Who is calling:
GET /me
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
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
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 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
The people who gave contact details: your CRM's contacts, with custom attributes. Keyed by email per site.
-
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
Visitors who asked to be called back, as tasks.
-
List callback requests:
GET /callbacks -
Update a callback request:
PATCH /callbacks/:id
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 -
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 -
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
The business-specific instructions, versioned.
-
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
The assistant, widget, lead form, limits and IP lists, as one object.
-
The settings:
GET /settings -
Change settings:
PUT /settings
Endpoints that receive events as signed JSON.
-
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
Totals, usage and the running version.
-
Totals 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
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
Keys for this API.
-
List API keys:
GET /keys -
Create an API key:
POST /keys -
Revoke an API key:
DELETE /keys/:id
What changed, when, and who (or which key) changed it.
-
Audit log:
GET /audit
Start
Tutorials
- All tutorials
- Order tracking
- Send chats to your CRM
- Nearest store
- Verified account changes
- Logged-in customer support
- Product and stock
- Hot leads to Slack
- Knowledge base or tool?
- Testing and monitoring
- Why the AI never books
Configure
- Configuration
- Configuration reference
- CLI reference
- Knowledge base
- Prompt and instructions
- Tools: your APIs in the chat
- Agent files: import and export
- Signed-in visitors
- The widget
- The playground
- Leads and callbacks
- Jobs
- Photos and files
- Bookings and the calendar
- Integrations
- Live chat
- Telegram
- Webhooks
- Email notifications
API
API reference
- Overview
- Account
- Chat
- Conversations
- Live chat
- Labels and notes
- Leads
- Callbacks
- Jobs
- Appointments
- Integrations
- Knowledge
- Prompt
- Tools
- Settings
- Webhooks
- Analytics
- Team
- API keys
- Audit
Providers
- Overview
- Models and providers
- Custom model
- Custom knowledge base
- Workers AI (default)
- AI models: speed, quality, cost
- Cloudflare AI Search
- OpenAI
- Gemini
- Anthropic Claude
- Retell
- Your own API
Operate
- Deployment
- Turn on Turnstile
- Upgrading
- Costs and limits
- Cloudflare Free plan limits
- Security
- Troubleshooting
Build