Build apps for HelpVox
An app is your own service that a shop installs into HelpVox. It can give the AI phone and chat agent new tools it uses mid-conversation, react to orders and conversations, and read or change data through the REST API with the permissions the merchant approved. Your code never runs inside HelpVox.
Quickstart
Create a developer account (separate from HelpVox company accounts) and a CLI key in its settings, then scaffold, run and register an app. A private app needs no review: send its install link to the company it is for — the first company to install it owns it.
npx @helpvox/cli login # the key from helpvox.ai/developers → Settings
npx @helpvox/cli app init my-app --lang ts
cd my-app && npm install && npm run dev
cloudflared tunnel --url http://localhost:3000
npx @helpvox/cli app dev --url https://<your-tunnel> # private "-dev" twin
npx @helpvox/cli app create --visibility public # the real app
npx @helpvox/cli app deploy && npx @helpvox/cli app submitManifest
helpvox.json declares everything the app asks for. What is not in the manifest does not exist: the merchant approves exactly this list. Unknown keys are rejected. URLs are https://; http://localhost works only for private and development apps.
{
"manifest_version": 1,
"slug": "loyalty-points",
"name": { "en": "Loyalty points", "bg": "Точки за лоялност" },
"description": { "en": "Points on every delivered order, spent by phone or chat." },
"app_url": "https://loyalty.example.com",
"support_email": "help@example.com",
"privacy_url": "https://loyalty.example.com/privacy",
"redirect_urls": ["https://loyalty.example.com/helpvox/callback"],
"scopes": ["orders:read", "customers:read", "agent:tools"],
"webhooks": {
"url": "https://loyalty.example.com/helpvox/events",
"events": ["order.status_changed", "customer.redact", "app.uninstalled"]
},
"agent_tools": [{
"name": "get_balance",
"description": "Loyalty points of the caller and what they are worth.",
"input_schema": {
"type": "object",
"properties": { "phone": { "type": "string", "description": "Phone, if not the caller's" } }
},
"url": "https://loyalty.example.com/helpvox/tools/get_balance"
}],
"ui": { "settings_page": "https://loyalty.example.com/helpvox/settings" }
}Each tool has a description for the model — when to call it and what it returns — and an optional summary per language for the merchant, shown in the dashboard instead. Tool inputs are flat — string, number, integer or boolean, each with a description the model reads. Up to 5 tools per app and 10 app tools per company. A tool slower than 1.5 seconds must set "slow": true (and may take up to 8 seconds).
Scopes
Without customers:read, customer names, phones and addresses are removed from responses — not nulled, removed. A call without the needed scope returns 403 insufficient_scope with the missing scope. Apps can never manage the team or API keys.
| Scope | Grants | Personal data |
|---|---|---|
| catalog:read | Products, variants, categories and stock | |
| orders:read | Orders and their events, without customer details | |
| customers:read | Customer name, phone, email and address on orders and requests | yes |
| conversations:read | Calls and chats: duration, outcome, analysis — without the text | |
| transcripts:read | Full conversation transcripts | yes |
| requests:read | Callback requests and booked appointments | |
| knowledge:read | Knowledge base and company profile | |
| account:read | Settings: markets, hours, agents, shop connection | |
| orders:write | Change orders: status, shipment, discount, shipping price; create orders | |
| requests:write | Resolve callback requests and move appointments | |
| knowledge:write | Replace the knowledge base | |
| products:write | Create, update and delete products and prices | |
| profile:write | Change the company profile the agent answers from | |
| settings:write | Change settings | |
| availability:write | Busy times from an external calendar | |
| agent:tools | New tools the agent uses during conversations | |
| sms:send | Sends SMS to your customers — from your credits, at HelpVox rates | |
| agent:instructions | Changes how your agent talks: which general rules apply to your business |
Installation
Send merchants to https://www.helpvox.ai/apps/install/<slug> (optionally with redirect_url and state). After the owner approves, the browser comes back to your redirect URL with a one-time code (10 minutes). Exchange it on your server:
POST /api/oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code&code=hvic_…&client_id=hvapp_…&client_secret=hvs_…
→ { "access_token": "hva_…", "token_type": "bearer", "scope": "orders:read …",
"installation_id": "…", "vendor_id": "…" }The token does not expire; it stops working when the app is removed. Your tools reach the agent only after you call POST /api/v1/app/ready — call it when your own setup is done. GET /api/v1/app tells you the company, its currency and language, and the scopes granted.
Events
POST <webhooks.url>
HelpVox-Signature: t=1792000000,v1=5f2c…
HelpVox-Event: order.status_changed
HelpVox-Event-Id: evt_9Qk…
{ "id": "evt_9Qk…", "type": "order.status_changed", "created_at": "…",
"vendor_id": "…", "installation_id": "…",
"data": { "order_id": "…", "order_number": "1001", "status": "delivered",
"previous_status": "in_transit", "total_amount": "49.90", "currency": "EUR" } }Verify HelpVox-Signature — HMAC-SHA256 with your client secret over <t>.<raw body>, rejecting timestamps older than 5 minutes — and answer 2xx within 10 seconds. Failures are retried after 1, 5 and 15 minutes, then 1, 3, 6 and 12 hours; a subscription without a single success for 24 hours is switched off. The event id stays the same across retries. Events carry IDs and status, never customer details: fetch more through the API.
| Event | Needs | When |
|---|---|---|
| order.created | orders:read | A new order — from the agent, the API or the shop |
| order.status_changed | orders:read | New status, shipment or cancellation |
| order.updated | orders:read | Address, items, name or phone changed |
| conversation.ended | conversations:read | A call or chat ended |
| conversation.analyzed | conversations:read | The conversation analysis is ready |
| callback.requested | requests:read | A customer asked to be called back |
| appointment.booked | requests:read | An appointment was booked |
| appointment.changed | requests:read | An appointment was moved, confirmed or cancelled |
| product.updated | catalog:read | Catalogue or stock changed |
| customer.redact | customers:read | A customer asked to be deleted — delete what you hold |
| app.uninstalled | — | The app was removed |
Send yourself a sample with POST /api/v1/app/events/test or helpvox app trigger order.created; it arrives with data.test: true.
Agent tools
The agent never calls you directly: HelpVox validates the input against your schema, signs the request, waits up to your timeout and writes a log the merchant sees. The model sees the tool as loyalty_points__get_balance.
POST <tool.url>
{ "tool": "get_balance",
"input": { "phone": "+359888123456" },
"context": { "installation_id": "…", "vendor_id": "…", "channel": "phone",
"conversation_id": "conv_…", "language": "bg", "country": "BG",
"caller_phone": "+359…" } }
← { "result": "The customer has 1,240 points, worth 12.40 EUR." }
← { "error": "No loyalty account for this number." }Return plain text the agent can say, up to 2,000 characters. It reaches the model framed as data from your app — instructions inside it are ignored, so do not try to steer the agent from a result. On a timeout, an error or a malformed reply the agent carries on without the tool. caller_phone is present only with customers:read, on phone calls.
import { toolHandler, ToolError } from "@helpvox/sdk";
export const POST = toolHandler(process.env.HELPVOX_CLIENT_SECRET!, {
get_balance: async (input, ctx) => {
const phone = String(input.phone ?? ctx.caller_phone ?? "");
const points = await balance(ctx.installation_id, phone);
if (points === null) throw new ToolError("No loyalty account for this number.");
return `The customer has ${points} points.`;
},
});<?php
use HelpVox\Tool;
use HelpVox\Exception\ToolError;
Tool::handle(getenv('HELPVOX_CLIENT_SECRET'), function (array $input, $ctx): string {
$points = balance($ctx->installationId, $input['phone'] ?? $ctx->callerPhone);
if ($points === null) {
throw new ToolError('No loyalty account for this number.');
}
return "The customer has {$points} points.";
});from helpvox import handle_tool_call, ToolError
@app.post("/helpvox/tools/<name>")
def tool(name):
def handler(input, ctx):
points = balance(ctx.installation_id, input.get("phone") or ctx.caller_phone)
if points is None:
raise ToolError("No loyalty account for this number.")
return f"The customer has {points} points."
status, body = handle_tool_call(SECRET, request.get_data(), request.headers, handler)
return body, statusDiscounts on the agent's order
With orders:write an app can attach a discount to the order the agent is about to place in the current conversation — this is how loyalty points are spent. Call it from your tool, before the agent creates the order; the total the agent reads out and the order sent to the shop already include it.
POST /api/v1/discounts
{ "conversation_id": "conv_…", "amount": 12.00, "currency": "EUR", "label": "Loyalty points" }
→ 201 { "id": "…", "status": "pending", "expires_at": "…" }It becomes applied (with order_id) when the order is created, or expired after an hour. GET /api/v1/discounts/{id} shows the state; DELETE cancels a pending one. Shops connected through WooCommerce or Shopify receive the discount; check capabilities.order_discounts in GET /api/v1/app.
Shipping price on the agent's order
A courier or shipping-calculator app sets the shipping price for the order the agent is about to place, also with orders:write. Your tool works out the price (office or address, weight, courier), returns it to the agent to say, and records it here. The order then carries your price and courier instead of the market's average shipping and free-shipping threshold.
POST /api/v1/shipping-quotes
{ "conversation_id": "conv_…", "amount": 5.90, "currency": "EUR",
"label": "Speedy to an office", "courier": "speedy", "courier_service": "office" }
→ 201 { "id": "…", "status": "pending", "expires_at": "…" }One quote per conversation: a new one replaces the previous (status replaced). It becomes applied with the order, or expired after an hour; DELETE cancels it. Send 0 for free shipping.
Fees and payment
Two more things your tool can set for the order the agent is about to place, the same way. Extra fees (gift wrapping, insurance) are added to the total and reach the shop as their own lines. A payment request replaces cash on delivery with card, bank transfer or online payment: the courier then collects nothing and the agent gives the customer your payment link.
POST /api/v1/fees
{ "conversation_id": "conv_…", "amount": 2.50, "currency": "EUR", "label": "Gift wrapping" }
POST /api/v1/payment-requests
{ "conversation_id": "conv_…", "method": "card", "label": "Card payment by link",
"payment_url": "https://pay…" }Don't know the amount before the order exists? Leave out payment_url, read the total from order.created, and set the link later with PATCH /api/v1/orders/{id}. Mark it paid with payment_status: "collected".
Changing an order afterwards
Besides the status, tracking number and courier, PATCH /api/v1/orders/{id} takes a tracking_url and an estimated_delivery_at (the agent tells customers both), a corrected shipping_amount (the total moves with it), a payment_url, and an internal_note for the merchant's team that the agent never reads. Every change except the status sends order.updated.
Hooks: take part before it happens
Events tell you what happened. Hooks let HelpVox ask your app and wait for a short answer, signed like a tool call. If you don't answer in time, the conversation goes on without you.
| Hook | When | You answer |
|---|---|---|
order_check | Right before the agent places an order (up to 1.5 s) | { "allow": false, "reason": "…" } stops it; the agent tells the customer why |
call_context | When a call starts (up to 0.8 s) | { "context": "Regular customer, 320 points" } — the agent knows it from the first word |
"hooks": {
"order_check": { "url": "https://…/order-check", "timeout_ms": 1000 },
"call_context": { "url": "https://…/context", "timeout_ms": 600 }
}Knowledge and busy times
Knowledge entries your app adds with POST /api/v1/knowledge are yours: PUT replaces only them, and they go when the app is uninstalled. A calendar app sends the busy times it sees with PUT /api/v1/busy-times (scope availability:write), and the agent stops booking into them.
Your page in the dashboard
With ui.settings_page set, the installed app's screen embeds your page as ?installation_id=…&session=<JWT>. The JWT is HS256 with your client secret, has aud = your client id and lives 60 seconds: verify it and start your own session (a cookie with SameSite=None; Secure — the page is in an iframe). After your setup calls POST /api/v1/app/ready, send parent.postMessage({ type: "helpvox:ready" }, "https://www.helpvox.ai") and the dashboard shows the app as active at once.
Two more things the frame understands. Post { type: "helpvox:height", height } whenever your page grows or shrinks (on load and from a ResizeObserver on body) and the dashboard sizes the frame to it, so your page has no scrollbar of its own; without it the frame stays a fixed 720 px and the merchant gets a box to scroll inside. And the URL carries theme=dark — the dashboard is dark, so a page that ignores it shows as a white sheet in the middle of it.
The UI kit
Your page sits in a frame in the middle of our dashboard, so it is worth looking like it belongs there. Two files give you that for one line each: https://www.helpvox.ai/apps/ui.css and /apps/ui.js. Everything is optional — take the parts you want, or none.
The script does the three things every page in a frame has to do anyway: it reads ?theme= and sets the colours, it reports the height so the frame grows with your content, and it runs the tabs. It also gives you helpvox.ready() for after POST /api/v1/app/ready. No build step, no dependencies.
Tabs are plain markup: a <button data-hv-tab="x"> for each section and a <section data-hv-panel="x"> to go with it. Mark the ones that start closed with hidden, and the open one with data-hv-active on the nav. The chosen tab goes into the URL hash, so it survives a form post. Settings a merchant touches once and a list they read every day do not belong on the same screen.
<!doctype html><html lang="en">
<head>
<link rel="stylesheet" href="https://www.helpvox.ai/apps/ui.css">
<script defer src="https://www.helpvox.ai/apps/ui.js"></script>
</head>
<body class="hv-page">
<h1 class="hv-title">Loyalty points</h1>
<p class="hv-lead">What the merchant gets from this app.</p>
<nav class="hv-tabs" data-hv-tabs data-hv-active="settings">
<button data-hv-tab="settings">Settings</button>
<button data-hv-tab="customers">Customers<span class="hv-count">42</span></button>
</nav>
<section data-hv-panel="settings">
<div class="hv-field">
<label for="rate">Points per 1 EUR</label>
<input id="rate" name="rate" value="1">
<p class="hv-hint">On goods, without shipping.</p>
</div>
<button class="hv-btn">Save</button>
</section>
<section data-hv-panel="customers" hidden>
<table class="hv-table"><tbody><tr><td>+359…</td><td class="hv-num">4551</td></tr></tbody></table>
</section>
</body></html>The classes: hv-page, hv-title, hv-lead, hv-h2 for the frame of the page; hv-tabs with hv-count; hv-field with a label, an input and an hv-hint; hv-btn and hv-btn--ghost; hv-card; hv-note as --ok, --bad or --todo; hv-stats; hv-table with hv-num for figures; hv-empty for an empty list; hv-row and hv-row--grow for a line of controls. Colours come from CSS variables (--hv-accent and the rest), so one declaration re-skins the lot.
Customer card
With ui.customer_card (needs customers:read) your app shows a small card when the merchant opens a customer in Clients or an order — loyalty points, a CRM status, open tickets. HelpVox sends a signed { kind: "customer", phone, context } and draws what you return: { title, rows: [{ label, value }] (up to 8), link }. Only data, no HTML; you have 2.5 seconds, otherwise the card is simply left out.
Testing
Every developer account can create a test company in the portal (Developers → Test company). It is a real HelpVox company with a sample catalogue, but with no agent, phone number or shop, and nothing in it reaches a real customer.
- Install your own apps there. They follow your newest version at once, drafts included, without review or approval.
- Make test orders and move them through their statuses. Your app gets the real
order.createdandorder.status_changed, and reads the order through the API like any other. - Call each agent tool by hand. You see the signed request, your raw response and its time against the limit (and against the 1.5-second phone limit), and the text the agent would get.
- Send sample events and read the log of every delivery with its HTTP code.
Working locally? Expose your server with a tunnel (cloudflared tunnel --url http://localhost:3000 or ngrok http 3000), run helpvox app dev --url https://… to register a private -dev twin pointing at it, and install that twin in the test company.
Publishing
| Who can install | Review |
|---|---|
| Private — only your company | None; versions go live at once |
| Unlisted — anyone with the install link | Automatic checks only |
| Public — the app store | By HelpVox, within 72 hours, for every version with new permissions or tools |
Public apps need https everywhere, a privacy policy, a support email, a description, and subscriptions to app.uninstalled and — with personal-data scopes — customer.redact. The review also checks that scopes match what the app does and that tool descriptions describe instead of instruct. A new version that asks for more waits for each merchant's approval; the old version keeps running meanwhile.
SDKs and reference
- TypeScript / Node:
npm install @helpvox/sdk - PHP 8.1+, no dependencies:
composer require helpvox/sdk - Python 3.9+, no dependencies:
pip install helpvox - CLI:
npx @helpvox/cli - OpenAPI 3.1 for any other language: /api/v1/openapi.json