REST API reference
For partners and AI agents: create, preview and update ChatSites in code.
Authentication
Send your key as a Bearer token. Keys have scopes and are stored hashed. Webtec issues them on request.
Authorization: Bearer $CHATSITE_KEYPOST /api/v1/provision
Create a branded ChatSite in one call: account, AI-written funnel, optional site crawl, embed code.
{
"business": { "name": "Carter Roofing", "domain": "carterroofing.com",
"industry": "roofing", "business_description": "...",
"target_audience": "...", "conversion_goal": "quote requests" },
"branding": { "logo_url": "...", "primary_color": "#00142a", "secondary_color": "...",
"font_family": "Inter", "cta_color": "...", "cta_text_color": "...",
"chat_border_radius": 24, "chat_font_size": 15,
"header_style": "...", "bubble_style": "...", "theme": "dark" },
"flow": { "prompt": "Qualify roofing leads", "name": "...",
"cta_url": "https://...", "cta_label": "Get a quote" },
"idempotency_key": "carter-roofing-v1",
"auto_crawl": true
}Only business.name is required. Send flow.structure instead of flow.prompt to supply your own funnel.
Provision response
{
"created": true,
"client_id": "…", "flow_id": "…",
"embed_url": "…",
"embed_iframe": "<iframe …>",
"embed_script": "<div …></div><script>…</script>",
"embed_floating": "<script>…</script>",
"dashboard_url": "…"
}Idempotency
Send the same idempotency_key again and you get the same ChatSite back, never a second one.
POST /api/v1/generate-flow
Draft and validate a funnel from a brief, without saving anything. Body: prompt (required), client_name, industry, conversion_goal, cta_url, cta_label. Returns the structure and whether it is valid.
GET and PATCH /api/v1/clients/:id
GET returns config, the active flow, the embed and lifetime counts. PATCH updates branding, or regenerates or replaces the active flow.
Errors
- 400: invalid JSON or business.name missing.
- 401: missing or wrong key.
- 429: too many requests; wait and retry.
- 500: our side; retry with the same idempotency key.
MCP
An MCP server is in build: the same actions from AI assistants and agents.