◆ Sapport for developers API reference Error catalog OpenAPI
Sections

#Introduction

Status: Available / Planned. This page describes the platform as a whole. The status of each module is shown in the tables below. The server API authenticated by a secret key is Planned; the widget, the loader, the JS tracker, the CMS modules, and the connector are Available.

This page explains what the Sapport platform is from an integrator's point of view: which modules exist, which kinds of API there are, how everything fits together, and where to start reading.

#Who this documentation is for

The documentation does not describe the platform's internals or the staff dashboard. It describes what you can call, embed, and retrieve.

#Core concepts

ConceptWhat it is
TenantYour organization on the platform. All data, keys, and money are tied to the tenant.
CellAn independent production copy of the platform with its own database, its own secrets, and its own legal entity. There are three cells: RU, EN, ID. See Cells and data.
IntegrationA tenant service account for programmatic access. No dashboard login. Owns keys.
API keyA secret string sap_<cell>_<mode>_<identifier>_<secret>. See Authentication.
ScopeA permission that a key receives when it is issued, for example leads:read.

For the full vocabulary, see the Glossary.

#Platform modules

ModuleWhat it does for the integratorServer APIClient side
Chats and the AI sellerReceives visitor inquiries, replies on behalf of the AI seller, hands a conversation over to an operator. The tenant's own channel is connected through the API.Conversations (reading): Available; writing: PlannedWidget and Chat API: Available
AnalyticsCollects visits, sources, behavior, goals, and conversions; computes the funnel and visibility in search and AI answers.Reading: Available; event ingestion: PlannedLoader, JS tracker, modules: Available
Article publisherGenerates articles from the editorial profile, gets them approved, and publishes them to the tenant's site.Reading: Available; generation and writing: PlannedBitrix and WordPress modules, connector: Available
CRM and agentsStores leads and contacts, scores leads, runs sales agents. Works as our CRM, as a projection of your external CRM, or in a mixed mode.Reading: Available; writing: Plannedn/a
StrategistThe AI marketer: regular reports with evidence, a topic queue, chat actions, conversation.Plannedn/a
DashboardsReady-made "Overview" and "Pulse" views with an honest freshness date for each source.Reading: AvailableDashboard embedding is stage 4, Planned

This document records the current state and the intent, not a calendar.

#Two kinds of API

The platform offers two fundamentally different ways to interact with it. Do not confuse them: they have different trust levels.

#Server API (secret key)

#Client interfaces (from the browser and from pages)

InterfacePurposeTrustStatus
Chat widget (/widget.js)A ready-made chat window on your sitePublic channel identifier; the session is a signed tokenAvailable
Chat API (/api/widget/*)Your own chat interface ("headless")Public channel_id and a session token; there is no secret key and there must not be oneAvailable
Loader (/api/v1/connector/loader.js?k=…)One line: tracker, behavior, chat, consentPublic loader keyAvailable
JS tracker (/api/v1/track/js?t=…)Minimal page-load trackingTracker tokenAvailable
Server beacon of the modulesSigned submission of visits from the CMS server (sees bots and AI crawlers)Signed requestAvailable

Security rule. The server API secret key never ends up in a browser, a mobile app, a repository, or logs. Anything that runs in the browser uses only the client interfaces.

#How everything fits together

                         Your side                                      Sapport platform (cell: RU / EN / ID)
 ┌────────────────────────────────────────────┐                     ┌─────────────────────────────────────────────────┐
 │  Visitor                                   │                     │                                                 │
 │   │                                        │                     │   ┌──────────────┐    ┌───────────────────┐     │
 │   ▼                                        │  widget / Chat API  │   │ Chats        │◄──►│ AI seller         │     │
 │  Your site ── <script widget.js> ──────────┼────────────────────►│   │ (conversa-   │    │ (paid, wallet)    │     │
 │   │        └ <script loader.js> ───────────┼──── events, UTM ───►│   │  tions)      │    │                   │     │
 │   │                                        │                     │   └──────┬───────┘    └─────────┬─────────┘     │
 │   ▼                                        │  signed beacon      │          │ leads                │               │
 │  CMS module (Bitrix / WP / …) ─────────────┼────────────────────►│          ▼                      ▼               │
 │   ▲   article publishing ◄─────────────────┼─────── jobs ────────│   ┌──────────────┐    ┌───────────────────┐     │
 │   │                                        │                     │   │ CRM & agents │    │ Analytics         │     │
 │                                            │                     │   └──────┬───────┘    └─────────┬─────────┘     │
 │  Your servers                              │   Bearer key, TLS   │          │                      │               │
 │  (CRM, BI, own channel, messenger) ◄──────►┼◄───────────────────►│   ┌──────▼──────────────────────▼─────────┐     │
 │   ▲                                        │                     │   │ Server API  /api/public/v1            │     │
 │   │ webhooks (signature, retries)          │                     │   │ scopes · idempotency · limits         │     │
 │   └────────────────────────────────────────┼◄────────────────────│   └──────┬──────────────────────┬─────────┘     │
 └────────────────────────────────────────────┘     events           │          ▼                      ▼               │
                                                                     │   ┌──────────────┐    ┌───────────────────┐     │
                                                                     │   │ Strategist   │    │ Dashboards        │     │
                                                                     │   │ (reports)    │    │ ("Overview",      │     │
                                                                     │   │              │    │  "Pulse")         │     │
                                                                     │   └──────────────┘    └───────────────────┘     │
                                                                     └─────────────────────────────────────────────────┘

How to read the diagram:

  1. A visitor lands on your site. The loader and the CMS module pass the referral source, UTM, behavior, and (at your option) a signed server beacon to the platform.
  2. The widget opens a conversation. The AI seller replies, creates a lead when needed, and calls an operator.
  3. Leads, conversations, and analytics flow into the CRM, analytics, and strategist modules.
  4. Your servers retrieve and manage data through the server API and learn about changes from webhooks.
  5. Articles prepared by the platform go to your site through the connector (signed jobs), or you pick them up yourself on the article.ready event.

#Principles behind the API

#Where to start

TaskWhere to go
Put a chat on your site in five minutesQuickstart, then Embedding the widget
Get a first response from the server APIQuickstart
Understand keys, scopes, and permissionsAuthentication
Choose an address and understand data boundariesCells and data
Handle errors, pagination, retriesConventions
Receive eventsWebhooks
Connect an external CRMCRM modes

For the full table of contents, see the README.

#Notes