◆ Sapport for developers API reference Error catalog OpenAPI
Sections

#AI Seller Chat: Overview

Status: Available / Planned. The one-line widget and the client Chat API are Available. The server conversations API: reading is Available, writing is Planned. The widget JS API and widget v2 parameters are Planned. The status of each approach is given in the tables below.

Purpose: to explain what the AI seller chat can do, the three ways to embed it in your site, app, or messenger, and how to choose between them.

#Contents

  1. What the chat does
  2. Three ways to embed
  3. How to choose
  4. Data flow diagrams
  5. Cell addresses
  6. Money and limits
  7. Personal data and consent
  8. Where to read next
  9. Open questions

#What the chat does

The AI seller is a conversation partner on your site (or in your channel) that leads a visitor from a question to a lead.

CapabilityHow it worksStatus
Answers from the tenant's knowledge baseThe answer is built from the materials you uploaded to your tenant's knowledge base and from the agent settingsAvailable
Knows which page the visitor is onThe widget passes the page address, title, and type; the model receives them in the prompt as browser data, not as instructions (Page, source, and UTM)Available
Hands the conversation to an operatorAn operator in the dashboard takes the conversation; while they handle it, the AI does not reply. The daily limit on AI replies also hands the conversation to an operator. In your own channel, the handoff request arrives as the conversation.handoff_requested eventAvailable (in your own channel, Planned)
Creates a lead with attributionWhen the conversation gathers enough information, the platform creates a contact and a lead; the lead keeps the visit sourceAvailable
Accepts filesImages and documents up to 10 MBAvailable (with a limitation: client Chat API)
Works in your own channel (messenger, app, CRM)Server API: you pass the customer's messages, the AI reply arrives asynchronously (202 and the conversation.ai_reply operation, or the message.created webhook), and operator messages arrive by webhookPlanned

What the chat does not do: it does not show other visitors' conversations to anyone, does not follow instructions hidden in a page title or address, and does not promise a reply once the daily AI limit is exhausted (in that case the conversation goes to an operator).

#Three ways to embed

Way 1. WidgetWay 2. Your own interfaceWay 3. Your own channel
In shortOne <script> line on the page: the button and chat window are readyYou draw the chat yourself and call the client Chat API from the browser or appYour server calls the server API: the customer talks in your messenger, and the AI and operator reply through the platform
StatusAvailableAvailable (with a CORS limitation, see below)Planned
What you needA web_chat channel ID and your site's domain on the tenant's listA web_chat channel IDAn API key (permissions conversations:*, ai_seller:invoke) and an api channel created in the dashboard together with the integration; GET /me returns the channel ID
Keys and secretsNot needed. channel_id is publicNot needed. channel_id is public; the server issues the session tokenA secret key on your server only
Who draws the interfaceThe platformYouYou (the messenger)
BillingFrom the tenant's wallet, per AI replySameSame, with reservation, spending caps, and the api channel's daily limit, as for the widget
PageEmbedding the widgetClient Chat APIServer conversations API, guide

In addition to way 1, a widget JS API is planned (Sapport.open(), Sapport.on(), identify, and others): see the widget JS API, status Planned.

Important for way 2. The client Chat API routes (messages, history, poll, events, upload) do not return CORS headers. From a browser they are reachable from pages opened on the cell's own domain, while from a third-party domain the browser will block reading the response. Working options are in the "Known limitations" section of the client API page.

#How to choose

Your situationChoice
You need a chat on your site, the design is not critical, and color, greeting, and position are enoughWay 1 (widget)
Your site runs on Bitrix or WordPressThe connector module installs the loader, and the loader attaches the widget (Loader)
You need your own chat design in an app or on a cell pageWay 2 (client Chat API)
You need the chat in your messenger, in another system's widget, or as an end-to-end channel with your own CRMWay 3 (server API; still a design)
You need to open the chat from your own "Ask a question" buttonToday: your own script cannot open the widget window (there is no JS API); see the interim options. After the JS API ships: Sapport.open()

#Data flow diagrams

#Way 1. Widget

 Host site page                               Sapport cell
 ┌──────────────────────────┐
 │ <script src=…/widget.js  │   POST /api/widget/init (CORS *)
 │   data-channel=…>        │ ───────────────────────────────►  name, color, greeting,
 │                          │ ◄───────────────────────────────  pre-chat form, consent
 │  [60 px button]          │
 │      │ click             │
 │      ▼                   │   iframe: /widget/<channel_id>?page=…&title=…&ft=…
 │  ┌─────────────────┐     │ ───────────────────────────────►  chat page (our domain)
 │  │ iframe 380×560  │     │
 │  │  (our domain)   │ ─── POST /api/widget/messages ───────►  AI seller
 │  │                 │ ◄── reply, session_token ────────────   │  ├─ knowledge base
 │  │                 │ ◄── SSE /events (or /poll) ──────────   │  ├─ contact, lead, attribution
 │  └─────────────────┘     │                                    │  └─ operator in the dashboard
 │   ▲ postMessage          │
 │   └ sapport:new-message  │
 │     sapport:close        │
 └──────────────────────────┘

#Way 2. Your own interface

 Your interface (a page on the cell domain or your proxy)    Sapport cell
 ┌──────────────────────┐   POST /api/widget/init            ┌─────────────────┐
 │ input, message list, │ ──────────────────────────────────►│ web_chat channel│
 │ typing indicator     │   POST /api/widget/messages        │ AI seller       │
 │                      │ ──────────────────────────────────►│ operator        │
 │ stores session_token │ ◄── response + session_token       │                 │
 │                      │   GET /history /poll /events       │                 │
 │                      │ ◄──────────────────────────────────│                 │
 └──────────────────────┘                                    └─────────────────┘

#Way 3. Your own channel (Planned)

 Customer ──► your messenger ──► your server                   Sapport cell
                                  │  POST /conversations          ┌────────────────────┐
                                  │  POST …/messages              │ "api" channel      │
                                  │  (Idempotency-Key, Bearer)    │ AI seller          │
                                  │ ─────────────────────────────►│ operator           │
                                  │ ◄── 202 + operation ──────────│ tenant wallet      │
                                  │     (GET /operations/{id})    │                    │
                                  │ ◄── message.created webhook ──│ outbox → delivery  │
                                  │     (AI reply, operator reply)└────────────────────┘
 Customer ◄── your messenger ◄────┘

#Cell addresses

There are three independent cells. Channels, keys, and data belong to one cell; use the address of the cell where your tenant is registered (Cells and data).

CellBase URL
RUhttps://formula-cream.pro
ENhttps://wfacademy.org
IDhttps://wfacademy.id

Widget script: https://<cell domain>/widget.js. Client Chat API: https://<cell domain>/api/widget/…. Server API: https://<cell domain>/api/public/v1.

#Money and limits

Detailed tables are on the client Chat API page.

TaskPage
Install the widget, configure its look, copy a ready-made blockEmbedding the widget
Control the widget from page code (open it, send a message, subscribe to events)Widget JS API (Planned)
Understand where a lead came from and which page the customer was onPage, source, and UTM
Build your own chat interfaceClient Chat API
Manage conversations from a serverServer conversations API (reading: Available, writing: Planned)
Connect your own messengerAI seller in your own channel (Planned)
Handle errors, retries, and limitsConventions
Receive events instead of pollingWebhooks

Ready-to-copy files are in the examples/ directory.

#Open questions