Install it, add your AI keys, sell it
Askmark is an AI chat assistant for websites that you run as your own software business. A business signs up, adds its website, files and questions, and puts one line of code on its site. Its assistant then answers visitors from that knowledge with links to the sources, says so when it does not know, takes the visitor's details, books calls and hands the chat to the team's live inbox. You sell plans and run everything from the platform admin.
This guide is written for first-time installers. Every command is shown in full, every setting says where to find it, and the Costs chapter shows what each reply costs before you set your prices.
Get started
1Welcome
Thank you for choosing Askmark. This guide takes you from the download to a running AI chat assistant business, with your first assistant answering on a website and your first plan for sale.
What it is and who it is for
Visitors ask a website the same questions every day: "Do you install in my area?", "How long does a battery last?", "Can I book a survey?". Askmark answers them from the business's own pages and documents, shows where each answer comes from, and passes the chat to a person when that is better.
- You, the buyer of this item, install Askmark on your own server, give it your AI provider keys and sell plans. You are the platform owner (the super-admin).
- Your customers are businesses. Each one gets a workspace with its own team, knowledge, assistants, chats, leads and bookings, kept apart from every other workspace. One person can belong to several workspaces and switch between them.
- In a workspace, the team builds the knowledge: sources (a website Askmark reads, uploaded files, or questions and answers typed in) hold documents, and every document is split into chunks that search can find.
- An assistant is one chat assistant with its name, picture, colour, greeting, tone, rules, languages and handover rules. Its widget is the chat button a website shows after one
<script>line. - Every visitor conversation is a chat. The assistant answers while the chat is with it; when the visitor asks for a person, the chat waits in the team's inbox until an agent takes it.
- One assistant reply is one message credit. Each plan has a number of replies a month, and that is how you keep AI costs known.
The assistant answers only from the workspace's own knowledge and cites it. When the knowledge has no answer, it says so and offers a person, instead of guessing. It does not browse the internet, it cannot see the visitor's screen, and like every AI it can still misread a source: the inbox, the ratings and the unanswered questions show what it said, so the team can check and add better answers.
What you get
- The workspace for your customers: an overview of today's chats, leads and bookings; a live inbox with take over, reply, internal notes, assign, hand back and close; knowledge from websites (sitemap first, depth and page limits, robots.txt, include and exclude paths, re-crawl daily or weekly), files (PDF, Word, text, Markdown) and Q&A pairs, with a page to test what search finds; assistants with their behaviour, widget look, lead form and booking rules; leads with owners, notes and CSV export; bookings on built-in calendars, Google Calendar or Cal.com; analytics with the questions asked and the ones nobody answered; settings for the team, AI keys, plan and billing and notices; and a Developers area with API keys, webhooks and the MCP server.
- The website widget: one script tag, plain TypeScript inside a Shadow DOM (the host page's styles cannot break it, and it cannot break them), about 30 KB gzipped, keyboard and screen-reader friendly, full screen on phones, light or dark, right to left for Arabic, with a small JavaScript API.
- The platform admin for you: revenue, workspaces, messages and AI cost this month; workspaces (change plan, suspend, close, open as owner); plans; payments; AI providers and the price table; email and brand; languages; a setup check that tests every outside service live; background jobs.
- Five kinds of AI provider behind one interface, with your own keys: OpenAI, Anthropic (Claude), Google Gemini, OpenRouter and any OpenAI-compatible endpoint. Workspaces whose plan allows it bring their own keys.
- Four payment gateways behind one interface: Stripe, PayPal, Razorpay and Paystack.
- An install wizard, three sample plans, an editable AI price table and a public demo mode, so the platform is ready the first time it opens.
- One-command self-hosting with Docker: the app (one compiled Rust program that also serves the web app and the widget), PostgreSQL with pgvector, MinIO file storage and optional automatic HTTPS with Caddy.
What is in the download
| Path | What it is |
|---|---|
apps/backend/ | The server, written in Rust (Axum): the /api/v1 API, the widget's API, the payment webhooks, the crawler, the background jobs and the built web app, compiled into one program called askmark. |
apps/frontend/ | The web app: React 19, React Router 7, Vite, Tailwind CSS 4 and shadcn/ui components. Every screen your customers and you see. |
apps/widget/ | The website chat widget in plain TypeScript, built into one file served at /widget.js. |
crates/engines/ | The AI provider clients, the demo's stand-in, the text tools (web pages, PDF, Word, Markdown, chunks, language, robots.txt, sitemaps) and the price table. |
migrations/ | The PostgreSQL database schema. The server applies it by itself when it starts. |
docker/, compose.yaml | The Dockerfile, the Docker Compose stack and the Caddy HTTPS config. |
.env.example | Every setting, explained. Copy it to .env. |
docs/ | This documentation as one HTML file and as a PDF, plus the list of third-party licences. |
README.md, CHANGELOG.md, LICENSE.txt | A one-page overview, the version history and the licence notes. |
AI disclosure
AI tools used to create this item: Yes
- Source code: Yes. Written with Claude by Anthropic as an AI coding assistant, then reviewed, tested (server tests against a real PostgreSQL with pgvector, engine tests against recorded provider replies, widget and browser tests) and integrated by us.
- Documentation: Yes. Drafted with Claude by Anthropic and checked against the code and the running app.
- Graphics: No. No image was made with an AI image generator. The logo and the demo assistant's sun picture are simple SVGs drawn in code, and every screenshot in this guide is a capture of the running app.
- Demo text: Yes. The demo business (Sunmere Solar, a solar installer), its knowledge pages, files and Q&A, its sample chats and the stored sample answers the public demo shows were written with Claude by Anthropic and edited by us. Every demo reply is labelled "Demo sample" in the widget.
AI-powered features: Yes
- Assistant replies: each reply is written by OpenAI, Anthropic (Claude), Google Gemini, OpenRouter or an OpenAI-compatible endpoint, with your own API keys (or a workspace's own keys, on plans that allow them), from the workspace's own knowledge only.
- Knowledge search: pages, files and questions are turned into embeddings by OpenAI, Gemini, OpenRouter or a compatible endpoint, with the same keys. Without an embedding key, search uses PostgreSQL full-text search only.
- Each provider bills you directly for every reply and every embedded page; the chapter Costs gives the list prices and a worked example per plan, and each plan's replies a month keep that spend known.
- Review the output. AI replies can be wrong, incomplete or out of date even when they cite a source. Askmark keeps the reply to the workspace's knowledge, removes source marks and links that are not in it, and answers "I don't know" when nothing relevant is found, but the business stays responsible for what its assistant says: check the inbox, the ratings and the unanswered questions, and test answers before going live.
Askmark is not affiliated with, endorsed by or sponsored by OpenAI, Anthropic, Google or OpenRouter. ChatGPT, Claude, Gemini, Google Calendar, OpenRouter, Stripe, PayPal, Razorpay, Paystack, Cal.com, WordPress, Shopify, Webflow and Wix are trademarks of their owners. Askmark works with your own accounts at these services.
Screenshots
The main screens of the workspace, the widget, the platform admin and the phone layout. Every chapter in parts 03 and 04 has more.
2Requirements
To run it (recommended: Docker)
- A 64-bit Linux server (Intel/AMD or ARM) with Docker Engine 24 or newer and Docker Compose 2.20 or newer (the stack uses Compose's
includefeature). Docker Desktop on macOS or Windows works for trying it on your own computer. - For the first build Docker compiles the Rust server and builds the web app and the widget from source, which needs more memory than running it: plan 2 processor cores and 4 GB of memory (or 2 GB plus swap) and at least 6 GB of free disk for Docker's build cache.
docker builder prunegives the cache's space back once the app runs. You can also build on another computer and run the result on a smaller server (chapter 24). - To run it the server needs far less: the app is one small program. PostgreSQL and MinIO run beside it, so plan at least 1 GB of memory for a small platform, and more for PostgreSQL as the knowledge of your customers grows (chapter 24).
- PostgreSQL with pgvector: the Docker stack ships PostgreSQL 17 with the pgvector extension (the
pgvector/pgvector:pg17image). Without Docker, or with a managed database: PostgreSQL 15 or newer with thevectorextension (pgvector 0.5 or newer) andbtree_gist(chapter 25). - A domain name and HTTPS for a public launch. Websites on https can only load the widget from an https address, the payment gateways send their webhooks only to https, and Google Calendar's sign-in returns only to https. The bundled Caddy gets a free certificate for you.
- Outgoing HTTPS from the server to the AI providers (api.openai.com, api.anthropic.com, generativelanguage.googleapis.com, openrouter.ai or your own endpoint), the payment gateways you use, Google and Cal.com if your customers connect calendars, your email provider, and your customers' websites (the crawler reads them).
- Browsers: a current version of Chrome, Edge, Firefox or Safari, for you, your customers and their visitors, on a computer or a phone.
To build or change it without Docker
- Rust 1.90 or newer (stable) from rustup.rs.
- Node.js 24 and pnpm 11 (
corepack enableinstalls the pnpm version each app asks for). - PostgreSQL 15 or newer with pgvector and btree_gist.
- Optional: any S3-compatible storage (MinIO, AWS S3, Cloudflare R2, Backblaze B2…). Without it, files are kept in a local folder.
Accounts you need
| Account | What it is for | Needed |
|---|---|---|
| At least one AI provider: OpenAI, Anthropic, Google AI Studio (Gemini), OpenRouter, or an OpenAI-compatible endpoint | The assistants' replies and, except with Anthropic, the knowledge embeddings. Each provider bills you per use (chapter 7). | For replies. Without any key, assistants say they are not set up yet and offer a person. |
| A payment gateway: Stripe, PayPal, Razorpay or Paystack | Selling plans to your customers. | To charge customers |
| An SMTP email provider | Password resets, invites, new-chat and waiting notices, replies to visitors who left, transcripts, lead notices. Without it, each email is written to the app's log. | For a public launch |
| A Google Cloud project with an OAuth client | Lets your customers connect Google Calendar to their booking calendars. | Optional |
| S3-compatible storage | Knowledge files, pictures and logos. The bundled MinIO does this on the same server. | Optional |
3Install with Docker
This runs Askmark on your own computer or on a server. The first build compiles the server from source, so it takes longer than later starts.
- Unzip the download and open a terminal in the
askmark/folder (the one withcompose.yamlin it). - Create your settings file:
cp .env.example .env - Open
.envin any text editor and fill in these values:
Change both passwords: the example values are public. KeepAPP_URL=http://localhost:8080 # your public https:// address on a server APP_SECRET=paste-a-random-string-here # make one with: openssl rand -hex 32 POSTGRES_PASSWORD=pick-a-long-password # letters and digits only S3_SECRET_ACCESS_KEY=pick-another-password # at least 8 charactersAPP_SECRETsafe and never change it after the install, because it seals the AI provider keys and the other secrets you save. LeaveDATABASE_URLempty: Docker builds the database address from the values above. The AI provider keys can wait; the install wizard asks for one. - Build and start everything, in one command:
Docker builds the app (the web app, the widget, then the Rust server), starts PostgreSQL with pgvector and MinIO (file storage), creates the storage bucket and starts the app, which adds the database extensions and applies the migrations by itself. Later builds reuse Docker's cache and are much quicker.docker compose up -d --build - Find the install token in the app's log (if the app has restarted, use the last one):
The line readsdocker compose logs app | grep -i "install token"Install token: am-install-… (open /install and paste it). - Open http://localhost:8080. The install wizard opens: paste the token, check the database, create your platform account and add an AI key.
See what the app is doing with docker compose logs -f app. Stop it with docker compose down; your data stays in Docker volumes. Use another port by setting APP_PORT=8090 in .env and running docker compose up -d. The app port is open on this computer only (APP_BIND=127.0.0.1); on a server, visitors come in through HTTPS, as chapter 24 shows.
If the build stops with "signal: 9" or "killed", the server ran out of memory while compiling. Add swap (for example 4 GB) and run the same command again, or build on a bigger computer and copy the result (chapter 24, Build on another computer).
Install without Docker
You need Rust, Node.js 24 with pnpm and a PostgreSQL with pgvector and btree_gist (chapter 2). In the askmark/ folder:
# 1. the web app and the widget
cd apps/frontend && corepack enable && pnpm install && pnpm build && cd ../..
cd apps/widget && pnpm install && pnpm build && cd ../..
cp apps/widget/dist/widget.js apps/frontend/dist/client/widget.js
# 2. the server, packed with the web app into one program
cargo build --release -p askmark-server
./target/release/askmark pack apps/frontend/dist/client ./askmark
# 3. the database: as a PostgreSQL superuser, once
# create extension if not exists vector; create extension if not exists btree_gist;
# 4. settings in .env next to where you start it: APP_URL, APP_SECRET, DATABASE_URL,
# and STORAGE_DRIVER=local (or your S3 bucket)
BIND=127.0.0.1:8080 ./askmark serve
The server adds the extensions itself when its database login may (step 3 is for a login that may not), applies the migrations when it starts and prints the install token. Run it behind your own HTTPS proxy and keep it running with a service manager such as systemd (chapter 24).
4Install wizard
The first visit to a new install opens the wizard at /install; every other page sends you there until it is finished, and nobody can sign up before. It runs once; afterwards the page is locked. It has three steps.
- Database and admin. Paste the install token from the app's log. The app prints it at every start until the install is finished, and a restart makes a new one, so use the last line. Lost it? Set
INSTALL_TOKENin.envto a value of your choice and rundocker compose up -d. The wizard then shows the database: the PostgreSQL version, pgvector ready (knowledge search), btree_gist ready (it stops double bookings) and the migrations still to run. Below it come the site address (fromAPP_URL; it must be https on a public server, because the widget loads from it) and your platform account: your name, email and password (at least 10 characters). This is the super-admin account you run the platform with. - AI key and email. One AI provider key for every workspace (chapter 6): the provider, the key and, for an OpenAI-compatible endpoint, its base address. The wizard tests it and shows the answer model and the embedding model it found. Then your mail server, port, user, password and sender, with a test email (chapter 19). Both can be skipped: without a key, assistants say they are not set up yet and offer a person; without email, emails go to the app's log.
- Done. A summary of what is set up and what is not yet, with buttons to create your first workspace or open the platform admin. The three sample plans are added (chapter 15). Payment gateways are added afterwards in Platform admin → Payments (chapter 16).
When the database has no pgvector
Askmark needs two PostgreSQL extensions: vector (pgvector) for knowledge search and btree_gist for the rule that stops two bookings taking the same time. At every start the server runs create extension if not exists for both. The bundled pgvector/pgvector:pg17 image has both, so with Docker this step is always green.
When the extensions cannot be added (most often a managed or system PostgreSQL without pgvector), the server does not stop. It opens only the wizard's database step, which shows the reason in plain words and the fix, and a Check again button. Once the extensions are in, the full app starts by itself, in the same process. The fixes:
- Use the bundled database:
docker compose up -dstarts thepgvector/pgvector:pg17image, which has both extensions. - Or use a managed PostgreSQL with pgvector (Neon, Supabase, AWS RDS or Aurora, Google Cloud SQL, Azure Database for PostgreSQL, DigitalOcean): turn the extensions on there and press Check again (chapter 25).
- On your own PostgreSQL server: install pgvector (for example
apt install postgresql-17-pgvector), then runcreate extension vector; create extension btree_gist;as a superuser.
5Setup check
Platform admin → Setup check lists everything a running platform depends on, with a plain-words status, what to do about it and, where possible, a Test button that calls the service for real.
| Row | What it shows, and what Test does |
|---|---|
| Database | PostgreSQL answers and how many migrations are applied. Test reads the PostgreSQL version. |
| File storage | The S3-compatible bucket or the server's own disk. Test writes, reads and deletes a small file. |
| Email (SMTP) | The sender and server. Test connects and signs in, and sends a test email when you type an address. |
| Stripe and Stripe webhook | Whether the keys and the webhook secret are set, and paid plans without a Stripe price. Test reads your Stripe balance and says whether the key is in test or live mode. |
| Other gateways | PayPal, Razorpay and Paystack are tested from Platform admin → Payments, each with its own Test button (chapter 16). |
| AI providers | Which providers have a platform key (saved in the platform admin or in .env) and whether one can embed. Test tries the platform keys. With no key anywhere, assistants say they are not set up yet and offer a person (or suggest contacting the business, when the assistant offers no person). |
| App address | Whether APP_URL is https. Test calls APP_URL/api/health to prove the address reaches this server, which is also where websites load the widget from. |
| Visitor addresses | The TRUSTED_PROXY_HOPS setting (chapter 24). |
| Background jobs | Failed jobs in the last 24 hours and jobs waiting for more than 10 minutes, with the reason a job failed and a Retry button (chapter 22). |
| Install | Whether the install wizard has finished. |
Below the rows, Google Calendar sync holds the platform's Google OAuth client (chapter 12), and Demo data removes the sample workspaces before you open sign-ups (chapter 23).
AI providers and costs
The AI keys can be set in .env or in Platform admin → AI providers. Keys saved in the platform admin come before .env, are sealed with your APP_SECRET, and never come back to the browser once saved (only a short hint). Change one by pasting a new key.
6AI providers and keys
Askmark asks an AI model to write each reply from the workspace's own knowledge, and asks an embedding model to turn pages and questions into numbers that search can compare by meaning. You bring the keys; each provider bills you for what it does.
The providers
| Provider | Replies | Embeddings (search by meaning) | Default models |
|---|---|---|---|
| OpenAI | The Responses API, streamed word by word. | Yes | gpt-5-mini and text-embedding-3-small |
| Anthropic (Claude) | The Messages API, streamed. | No: Anthropic has no embedding model. Add a second key that can embed (below), or search uses full-text only. | claude-haiku-5-5 |
| Google Gemini | generateContent, streamed. | Yes | gemini-2.5-flash and gemini-embedding-001 |
| OpenRouter | One key for hundreds of models from many companies, at https://openrouter.ai/api/v1. | Yes | openai/gpt-5-mini and openai/text-embedding-3-small |
| OpenAI-compatible | Any endpoint that speaks /chat/completions: Groq, Together, Mistral, DeepSeek, LiteLLM, or a model server you run yourself (Ollama, vLLM, LM Studio). Needs a base URL and a model name. | When the endpoint offers /embeddings and you name an embedding model | None: you name the models |
Every embedding has 1,536 numbers, the size of the knowledge table's vector column, so an embedding model you choose must give 1,536 numbers (the defaults do; Askmark asks Gemini and OpenAI for that size). Every reply is stored with the model that wrote it, its tokens, how long it took and its cost at list prices.
Which key is used
For every reply, Askmark takes the first key that exists, in this order:
- The workspace's own key, when the workspace's plan allows own keys. Owners and admins add them in Settings → AI. Their provider bills them, not you, but each reply still counts toward the plan's replies a month.
- The platform's keys saved in Platform admin → AI providers: the first switched-on key, in the order OpenAI, Anthropic, Gemini, OpenRouter, OpenAI-compatible (the most recently changed first when a provider has two).
- The platform key in
.env:OPENAI_API_KEY,ANTHROPIC_API_KEY,GEMINI_API_KEYorOPENROUTER_API_KEY, in the same order. An OpenAI-compatible endpoint needs a base URL, so it is saved in the platform admin only.
Embeddings are picked the same way, among the keys that have an embedding model (never Anthropic). So a platform can write replies with Claude and embed with OpenAI or Gemini. With no key anywhere, an assistant says it is not set up yet and offers a person, and that uses no reply of the plan. Without an embedding key, knowledge search uses PostgreSQL full-text search only, which still finds pages that share the visitor's words.
Change the embedding model, and the background job embeds the knowledge again with the new one; until it has, search by meaning uses only the chunks already embedded with the new model, and full-text search covers the rest.
Get each key
OpenAI
- Sign in at platform.openai.com and add a payment method under Settings → Billing. OpenAI's API is paid separately from ChatGPT subscriptions.
- Open API keys → Create new secret key and copy it (it starts with
sk-; it is shown once). - Default models:
gpt-5-minifor replies andtext-embedding-3-smallfor embeddings. Others in the price table:gpt-5-nano,gpt-5,gpt-4.1-mini,gpt-4o-miniandtext-embedding-3-large.
Anthropic (Claude)
- Sign in at console.anthropic.com and buy credits under Billing.
- Open API keys → Create key and copy it (it starts with
sk-ant-). - Default model:
claude-haiku-5-5. Others in the price table:claude-sonnet-5-5,claude-opus-5-5,claude-haiku-4-5. Add an OpenAI, Gemini or OpenRouter key as well for search by meaning.
Google Gemini
- Sign in at Google AI Studio and press Get API key (it starts with
AIza). For more than the free tier's limits, turn on billing for the key's Google Cloud project. - Default models:
gemini-2.5-flashandgemini-embedding-001. Others in the price table:gemini-2.5-flash-lite,gemini-2.5-pro. - The Gemini API is not offered in every country; a refusal from your server's region shows as a
bad_requesterror.
OpenRouter
- Sign in at openrouter.ai, buy credits under Credits, then open Keys → Create key (it starts with
sk-or-v1-). - Default models:
openai/gpt-5-miniandopenai/text-embedding-3-small. Any model OpenRouter lists works by its id, for exampleanthropic/claude-haiku-5-5orgoogle/gemini-2.5-flash. - OpenRouter passes on each model's price and adds its own fee when you buy credits; see its pricing page.
An OpenAI-compatible endpoint
The service behind the endpoint bills you with its own pricing; a model server you run yourself costs only your own hardware.
- Get the endpoint's base URL (it ends before
/chat/completions, for examplehttps://api.groq.com/openai/v1), a key and the model names. A model server of your own may need no key. - A model server on your own network (a private address such as
192.168.…orlocalhost) is refused by the outgoing-call guard (chapter 27) unless you setALLOW_PRIVATE_FETCH=truein.env. Only do that when you trust every workspace's owner, because it also lets their crawls and webhooks reach that network. - Add the model's row to the price table (chapter 17), so its cost figures are right: a model that is not in the table is priced by a built-in guess.
Add the keys
- Platform keys: Platform admin → AI providers: the provider, the key, the answer model and the embeddings model (empty = the default), the base URL (OpenAI-compatible only) and an on/off switch. Or set the keys in
.envand rundocker compose up -d. - A workspace's own keys: Settings → AI in the workspace, for owners and admins, on plans whose Own AI keys switch is on (of the sample plans, only Agency has it; switch it on or off for any plan in Platform admin → Plans).
- Keys are sealed in the database with
APP_SECRETand only ever come back as a hint such assk-…Q7fd.
Test a key
Every key has a Test button, and the setup check tests the platform keys too. OpenAI, Anthropic and Gemini are tested by reading the model's details, which costs nothing. OpenRouter and OpenAI-compatible endpoints are sent a one-token question, which costs a tiny fraction of a cent. The test checks the embedding model too when one is set, and says whether the key works, how long the provider took and the model it answered with, or the provider's reason in plain words.
When a provider refuses
A visitor's reply is never tried again behind their back: when the provider fails or takes longer than 60 seconds, the visitor sees "The assistant could not answer just now. Please try again in a moment.", nothing is stored, and the reply's message credit is given back, so a failed reply costs the workspace nothing. Embedding knowledge runs in the background: when the provider fails, the job tries again 2 minutes later, up to 5 tries in all, and meanwhile the chunks are found by full-text search.
| Code | What it means | Kind | What you can do |
|---|---|---|---|
auth | The key is wrong, revoked or lacks access (HTTP 401/403) | Needs you | Copy the key again from the provider's dashboard, check that it is not revoked and may use the model, save it and press Test. |
rate_limited | Too many requests right now (HTTP 429); trying again later works | Passing | Usually nothing: the visitor can ask again a moment later. If it happens at every busy hour, ask the provider for a higher rate limit, or add a second provider. |
quota | The account is out of credit or over a hard quota; retrying will not help | Needs you | Add credit, or raise the spending limit, on the provider's billing page. Replies work again at once. |
bad_request | The request was refused as invalid (unknown model, bad parameter) | This question | Usually the model name: check it against the provider's model list (an embedding model must give 1,536 numbers). For Gemini it can also mean the API is not offered in the server's region. |
timeout | No answer within the configured timeout | Passing | Nothing for one reply. If it keeps happening, pick a faster model. |
server | The provider failed on its side (HTTP 5xx, overloaded) | Passing | Nothing: the provider had a problem on its side. Check its status page if it lasts. |
network | The provider could not be reached (DNS, TLS, connection reset) | Passing | Check that the server can reach the provider over HTTPS (firewall, DNS, outgoing proxy). |
parse | The provider answered with something Askmark could not read | This question | Rare. For an OpenAI-compatible endpoint, check that it speaks the Chat Completions format with streaming; otherwise update Askmark. |
refused | The provider declined to answer (safety filter, blocked prompt) | This question | The provider's safety filter declined this question. Nothing to do for one; if it happens often, read the assistant's rules again. |
not_configured | Something needed for the call is missing (key, base URL) | Needs you | Add a key for this provider (and the base URL and model for an OpenAI-compatible endpoint), or turn the provider off. |
"Passing" problems go away by themselves; "Needs you" problems stop every reply on that key until you act; "This question" problems affect one request only.
OpenAI, Anthropic, Google, OpenRouter and the services behind an OpenAI-compatible endpoint are third-party services with their own pricing, and you, the buyer, pay for every reply and every embedding they make with your keys (a workspace using its own keys pays its own). The next chapter shows what a reply costs.
7Costs
Askmark has no monthly fee of its own. What you pay each month depends on how many replies your customers' assistants write, how many pages they add, and which outside services you use. Each of those services is run by another company with its own pricing, and you, the buyer, are responsible for every one of these costs.
What one reply costs
One reply is one assistant answer to one visitor message. Its cost is the provider's list price for the tokens the model reads and writes. To write a reply, the model reads the 6 best-matching knowledge chunks of about 700 tokens each, plus the assistant's rules, the recent turns and the question: about 5,000 tokens in, and about 250 tokens out (a reply stops at 800). These are the list prices (US dollars) in Askmark's price table, the same table every cost figure in the app uses; the real cost of each reply is worked out from its own token counts and stored with it.
| Provider | Model | Input / 1M tokens | Output / 1M tokens | Typical reply | Longest reply |
|---|---|---|---|---|---|
| OpenAI | gpt-5-mini (default) | $0.25 | $2 | $0.0018 | $0.0029 |
| OpenAI | gpt-5-nano | $0.05 | $0.40 | $0.0003 | $0.0006 |
| OpenAI | gpt-5 | $1.25 | $10 | $0.0088 | $0.0143 |
| OpenAI | gpt-4.1-mini | $0.40 | $1.60 | $0.0024 | $0.0033 |
| OpenAI | gpt-4o-mini | $0.15 | $0.60 | $0.0009 | $0.0012 |
| OpenAI | any other model | $1.25 | $10 | $0.0088 | $0.0143 |
| Anthropic | claude-haiku-5-5 (default) | $0.10 | $0.50 | $0.0006 | $0.0009 |
| Anthropic | claude-sonnet-5-5 | $2 | $10 | $0.0125 | $0.0180 |
| Anthropic | claude-opus-5-5 | $4 | $20 | $0.0250 | $0.0360 |
| Anthropic | claude-haiku-4-5 | $1 | $5 | $0.0063 | $0.0090 |
| Anthropic | any other model | $2 | $10 | $0.0125 | $0.0180 |
| Google Gemini | gemini-2.5-flash-lite | $0.10 | $0.40 | $0.0006 | $0.0008 |
| Google Gemini | gemini-2.5-flash (default) | $0.30 | $2.50 | $0.0021 | $0.0035 |
| Google Gemini | gemini-2.5-pro | $1.25 | $10 | $0.0088 | $0.0143 |
| Google Gemini | any other model | $0.30 | $2.50 | $0.0021 | $0.0035 |
| OpenRouter | openai/gpt-5-mini (default) | $0.25 | $2 | $0.0018 | $0.0029 |
| OpenRouter | anthropic/claude-haiku-5-5 | $0.10 | $0.50 | $0.0006 | $0.0009 |
| OpenRouter | google/gemini-2.5-flash | $0.30 | $2.50 | $0.0021 | $0.0035 |
| OpenRouter | any other model | $0.50 | $2 | $0.0030 | $0.0041 |
| OpenAI-compatible | openai/gpt-5-mini | $0.25 | $2 | $0.0018 | $0.0029 |
| OpenAI-compatible | any other model (no price: add yours) | $0 | $0 | $0.0000 | $0.0000 |
Replies that call no model cost nothing: "I don't know" when the knowledge has nothing relevant, "not set up yet" when there is no key, and every message while a person has the chat.
What knowledge costs
Each page, file or Q&A pair is embedded once when it is added or changes (a re-crawl skips pages that did not change), and each visitor question is embedded once for search. With the default models:
| Provider | Model | Per 1M tokens | Per page (about 1,500 tokens) | Per 1,000 pages |
|---|---|---|---|---|
| OpenAI | text-embedding-3-small (default) | $0.02 | $0.00003 | $0.03 |
| OpenAI | text-embedding-3-large | $0.13 | $0.00019 | $0.20 |
| Google Gemini | gemini-embedding-001 (default) | $0.15 | $0.00022 | $0.23 |
| OpenRouter | openai/text-embedding-3-small (default) | $0.02 | $0.00003 | $0.03 |
Crawling itself costs nothing but your server's time: Askmark reads the pages itself, without any outside service.
The prices above were the providers' published list prices in November 2026. Each provider sets and changes its own prices, some give free allowances or discounts, and a provider's invoice is what counts. Check each provider's pricing page (OpenAI, Anthropic, Google Gemini, OpenRouter) before you set your plan prices, and update the price table when they change (chapter 17).
A worked example
The most a workspace on the most popular sample plan can cost you in a month, with your platform keys: a workspace on the Growth plan that uses all 10,000 replies of its month on OpenAI gpt-5-mini costs about $17.50 in replies, plus about $0.06 to embed its 2,000 pages once ($17.57 in all, against the plan's $79).
| What | Count | Each | Cost |
|---|---|---|---|
| Replies (gpt-5-mini) | 10,000 | $0.0018 | $17.50 |
| Questions embedded for search (text-embedding-3-small, about 30 tokens each) | 10,000 | under $0.00001 | $0.01 |
| Pages embedded once (text-embedding-3-small, about 1,500 tokens each) | 2,000 | $0.00003 | $0.06 |
| The month at most, on these models | $17.57 | ||
| What the workspace pays you for the Growth plan | $79.00 |
Most workspaces use far fewer replies than their plan allows, and a re-crawl embeds only the pages that changed.
How plans keep costs known
- Replies a month (message credits). Every plan has a number of replies a calendar month (UTC). Before each model call, Askmark takes one credit from the month's meter, in one locked database step, so replies that start at the same moment can never pass the limit together, and a visitor message sent twice is never counted twice. When a call fails, its credit is given back. A test in Knowledge → Test answers (chapter 8) counts the same way: one credit for each answer the model writes, given back when the provider fails; the public demo's sample answers are free. When the month is used up, the assistant stops answering, the widget shows a short contact form instead (every message then arrives as a lead), and the owners and admins get one email that month.
- Pages of knowledge. Every indexed page, file or Q&A pair counts as one page; a crawl stops when the plan's pages are used up, and says so, and a Q&A import that would pass them saves nothing.
- What a plan can cost you. With your platform keys, the most a workspace can cost you in a month is its plan's replies times the cost of a reply, plus embedding its pages. At the default models:
| Plan | Price a month | Replies a month | All on OpenAI gpt-5-mini | All on Anthropic claude-haiku-5-5 | All on Google Gemini gemini-2.5-flash | All on OpenRouter openai/gpt-5-mini | Embedding all its pages once |
|---|---|---|---|---|---|---|---|
| Starter | $29 | 1,500 | $2.63 | $0.94 | $3.19 | $2.63 | $0.01 to $0.07 (300 pages) |
| Growth | $79 | 10,000 | $17.50 | $6.25 | $21.25 | $17.50 | $0.06 to $0.45 (2,000 pages) |
| Agency | $199 | 40,000 | $70.00 | $25.00 | $85.00 | $70.00 | $0.30 to $2.25 (10,000 pages) |
So a plan whose replies would all go to a dear model can cost more than its price. Keep each plan's replies, the platform's default model and its price in step with the table above, and remember that workspaces using their own keys (chapter 6) pay their providers themselves. The platform admin's overview and AI providers page show this month's AI cost at list prices.
Everything else
| Service | Price | What that means for you |
|---|---|---|
| Stripe | 2.9% + 30¢ | Per successful US card payment, plus 0.7% of subscription volume for Stripe Billing: on a $79 plan, about $3.13 a month. Other countries and cards have their own rates on Stripe's pricing page. |
| PayPal | 3.49% + 49¢ | Per PayPal checkout payment in the USA; other countries have their own rates on PayPal's fees page. |
| Razorpay | 2% per payment | For most Indian cards, UPI and net banking on the standard plan; international cards cost more. See Razorpay's pricing. |
| Paystack | 1.5% + ₦100 | Per local payment in Nigeria (capped at ₦2,000); international cards and other countries have their own rates on Paystack's pricing. |
| Server (VPS) | about $10 to $40 a month | One server with 2 cores and 4 GB of memory runs the whole Docker stack for many workspaces. The AI providers do the heavy work; PostgreSQL holds the knowledge. |
| Email (SMTP) | about $0.10 per 1,000 (for example Amazon SES) | Password resets, invites, waiting, lead and booking notices, booking emails to visitors, transcripts and replies to visitors who left. Other providers sell monthly plans with a free tier. |
| File storage | $0 to $0.015 per GB | The bundled MinIO or the server's own disk costs nothing extra; each plan caps a workspace's files (chapter 15). |
| Google Calendar API | free | Free and unlimited for this use; each customer connects their own Google account. |
| Cal.com | the customer's own plan | Customers who connect Cal.com use their own Cal.com account and key. |
| Domain name | about $10 to $20 a year | The address of your platform, for example chat.yourbrand.com. |
Assistants and chats
This part follows your customer, a business owner, from an empty workspace to an assistant answering on their website. The workspace's sidebar has four groups: Conversations (Overview, Inbox, Leads, Bookings), Assistant (Knowledge, Assistants, Widget and install), Insights (Analytics) and Workspace (Settings, Developers).
8Knowledge
The assistant answers only from the workspace's knowledge. Knowledge has three kinds of source: a website Askmark reads, uploaded files, and questions with answers typed in. Every member can read it; owners and admins change it.
A website
Knowledge has five tabs: Sources, Website pages, Files, Q&A pairs and Test answers. Add a website with its start address: Askmark first shows the sitemap it found and how many pages it lists, then reads the site and shows the progress live: pages found, read, unchanged, skipped and failed. Pause ends a running crawl after its current batch and holds the scheduled re-crawls until you crawl it again; Stop and keep what's read ends it and keeps the pages read so far; Re-crawl now runs one at any time.
- Sitemap first. Askmark reads the
Sitemap:lines of the site'srobots.txt, else/sitemap.xml, following sitemap indexes and gzipped sitemaps. Then it follows the start page's links, breadth first, on the same site ("Sitemap first, then follow links", recommended); "Only the pages in the sitemap" skips the links. - Depth and pages. Links are followed up to the source's depth (default 3, at most 10) and pages up to its page cap (default 500, at most 10,000) and the plan's remaining pages. A crawl stops after 8 minutes and the next one checks the rest.
- robots.txt. The rules for
AskmarkBot(or*) are kept, so pages the site closes to robots are skipped as "Blocked by robots.txt". A business that crawls its own site may turn this off for that source. - Include and exclude. Path patterns, up to 50 of each, in the style of
robots.txt:/blog/matches everything that starts with it,*matches any run of characters and a final$ends the match. With include patterns, only matching pages are read; exclude patterns always win. - Clean addresses. The
#fragmentand the query string are dropped (unless the source keeps query strings), the page's canonical address wins, and the same text under two addresses is kept once. - Re-crawl off, daily or weekly. A re-crawl asks each page with its ETag and Last-Modified, keeps unchanged pages as they are (and does not embed them again) and updates the rest.
- Pages are fetched four at a time, at most 2 MB and 10 seconds each and up to 5 redirects, only from public addresses (chapter 27). Website pages lists every page as read, skipped (with the reason), failed or excluded, problems first. Retry reads a failed page again; Exclude leaves a page out for good: its chunks go, it stops counting toward the plan, and later crawls skip it.
Files
Knowledge → Files takes PDF, Word (.docx), plain text and Markdown files of up to 20 MB each. Askmark reads the text with its headings and keeps the file in the workspace's storage, which counts toward the plan's file storage. A PDF that holds only scanned pictures has no text to read and is reported as such; run it through a text-recognition (OCR) tool first.
Questions and answers
Knowledge → Q&A pairs holds pairs the team writes: a question and its answer, for the things no page says well (opening hours, prices, policies). An answer added from Analytics → Unanswered questions is saved here too. A Q&A pair is found like any page, so write the question the way visitors ask it.
Import CSV adds many pairs at once from a spreadsheet saved as CSV (UTF-8), up to 2,000 rows and 2 MB:
question,answer,source_url
Do you install in Portland?,"Yes, across the Portland metro area.",https://www.example.com/areas
How long does a battery last?,Our batteries carry a 10-year warranty.,
- The columns are
question,answerand an optionalsource_url, in that order. A first row that names the columns is read as a header, and then the columns may come in any order. - A question that is already there (the same words, ignoring case, spacing and end punctuation) gets the new answer instead of a second pair.
- Rows that can't be used are listed with their line number and the reason; the others are added.
- The new pairs count toward the plan's pages: when they don't all fit, nothing is saved and the message says how many would.
Pages of knowledge
Every indexed crawled page, uploaded file and Q&A pair counts as one page of the plan's pages of knowledge. When the plan's pages are used up, a crawl stops and says so, and new files or pairs are refused with an upgrade prompt. Delete pages, exclude paths or upgrade to make room.
How knowledge is searched
Each document's text is split into chunks of about 700 tokens that overlap by 100, each with its headings, and its language is detected. For every question, Askmark runs PostgreSQL full-text search and, when the workspace has an embedding key, search by meaning (pgvector), then joins the two lists by reciprocal-rank fusion and gives the model the 6 best chunks. Every search is filtered on the workspace, and on the assistant's own source list when it has one, so a chat never reads another workspace's knowledge.
Test the answers
Knowledge → Test answers takes a question and shows the answer the widget would give, with its sources, and every chunk the assistant read, best first. The test never reaches the inbox and is not stored. Agents, admins and owners can run it; each answer the model writes uses one message credit of the plan, given back when the provider fails. "I don't know" and "not set up yet" answers cost nothing, and so do the public demo's sample answers. Use it before going live: when the right page does not come first, add a Q&A pair or exclude the noisy pages.
9The assistant
An assistant is one chat assistant with its own look, behaviour and rules. A workspace can have as many as its plan allows (Assistants), for example one per website or per language.
Behaviour
| Setting | What it does |
|---|---|
| Name and picture | Shown in the widget's header and beside each reply. |
| Tone | Friendly (warm, short sentences, no jargon), Professional (polite and precise) or Concise (as few words as the answer needs). The rules always win over the tone. |
| Rules | The business's own instructions in plain words: "Never quote a price; offer a free survey instead", "Call our product Sunmere Home, never just Home". |
| Languages | The languages the assistant answers in, and its default. A visitor whose browser asks for one of them is answered in it; anyone else in the default. With no list, it answers in the visitor's language. |
| When there is no answer | The words the assistant says when the knowledge does not answer the question, and what it offers then (below). |
| Handover to a person | Whether the assistant hands the chat to the team (below). |
| Memory | How many recent turns of the chat the assistant reads with each question (2 to 20). |
| Sources | All the workspace's knowledge, or only the sources you pick, for example one site per assistant. |
How a reply is made
- The visitor's question is searched in the knowledge (chapter 8).
- When nothing relevant is found, the assistant says so in the "no answer" words without calling the model, and offers a person or a way to leave a message.
- Otherwise the model gets the assistant's tone and rules, the reply language and the instruction to answer only from the numbered sources and to cite them, then the sources as quoted data, the recent turns and the question. The visitor's words travel as data too, so a visitor cannot rewrite the rules ("ignore your instructions…").
- The reply streams to the visitor word by word; the visitor can press Stop. A reply stops at 800 tokens.
- Before it is shown and stored, every reply is checked: source marks that point at no source are removed, links that are not in the sources are removed, a reply that repeats the rules is replaced, and the model's "the sources don't say" becomes the "no answer" reply.
- The reply shows its sources as links under it, and is stored with its sources, model, tokens, cost and time.
Handover rules
The Behaviour tab decides when a person is offered:
- When there is no answer, the assistant says so (in its own "no answer" words, when you write them) and then: Say so and offer a person (the default), Say so and ask for an email (the widget shows the contact form, so the team can write back), or Say so only.
- Offer a person whenever the visitor asks (on or off): the visitor can ask at any time, with the widget's button or in words ("talk to a person", "speak to someone", in the widget's six languages). The assistant's own handover words, when it has some, replace the built-in phrases.
- Hours for a person: Any time, or Set hours for each day of the week in the assistant's time zone. Inside the hours, a visitor who asks for a person waits in the inbox for a teammate, and the widget says the team replies in about 5 minutes. Outside them, the chat stays with the assistant, which says when the team is back and shows the contact form, so the visitor leaves a message and the team replies by email.
With neither (no offer after "no answer" and asking off), the widget's menu has no "Talk to a person" item and shows no reply time. Over the REST API, handoverMode (on_request, on_not_found or never) still sets these at once.
Look
The Look tab sets the colour (the widget works out readable shades for light and dark), the corner it sits in, the greeting, up to 6 suggested questions shown before the first message, light, dark or the visitor's own theme, the privacy page linked under the chat, and any of the widget's own words (for example "Type your question"). A preview shows the widget as you change it, on a computer and on a phone.
10Install the widget
The widget is the chat button a website shows. It is one small script (about 30 KB gzipped) that loads after the page, draws itself inside a Shadow DOM (the site's styles cannot change it, and it cannot change the site), works with the keyboard and screen readers, and opens full screen on phones (under 480 pixels wide).
The snippet
Widget and install (or the assistant's Install tab) shows the snippet with the assistant's public widget key, a Copy button and an "Email it to your developer" button:
<script src="https://chat.yourbrand.com/widget.js"
data-assistant="pk_xxxxxxxxxxxxxxxxxxxxxxxx" async></script>
Paste it once, just before </body>, in the template every page uses. data-lang="es" on the tag picks the widget's language for that page (else the assistant's language setting, else the visitor's browser). The install check on the same page turns green once the widget has been seen on the site, and shows how fast it loaded.
The pk_… key is meant to be seen in page source; it only names the assistant. What protects it is the list of allowed websites (below). Rotate key makes a new one; the old snippet stops working until the new one is pasted.
Where to paste it
| Website | Steps |
|---|---|
| Plain HTML | Open the site's main template (often footer.html or layout.html), paste the snippet just before </body>, publish, then open any page. |
| WordPress | Use a header and footer plugin such as WPCode (it keeps the snippet when the theme updates), or Appearance → Theme File Editor. Paste the snippet in the footer section and save. Clear your cache plugin if the button does not show at once. |
| Shopify | Online Store → Themes → Edit code → layout/theme.liquid. Paste the snippet just before </body> and save. It covers every page of the store, the cart included. |
| Webflow | Site settings → Custom code → Footer code. Paste, save and publish: custom code runs only on the published site, not in the Designer. |
| Wix | Settings → Custom code (under Advanced) → Add custom code. Paste the snippet, choose All pages and Body - end, and apply. Wix runs custom code only on a premium site with a connected domain. |
| React, Next.js | A React app built with Vite or similar: paste the snippet into index.html before </body>. Next.js: in the root layout, add <Script src="https://chat.yourbrand.com/widget.js" data-assistant="pk_…" strategy="afterInteractive" /> from next/script. The widget loads once and stays across page changes. |
| Google Tag Manager | Add a tag of type Custom HTML, paste the snippet, trigger it on All Pages, then submit and publish the container. |
Allowed websites
In the Install tab, list the websites that may show the assistant, for example sunmeresolar.com. A www. in front is ignored, *.sunmeresolar.com also allows its subdomains, and the platform's own address is always allowed (for the previews). Every widget request from a page on another site is refused. With the list empty, any site may show it. Fill it in, so another site cannot use the business's assistant and its replies.
The JavaScript API
The page gets one global, window.Askmark, as soon as the script has run. Calls made before the widget is ready are kept and run when it is.
| Call | What it does |
|---|---|
Askmark.open() | Opens the chat. |
Askmark.close() | Closes it. |
Askmark.ask("Do you install batteries?") | Opens the chat and sends the question, as if the visitor typed it. |
<button onclick="window.Askmark && Askmark.ask('Can I book a free survey?')">Book a survey</button>
When the site has a Content Security Policy
A site that sends a strict Content-Security-Policy header must allow the platform's address, or the browser blocks the widget: add it to script-src (the script), connect-src (questions and the live reply stream) and img-src (the assistant's picture). The widget's styles are built in code, so style-src needs no change.
White label
On plans with White label, a workspace replaces the Askmark name everywhere visitors and its own customers see it: Settings → General sets its own name, logo and colour for the widget and for the emails it sends to visitors, and each assistant can hide "Powered by Askmark" under the chat. On plans without it, the widget always shows "Powered by" with your product name (chapter 18).
11Inbox and handover
The inbox shows every chat live, as it happens, for the whole team. While the assistant has a chat, the team can watch; when a visitor asks for a person, the chat waits for the first teammate to take it.
The four states of a chat
| State | What it means | How it changes |
|---|---|---|
| Bot | The assistant answers. | A teammate takes over, or the visitor asks for a person (→ Waiting). |
| Waiting | The visitor asked for a person. The assistant stops replying, and the widget shows the visitor's place in the queue. | A teammate takes it (→ Human), or the visitor stops waiting (→ Bot). |
| Human | A teammate has the chat; the assistant stays silent. | The teammate hands it back to the assistant (→ Bot) or closes it. |
| Closed | The chat ended; the visitor is asked to rate it. | The visitor writes again, or a teammate presses Reopen (→ Bot). |
Each change is one conditional database update, so two teammates who press Take over at the same moment cannot both get the chat: the second is told it was just taken. Every change adds a line to the chat, so the visitor and the team see what happened.
What the team can do
- Take over a chat (it is assigned to you), assign it to a teammate, reply, add an internal note (never shown to the visitor), hand back to the assistant, close and reopen.
- Email transcript sends the whole chat to the visitor, when they left an email (five times an hour per chat).
- See the visitor's page, language and earlier chats, the details they left, the sources each reply used, and when the visitor is typing.
- Filter chats with the tabs Open (every chat that is not closed), Waiting, Mine and Closed, and search them.
Notices
- Each member chooses, in Settings → Notifications and language, which notices they get by email and in the browser: new chats, a visitor waiting for more than 60 seconds, new leads and (owners and admins) billing. The workspace can also send its chat and lead notices to up to 10 extra addresses.
- A teammate's reply to a visitor who has left (no chat open in their browser for 2 minutes) is emailed to the visitor when they gave their email.
- The visitor can have the chat emailed to them (three times an hour per chat).
- The same moments are sent to the workspace's webhooks:
chat.started,chat.waitingandchat.closed(chapter 29).
12Leads and bookings
The lead form
Each assistant's Lead form tab decides when the widget asks for the visitor's details:
- Off.
- When it fits: after the visitor asks about a price, a quote or being contacted (in the widget's six languages), or at their third question.
- Before the chat: the form comes first, once per visitor.
The form asks for a name and an email; the phone number is off, optional or required. When the assistant is offline, or the workspace's replies are used up, the widget shows a contact form instead. One chat makes one lead; a second form updates it.
Every new lead appears live in Leads, is emailed to the members who want lead emails and is sent to the lead.created webhook. In Leads, the team sees the chat it came from and its booking, moves it through New, Contacted, Won and Lost, gives it an owner, adds notes (never shown to the visitor), adds leads by hand and downloads them as CSV (spreadsheet formulas are defused). Everyone reads leads; agents and up change them.
Calendars and bookings
Bookings lets visitors book a time inside the chat. A workspace adds calendars (one per kind of meeting, for example "Free roof survey"), each with its weekly hours per weekday, slot length, buffer between meetings, minimum notice, how many days ahead visitors may book, and time zone. In an assistant's Booking rules, switch bookings on and pick the calendar.
- When a visitor asks to book ("book", "appointment", "survey", in the widget's six languages), the widget shows the free times. Free times are the weekly hours, minus confirmed bookings and their buffers, minus the times a synced calendar says are busy.
- Two visitors can never hold the same time: a database rule refuses the second, who is told "That time was just taken" and shown the day's fresh times.
- The visitor can move or cancel the booking from the chat; the team moves, cancels or adds bookings in the week view. New and cancelled bookings are sent to the
booking.createdandbooking.cancelledwebhooks.
Booking emails and the booking page
- The visitor gets a "Booking confirmed" email with a private link to the booking's own page,
APP_URL/booking/…. Later, a short email when the booking is moved or cancelled. The times are in the visitor's time zone and the words in the chat's language (English, Spanish, French, German, Portuguese or Arabic; other languages get the English email, which you can reword in Platform admin → Email and brand). - The booking page needs no account. It shows the booking with the business's name, logo and colour, and lets the visitor pick another free time or cancel, up to the calendar's minimum notice. When the time they picked was just taken, the page shows that day's free times again. The link holds a long random token; only its fingerprint is stored, and each link is limited to 120 views and 10 changes an hour.
- The team: the members who keep lead and booking emails on get a "New booking" notice when the assistant books a time, and a notice when a visitor moves or cancels one.
- The public demo and the demo workspaces send none of these: they only write them to the server log.
Google Calendar
On plans with Google Calendar and Cal.com, a calendar can be connected to a Google Calendar: Askmark then leaves out the times Google says are busy, and writes new, moved and cancelled bookings to it. Your customers connect with their own Google account; you set up one Google OAuth client for the whole platform, once:
- In the Google Cloud console, create a project (or pick one) and turn on the Google Calendar API under APIs and Services → Library.
- Under OAuth consent screen, choose External, give the app your product's name, support email and logo, and add the scopes
…/auth/calendar.events,…/auth/calendar.freebusyand…/auth/userinfo.email. - Under Credentials → Create credentials → OAuth client ID, choose Web application and add this Authorized redirect URI: your
APP_URLplus/api/v1/calendars/google/callback, for examplehttps://chat.yourbrand.com/api/v1/calendars/google/callback. - In Askmark, open Platform admin → Setup check → Google Calendar sync. It shows the redirect URI to copy into step 3. Paste the client ID and client secret and save; the secret is sealed in the database and shown only by its last four characters. (Instead, you can put them in
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETin.envand rundocker compose up -d; the ones saved on the screen win.) - While the consent screen is in Testing, only the Google accounts you add as test users can connect. Calendar access is a sensitive scope: to let every customer connect, publish the app and pass Google's verification.
Then, in a calendar, a workspace admin presses Connect Google Calendar, signs in with Google and comes back connected. The Google token is sealed in the database; Disconnect removes it.
Cal.com
A business that already books with Cal.com can let the assistant offer its Cal.com times: in Cal.com, create an API key (Settings → Developer → API keys) and note the event type's id (in the event type's address or settings); in the Askmark calendar, press Connect Cal.com and paste both. Askmark checks them by reading a day of times, then offers Cal.com's own free times and books through Cal.com. The key is sealed in the database.
13Analytics
Analytics shows how the assistants are doing over the last 7, 30 or 90 days in the workspace's time zone, for one assistant or all, each number next to the period before it:
- Chats a day (a chat counts once it has a message).
- Resolution: the share of chats closed as resolved without a person.
- How chats ended: resolved by the assistant, a person asked for, no answer found, or handed over by a rule.
- Leads (and how many were won) and bookings that came from chats.
- Ratings visitors gave at the end of a chat, and the time to a first answer.
- Top questions and unanswered questions: alike wordings are grouped into one question. Next to each unanswered question, Add an answer saves a Q&A pair (chapter 8), and every wording of that question leaves the list until it is asked again.
- Languages visitors wrote in, and the busiest hours of the week.
The Overview page shows the chosen period at a glance, and every number opens the chats behind it: who is chatting right now (with Take over), chats and how many were resolved without a person, leads and bookings, ratings, the time to a first answer, this month's replies and when they reset, the questions the assistant could not answer, the top questions and the latest leads.
14Team, roles and data
Roles
| Role | What they can do |
|---|---|
| Owner | Everything, plus the plan and billing, and deleting the workspace. |
| Admin | Everything except billing and deleting: knowledge, assistants, the widget, the team, AI keys, settings, API keys and webhooks. |
| Agent | Answers chats (take over, reply, notes, hand back, close), and changes leads and bookings. |
| Viewer | Reads everything, changes nothing. |
Roles are checked by the server on every request; the screens only hide what a role cannot use. Owners and admins invite people in Settings → Team; an invitation link works for 7 days. Members and open invitations together count toward the plan's seats. One person can belong to several workspaces and switch between them.
Visitors' data
- The widget makes a random visitor token and keeps it in the visitor's browser; the server stores only a keyed hash of it. Without a name or email, a visitor is anonymous.
- Askmark stores the chat's messages, the page it started on, the visitor's language, and the name, email and phone the visitor typed into a form.
- Each assistant links its business's privacy page under the chat; the widget says the business keeps the chat so the team can reply. The business is responsible for its own privacy notice.
Export and delete
- Export: owners and admins download everything the workspace holds as one JSON file or a zip of CSV files, one per table: the workspace, members and invitations, assistants, knowledge sources and documents, chats with their messages, visitors, leads, calendars and bookings, API keys (their prefix only) and webhooks (never their secrets). AI keys, calendar tokens and embeddings are never exported. The file is reached through a signed link that works for an hour, then deleted; a workspace can export ten times an hour.
- Delete: the owner deletes the workspace in Settings → General by typing its name. Its paid plan is cancelled at once, and 30 days later everything it held is deleted. Payments and subscriptions are kept for the books, with the workspace's name blanked.
Run the platform
15Plans, limits and trials
You sell plans to your customers. Each plan has a price, a free trial, limits and features; the server enforces them on every request.
Plans and their limits
Platform admin → Plans. Each plan has a name, a description, a monthly price and an optional yearly price, the currency, a free trial in days, a list of features shown on the pricing page, whether it is public, whether it is the default plan new workspaces start on, and an optional "Most popular" badge. Its limits are enforced on the server, inside the database transaction that adds the rows, under a lock per workspace, so two requests at once can never pass a limit together:
| Limit | What happens when it is reached |
|---|---|
| Replies a month (message credits) | One assistant reply is one credit, taken before the model is called and given back when the call fails (chapter 7). When the month (UTC) is used up, the assistants stop answering and the widget shows a contact form until the next month or an upgrade. |
| Pages of knowledge | Indexed pages, files and Q&A pairs. A crawl stops at the limit and says so; new files and pairs are refused. |
| Assistants | A new assistant is refused. Archived assistants do not count. |
| Seats | Members plus open invitations. Inviting another person is refused. |
| File storage | An upload that would pass the plan's storage is refused. |
| Bookings, Google Calendar and Cal.com, API keys webhooks and MCP, white label, own AI keys | Switches: the feature is off for workspaces on a plan without it, with an upgrade prompt. |
An empty limit means no limit. A refused request answers 402 plan_limit and names the limit, and the screens show the upgrade dialog. Archiving a plan takes it off sale; its subscribers keep it, and you can restore it later.
The sample plans
The install wizard adds these three (you can change or archive them). A year costs ten months. Starter is the default plan, so a new workspace starts its free trial there.
| Limit | Starter | Growth (most popular) | Agency |
|---|---|---|---|
| Price a month | $29 | $79 | $199 |
| Price a year | $290 | $790 | $1,990 |
| Free trial | 14 days | 14 days | 14 days |
| Replies a month (message credits) | 1,500 | 10,000 | 40,000 |
| Pages of knowledge | 300 | 2,000 | 10,000 |
| Assistants | 1 | 3 | 15 |
| Seats | 2 | 5 | 15 |
| File storage | 100 MB | 1 GB | 5 GB |
| Bookings | Yes | Yes | Yes |
| Google Calendar and Cal.com | No | Yes | Yes |
| API keys, webhooks and MCP | No | Yes | Yes |
| White label | No | No | Yes |
| Own AI keys | No | No | Yes |
Trials, failed payments and read-only workspaces
- A workspace on a paid default plan gets the plan's free trial without a card. When the trial ends with no plan paid, the workspace turns read-only and its owners get one email: everything can be read and a plan can be paid, but nothing can be changed, and its assistants stop answering (the widget shows the contact form) until a plan is paid.
- While the gateway retries a failed card, the workspace keeps working and the owner gets a "payment failed" email. After Stripe's last retry, the workspace is suspended the same way until it pays; paying lifts it at once.
- A cancelled plan runs to the end of its paid period, then the workspace turns read-only the same way.
- You can give any workspace any plan by hand in Platform admin → Workspaces (no gateway is charged), for example a free plan for a partner.
DEMO_PAYMENTS="true" in .env turns on a test checkout that switches plans without any card. It is "false" in the shipped file and only works while no gateway is set up. Keep it "false" on a live site.
Charging your customers through Askmark (selling plans or subscriptions) requires the Envato Extended Licence. The Regular Licence covers a single product whose end users are not charged.
16Payment gateways
Askmark takes payments through your own account at Stripe, PayPal, Razorpay or Paystack: checkout and card changes happen on the gateway's own pages, and plans switch on only from the gateway's signed webhooks. Turn on one or several in Platform admin → Payments, where each gateway has its keys, an on/off switch and a Test button (or set the keys in .env). When more than one is on, the owner picks one at checkout.
Every gateway is a third-party service with its own pricing, and you pay its fees on every payment (chapter 7 lists their list prices). Each gateway's pricing page has the rates for your country.
How payments stay right
- Every webhook's signature is checked before it is read (a forged one is refused), and each event is stored with its gateway and event id in the same database transaction as its changes, so a delivery the gateway sends again is never applied twice, and an event that fails to apply stores nothing and is answered with an error, so the gateway sends it again.
- Payments and subscriptions are never deleted with a workspace or a plan, so refunds and disputes still find their invoices. Invoices are numbered AM-0001 and up.
- A cancelled plan runs to the end of its paid period. A closed workspace is never billed again: its subscription is cancelled at the gateway.
Each plan at each gateway
Each paid plan needs its price at every gateway you turn on, monthly and (if you sell it) yearly: a Stripe price ID (price_…), a PayPal plan ID (P-…), a Razorpay plan ID (plan_…) or a Paystack plan code (PLN_…). Create them at the gateway with the same amount and currency as the plan, then paste them into the plan in Platform admin → Plans, under "Prices at your payment gateways", and save. Leave a gateway empty if you don't use it. Askmark stores the IDs exactly as typed: a Stripe price ID must start with price_, and the others must be one word. It does not compare the amount with the gateway, so check that each price matches the plan before you open sign-ups, ideally with a test checkout.
Stripe
- In the Stripe Dashboard, switch to Test mode first. Under Developers → API keys, copy the Secret key (
sk_test_…) and the Publishable key. - Paste them into Platform admin → Payments → Stripe (or
STRIPE_SECRET_KEYandSTRIPE_PUBLISHABLE_KEYin.env). - In Stripe, open Product catalog → Add product for each paid plan, with a recurring monthly price and, if you sell yearly, a recurring yearly price, and copy each price ID into the plan (above).
- Open Developers → Webhooks → Add endpoint with the URL
https://chat.yourbrand.com/api/v1/webhooks/stripe(yourAPP_URLplus/api/v1/webhooks/stripe) and these events:checkout.session.completed,customer.subscription.created,customer.subscription.updated,customer.subscription.deleted,invoice.paid,invoice.payment_succeeded,invoice.payment_failed,charge.refunded,charge.dispute.created,charge.dispute.closed,customer.updated,customer.tax_id.created,customer.tax_id.updated,customer.tax_id.deleted,payment_method.attachedandpayment_method.updated. - Copy the endpoint's Signing secret (
whsec_…) into Payments → Stripe (orSTRIPE_WEBHOOK_SECRET). Without it, paid plans never switch on, and the setup check says so. - In Stripe, open Settings → Billing → Customer portal and activate it, with payment method updates, invoice history and cancellation turned on. Owners reach it from Settings → Plan and billing → Billing portal.
- Test a full upgrade with Stripe's test card
4242 4242 4242 4242. Then go live: repeat these steps in live mode with your live keys, live price IDs and a live webhook.
PayPal
- At developer.paypal.com, open Apps and Credentials, stay on Sandbox for testing and create a REST app. Copy its Client ID and Secret.
- For each paid plan, create a product and a subscription plan (monthly, and yearly if you sell it) in PayPal, and copy each plan ID (
P-…) into the plan in Askmark. - In the app, add a webhook with the URL
https://chat.yourbrand.com/api/v1/webhooks/paypaland these events:BILLING.SUBSCRIPTION.ACTIVATED,BILLING.SUBSCRIPTION.RE-ACTIVATED,BILLING.SUBSCRIPTION.UPDATED,BILLING.SUBSCRIPTION.CANCELLED,BILLING.SUBSCRIPTION.SUSPENDED,BILLING.SUBSCRIPTION.EXPIRED,BILLING.SUBSCRIPTION.PAYMENT.FAILED,PAYMENT.SALE.COMPLETED,PAYMENT.SALE.REFUNDED,PAYMENT.SALE.REVERSED,PAYMENT.CAPTURE.REFUNDEDandPAYMENT.CAPTURE.REVERSED. Copy the Webhook ID: Askmark checks every PayPal event through PayPal's own signature check with it. - Paste the client ID, client secret and webhook ID into Platform admin → Payments → PayPal, with the mode
sandboxwhile testing (orPAYPAL_CLIENT_ID,PAYPAL_CLIENT_SECRET,PAYPAL_WEBHOOK_IDandPAYPAL_MODEin.env). - Test an upgrade with a sandbox buyer account. To go live, switch to Live in the developer dashboard, make a live app, plans and webhook, paste their values and set the mode to
live.
When a PayPal subscription is cancelled, PayPal stops billing at once; Askmark keeps the plan to the end of the period already paid.
Razorpay
- In the Razorpay Dashboard, switch to Test Mode, open Account and Settings → API Keys and generate a key: copy the Key ID (
rzp_test_…) and Key Secret. Subscriptions must be enabled on your account. - Under Subscriptions → Plans, create a plan for each paid plan and interval, and copy each plan ID (
plan_…) into the plan in Askmark. - Under Webhooks → Add new webhook, use the URL
https://chat.yourbrand.com/api/v1/webhooks/razorpay, choose a secret, and selectsubscription.activated,subscription.charged,subscription.updated,subscription.resumed,subscription.pending,subscription.halted,subscription.cancelled,subscription.completed,payment.refundedandrefund.processed. Every event is checked with that secret (X-Razorpay-Signature). - Paste the key ID, key secret and webhook secret into Platform admin → Payments → Razorpay (or
RAZORPAY_KEY_ID,RAZORPAY_KEY_SECRET,RAZORPAY_WEBHOOK_SECRET). - Test with Razorpay's test cards, then repeat in Live Mode with live keys, plans and webhook. A cancelled Razorpay subscription stops at the end of its billing cycle.
Paystack
- In the Paystack Dashboard, open Settings → API Keys and Webhooks in test mode and copy the Secret key (
sk_test_…) and Public key. - Under Plans, create a plan for each paid plan and interval (monthly or annually), and copy each plan code (
PLN_…) into the plan in Askmark. - On the API Keys and Webhooks page, set the Webhook URL to
https://chat.yourbrand.com/api/v1/webhooks/paystack. Paystack sends every event there and signs it with your secret key (x-paystack-signature), so there is no separate webhook secret; Askmark readscharge.success,subscription.create,subscription.enable,subscription.not_renew,subscription.disable,invoice.payment_failedandrefund.processed. - Paste both keys into Platform admin → Payments → Paystack (or
PAYSTACK_SECRET_KEYandPAYSTACK_PUBLIC_KEY). - Test with Paystack's test cards, then switch the dashboard to live mode and paste the live keys, plan codes and webhook URL.
17The platform admin
The platform admin is your side of Askmark, under /platform. The install wizard makes you its first admin.
Overview
Revenue, paying workspaces and trials, workspaces at risk (failed payments, trials ending, plans almost used up), replies this month and the AI cost of your keys at list prices, the busiest workspaces, and what needs you.
Workspaces
Search and filter by status and plan. Create a workspace opens one for a customer: its name, the owner's email and the plan, whose free trial starts at once. An owner who has no account yet gets an email with a link to choose a password. A workspace's details show its plan, usage, members, subscription and payments, and let you:
- Change the plan by hand (no gateway is charged);
- Suspend or reactivate it (suspending emails the owners; a suspended workspace can read everything and pay, but its assistants stop answering and nothing can be changed);
- Close it: its paid plan is cancelled and its data is deleted 30 days later (chapter 14);
- Open as owner, to see exactly what the customer sees: a 30-minute session that is written to the audit log and can never reveal secrets or reach the platform admin.
Plans, payments, AI providers
- Plans: chapter 15. Payments: the gateways (chapter 16), every invoice (paid, failed, refunded) and every subscription with its status and renewal date.
- AI providers: the platform's keys and models (chapter 6), which plans may bring their own keys, and this month's AI cost.
- Email and brand: chapters 18 and 19. Languages: chapter 21. Setup check: chapter 5.
The price table
The list prices every cost figure uses (chapter 7) are kept per model. Every workspace sees them, read-only, beside its AI settings; a super-admin changes a model's input and output prices, or adds a model that is not in the table yet, with PUT /api/v1/provider-prices/{model} (chapter 33). A model that is not in the table is priced by its provider's row for other models. Saved prices are kept for the whole platform; models added to the built-in table by a later update still show up.
Platform staff
Platform admin → Users lists every person across every workspace, with the tabs All, Platform staff and Suspended. Give a person a Platform role:
- Admin: everything you can do.
- Viewer (read-only): reads every platform page and is refused every change, for a bookkeeper or an investor.
- None: a normal customer account.
Suspend signs a person out everywhere and stops them signing in until you Reactivate them; their workspaces keep running. You can never change your own role or suspend yourself, and the last platform admin can never lose the role.
18White label and rebrand
Your brand
Platform admin → Email and brand changes the product name, the logo, the main colour, the support email and the public site address without touching code. They show in the sidebar, the sign-in and sign-up pages, the public landing and pricing pages, the emails, the widget's "Powered by" line (your product name) and the browser tab, on the next page load. The app works out the lighter and darker shades of the colour for both themes. The logo must be a PNG, SVG or WebP of at most 1 MB; SVG files with scripts are refused.
Legal pages
The same page edits the terms of service, privacy policy and refund policy linked from the public pages: a blank line starts a paragraph, a line starting with # is a heading. Until you save your own, each page shows sample text with a note to replace it. Write your own: they are your agreement with your customers.
Your customers' white label
A workspace on a plan with White label puts its own name, logo and colour on its widget and on the emails it sends to visitors and its team, and can hide "Powered by" under its chats (chapter 10). Platform notices (payments, limits) stay yours.
Help links
Askmark never links to an address of ours. Set your own in Platform admin → Email and brand:
- Help docs: where you publish your customers' help (for example this guide,
docs/index.html). It is the Help and docs link in the account menu and the sidebar, and the public site's Docs link. - Support page: where people ask for help. The help links use it when there is no Help docs address, and the public site's and the sign-in page's Status link goes there.
- Support email: the public site's Contact link.
Fill in all three before you go live: until you do, the account menu hides its help link and the other links point to a placeholder address (askmark.example) that leads nowhere.
Search engines
Askmark answers /robots.txt itself: search engines may index the public pages (landing, pricing, legal pages, sign-in and sign-up), while the workspaces, the platform admin, the install wizard, invitation and reset links, and the API stay closed. With SEARCH_INDEXING=off in .env, for a staging copy, /robots.txt closes every page and every answer also carries X-Robots-Tag: noindex, nofollow. Restart the app after changing it.
To change the public landing and pricing pages' text, or anything else beyond these settings, edit the React pages (chapter 32) and rebuild.
19Email (SMTP)
Askmark sends password reset links (valid one hour), team invitations (valid 7 days), notices to the team (a new chat, a visitor waiting, a new lead), emails to visitors (a teammate's reply after they left, a transcript they asked for), and notices to owners and admins (a payment failed, a plan limit was reached, a workspace was suspended, a trial ended, a webhook was turned off). Each platform notice goes out at most once per event; emails never hold up the chat or the request that caused them, because jobs send them.
- Get SMTP details from any email provider (Amazon SES, Postmark, Brevo, Mailgun, your own mail server…): host, port, user name, password and a sender address on a domain you have verified with that provider.
- Enter them in Platform admin → Email and brand → SMTP (or the
SMTP_*keys in.env). Usestarttlson port 587,tlson port 465. - Press Send test email with your own address, or Test on the Email row of the setup check.
Without SMTP, each email is written to the app's log with its link (docker compose logs app), which is enough for testing. The wording of every email is shown on the same page and can be changed there. Besides account emails (password resets, invites, payment notices), Askmark emails visitors their transcripts, a teammate's late replies and their booking emails (confirmed, moved, cancelled; chapter 12), and the team its waiting, lead and booking notices. Demo workspaces only ever write their emails to the log.
Your email provider is a third-party service with its own pricing (for example about $0.10 per 1,000 emails at Amazon SES); you pay for the emails Askmark sends.
20File storage
Knowledge files, assistant pictures, workspace logos and exports are kept in file storage. Files are private: the browser gets them only through the app, which checks the workspace first.
- The bundled MinIO (the default with Docker): an S3-compatible store on the same server, in the
minio-dataDocker volume. Docker creates its bucket on the first start. SetS3_SECRET_ACCESS_KEYin.envto a password of your own. - Any S3-compatible bucket (AWS S3, Cloudflare R2, Backblaze B2, Wasabi, DigitalOcean Spaces…): set
STORAGE_DRIVER=s3,S3_ENDPOINT,S3_REGION,S3_BUCKET,S3_ACCESS_KEY_IDandS3_SECRET_ACCESS_KEY. The bucket stays private. MinIO can then be left running unused or removed. - The server's own disk:
STORAGE_DRIVER=localkeeps files in/app/storage(theapp-storagevolume). Fine for one server; with several copies of the server (chapter 24) use a bucket.
Each plan caps a workspace's files (File storage); a workspace's use is the sum of its files. Test the storage with the setup check, which writes, reads and deletes a small file.
The bundled MinIO and the local disk cost nothing beyond your server. A cloud bucket is a third-party service with its own pricing (for example Cloudflare R2 at $0.015 per GB a month).
21Languages and right to left
- The widget speaks English, Spanish, French, German, Portuguese and Arabic. It picks the language from the snippet's
data-lang, else the assistant's language, else the visitor's browser. In Arabic it reads right to left. Each assistant can change any of the widget's words (chapter 9, Look). - The assistant's replies follow the visitor's language when the assistant speaks it (chapter 9), whatever the language of the knowledge: the model reads the sources and answers in the reply language.
- The web app has the same six interface languages. Each person picks theirs, the workspace has a default, and Arabic turns the whole app right to left, with an Arabic font (Noto Sans Arabic). The six catalogues hold the same keys, so no screen falls back to English.
- Platform admin → Languages previews every language's words. To add a language: copy
apps/frontend/src/i18n/locales/en.json, translate every value, add the language toLANGSinapps/frontend/src/i18n/index.ts, and rebuild. For the widget, add its words inapps/widget/src/i18n.ts.
22Background jobs and the scheduler
Work that talks to outside services or takes time runs in the background, inside the same askmark program: there is no separate worker to start. The job queue is a table in PostgreSQL; each job is claimed by one worker (several workers and server copies never run one job twice), retried after a failure with a growing wait (10 seconds, doubling, at most an hour), and picked up again after a crash. JOB_WORKERS (default 4, from 1 to 32) sets how many run in each server copy, and one job may run for at most 10 minutes.
| Job | When | What it does |
|---|---|---|
| Crawl | When a website is added, on Re-crawl now, and on its daily or weekly schedule | Reads the site (chapter 8). |
| Embed | After new or changed knowledge, and after the embedding model changes | Embeds the chunks that have no embedding of the current model, in batches. |
| Inbox emails | A new chat, a visitor waiting 60 seconds, a teammate's reply to a visitor who left | Emails the members who want it, or the visitor (chapter 11). |
| Webhook delivery | When a subscribed event happens, and on each retry | Sends the signed event (chapter 29). |
| Export clean-up | An hour after an export | Deletes the export file. |
| Housekeeping | Every hour | Clears expired sessions, rate-limit windows, reset links, old invitations and finished jobs older than 14 days; ends trials and plans nobody paid for; deletes workspaces closed more than 30 days ago. |
| Demo visitors and demo reset | Demo mode only | A new demo visitor every few minutes, and the demo put back as seeded at 03:00 UTC (chapter 23). |
A scheduler in every server copy looks every minute: due crawls and webhook retries are queued, and the hourly and daily jobs are queued once per period, however many copies are running. To check it all works: Platform admin → Setup check → Background jobs shows failed and waiting jobs with their reason and a Retry button; docker compose logs -f app shows the jobs as they run.
23Demo mode and the seed commands
Demo mode
DEMO_MODE="true" turns an install into a public demo, like the item's live preview. It is "false" in the shipped .env.example: never turn it on for a real platform. With it on:
- The demo data is added on start: Sunmere Solar, a solar installer on the Growth plan whose assistant "Sunny" answers its website's visitors, with its knowledge (pages, files and Q&A), 90 days of chats, leads, bookings and ratings, and two more businesses for the platform pages.
- The sign-in page shows one-click sign-ins: the owner, an agent who answers chats, and a read-only platform admin. They work inside the marketplace's preview frame too. One address can use them 60 times an hour.
- No AI provider is called. Sunny answers its suggested and most-asked questions with stored sample answers written from its knowledge, and other questions with a built-in stand-in; every demo reply is labelled "Demo sample" in the widget.
- New visitors keep arriving every few minutes, and some ask for a person, so the inbox and the live screens keep moving.
- Plan changes are test checkouts, the install wizard is off, demo emails only reach the log, and risky actions (AI keys, passwords, invitations, crawling and uploads, webhooks and API keys, platform settings and plans) are locked.
- The demo data is removed and added again every night at 03:00 UTC.
Seed commands
| Command | What it does |
|---|---|
docker compose exec app askmark seed-demo | Adds the demo data, every row marked as demo. It only adds rows and never deletes anything. It refuses to run on a database that has any real account; --confirm adds the demo next to real data anyway (for a staging copy). |
docker compose exec app askmark reset-demo | Removes the demo rows and adds them again. It refuses to run when the database holds any real account. |
Platform admin → Setup check → Remove demo data (super-admin; POST /api/v1/admin/demo-data/remove) | After asking, deletes only rows marked as demo: the sample workspaces with their people, chats, leads, bookings and payments. Your own account and settings stay, and a demo workspace that has a real payment or subscription is kept. It is locked on the public demo. |
docker compose exec app askmark migrate | Applies the database migrations and stops (the server also does this on every start). |
Deploy and maintain
24Deploy on a VPS
For a public launch, Askmark must be reachable at an https:// address: websites load the widget from it, the payment gateways send their webhooks to it, Google returns there after a calendar sign-in, and every email links there.
1. Pick a server
| Size | Good for |
|---|---|
| 2 cores, 4 GB memory, 40 GB disk | Building on the server and running a growing platform. The AI providers write the replies; the server searches the knowledge, streams the replies and serves the screens. |
| 1 to 2 cores, 1 to 2 GB memory | Running a build made on another computer (below), or building with swap added, for a small platform. |
| 4+ cores, 8+ GB memory | Many workspaces with large knowledge bases and busy widgets. Knowledge search runs in PostgreSQL, which is fastest when the search index fits in memory. |
Any provider that sells Linux servers with Docker works. Disk use grows mainly with knowledge and chats: every chunk keeps its text and a 1,536-number embedding with its search index, so plan a few hundred MB for every 10,000 pages of knowledge, plus the chats, and keep backups (chapter 26).
2. DNS
At your domain registrar, add an A record for the address you want (for example chat for chat.yourbrand.com) pointing at your server's IP address. Wait until ping chat.yourbrand.com shows that IP.
3. Settings
In .env:
APP_URL=https://chat.yourbrand.com
APP_DOMAIN=chat.yourbrand.com
TRUSTED_PROXY_HOPS=1
4. Start with HTTPS (Caddy)
When nothing else on the server uses ports 80 and 443, the bundled Caddy does it all. Open both ports in your server's firewall, then:
docker compose --profile https up -d --build
The https profile adds Caddy, a web server that gets and renews a free certificate for APP_DOMAIN by itself. Open https://chat.yourbrand.com; the first visit takes a few seconds while the certificate is issued. Caddy passes the live streams (the widget's replies and the inbox's updates) through unbuffered.
Caddy needs ports 80 and 443 for itself. If Traefik, Nginx Proxy Manager, Nginx or Apache already owns them, leave out --profile https, start with docker compose up -d --build and let your proxy pass visitors on to Askmark, as the next part shows.
Behind Traefik or another proxy you already run
- Installed on the server itself (Nginx or Apache from the system's packages): point it at
http://127.0.0.1:8080(APP_PORT), the port the app opens on this server only. - In a Docker container (Traefik, Nginx Proxy Manager, an Nginx container): it cannot use
127.0.0.1:8080, because inside a container that address is the container itself. Put the app on the proxy's Docker network instead, with acompose.override.yamlfile next tocompose.yaml; Docker Compose reads it by itself.docker network lsshows the proxy's network name; the examples call itproxy.
Traefik: the labels tell Traefik the address, the entrypoint and the certificate resolver. Use the entrypoint and resolver names from your own Traefik setup (websecure and letsencrypt are common).
# compose.override.yaml: Askmark behind a Traefik that runs in Docker
services:
app:
networks: [default, proxy] # default: the app's own database and storage
labels:
- traefik.enable=true
- traefik.docker.network=proxy # the same network name
- traefik.http.routers.askmark.rule=Host(`chat.yourbrand.com`)
- traefik.http.routers.askmark.entrypoints=websecure
- traefik.http.routers.askmark.tls.certresolver=letsencrypt
- traefik.http.services.askmark.loadbalancer.server.port=8080
networks:
proxy:
external: true
name: proxy # your proxy's network, as docker network ls shows it
Nginx in a container, or Nginx Proxy Manager: join the network the same way and give the app a name there that no other container uses.
# compose.override.yaml: Askmark on the network of an Nginx container
services:
app:
networks:
default:
proxy:
aliases: [askmark]
networks:
proxy:
external: true
name: proxy # your proxy's network, as docker network ls shows it
Then send the traffic to http://askmark:8080. In Nginx:
location / {
proxy_pass http://askmark:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_buffering off; # replies and live updates are streams
proxy_read_timeout 300s;
client_max_body_size 22m; # knowledge files go up to 20 MB
}
In Nginx Proxy Manager, add a Proxy Host with scheme http, forward hostname askmark and port 8080, request its SSL certificate, and paste the last four lines above into the Advanced tab. Then start the app with docker compose up -d --build and keep TRUSTED_PROXY_HOPS=1.
5. Visitor addresses and rate limits
Askmark limits sign-ins, sign-ups, password resets and widget messages per visitor address, so nobody can guess passwords or flood an assistant at speed. It reads the visitor's address from the X-Forwarded-For header only behind the number of proxies you trust, set with TRUSTED_PROXY_HOPS. A visitor can type any X-Forwarded-For they like, so trusting it without a proxy would let them make up a new address for every try.
| Your setup | Setting |
|---|---|
The bundled Caddy (--profile https) | TRUSTED_PROXY_HOPS=1 (the Docker default). The app port is published on 127.0.0.1 only, so Caddy is the only way in, and Caddy replaces any X-Forwarded-For a visitor sends with the real address. |
| Your own Nginx, Apache or Traefik on the same server | TRUSTED_PROXY_HOPS=1 and keep APP_BIND=127.0.0.1. Turn off response buffering so the widget's replies and live updates stream. |
| A load balancer or CDN in front of your proxy (for example Cloudflare, then Caddy) | TRUSTED_PROXY_HOPS=2: one hop for each proxy that adds an address. Never set a higher number than the proxies really in front of the app. |
| No proxy at all (app port open to the internet) | TRUSTED_PROXY_HOPS=0 and APP_BIND=0.0.0.0. No header is trusted, every visitor counts as one address, and the per-account and per-visitor-token limits still apply. Without HTTPS this suits only testing. |
Build on another computer
If your server is small, build the program on a bigger computer with Docker and copy it over. The packed program is one file that already holds the web app and the widget.
# on the bigger computer, in the askmark folder (use --platform linux/arm64 for an ARM server)
docker build -f docker/Dockerfile --target pack -t askmark-pack --platform linux/amd64 .
docker create --name askmark-pack-copy askmark-pack
mkdir -p prebuilt
docker cp askmark-pack-copy:/askmark prebuilt/askmark
docker rm askmark-pack-copy
# copy prebuilt/askmark into the same folder on the server, then on the server:
BUILD_TARGET=prebuilt docker compose --profile https up -d --build
Set BUILD_TARGET=prebuilt in .env to keep it for later starts. The program must match the server's processor type (Intel/AMD = linux/amd64, ARM = linux/arm64).
Without Docker
Build it as in chapter 3, Install without Docker, then run ./askmark serve behind your own HTTPS proxy and keep it running with a service manager such as systemd. The server applies the migrations when it starts; ./askmark migrate applies them on their own.
Several servers
Askmark can run as several copies of the same program behind one load balancer, for more traffic or no downtime: the job queue hands each job to one copy, live updates and saved settings reach every copy through PostgreSQL, and the sign-in limits are kept in the database. Give every copy the same .env (above all the same APP_SECRET) and the same DATABASE_URL, use a bucket for files (not STORAGE_DRIVER=local), and count the load balancer in TRUSTED_PROXY_HOPS. The other per-address limits are counted per copy.
Two copies on one server
To run a staging copy next to the live one, unzip Askmark into a second folder and give each copy its own .env:
# .env of the live copy
COMPOSE_PROJECT_NAME=askmark
APP_PORT=8080
APP_URL=https://chat.yourbrand.com
# .env of the staging copy
COMPOSE_PROJECT_NAME=askmark-staging
APP_PORT=8081
APP_URL=https://staging.yourbrand.com
SEARCH_INDEXING=off
COMPOSE_PROJECT_NAME keeps each copy's containers, database, files, network, image and build cache apart. Give each copy its own passwords and its own APP_SECRET, and its own AI keys if you can, so the staging copy's replies are not billed to the live keys. Only one copy can run the bundled Caddy, so put both behind one proxy you run yourself.
25Managed PostgreSQL and pgvector
The Docker stack runs its own PostgreSQL with pgvector, which is all most platforms need. To use a managed database instead, it must be PostgreSQL 15 or newer with the vector extension (pgvector 0.5 or newer, for the HNSW search index) and btree_gist.
Point the app at it
- Create a database and a login, and turn the extensions on (below).
- Put the connection string in
.envasDATABASE_URL, for examplepostgres://askmark:password@db.example.com:5432/askmark?sslmode=require. Use a direct or session-mode address, not a transaction-mode pooler: Askmark listens for live updates on its database connection. - With Docker, nothing else is needed: the stack hands the app the
DATABASE_URLfrom.envwhen it is set, and its own database otherwise. The bundled database then stays empty; leave it running (it uses little memory) or remove thepostgresservice fromdocker/docker-compose.ymltogether with the app'sdepends_onentry for it. - Run
docker compose up -d. The app adds the extensions when its login may, and applies the migrations.
Turn on pgvector
| Service | What to do |
|---|---|
| Neon | pgvector is built in. Run create extension vector; create extension btree_gist; in the SQL editor, or let Askmark do it. Use the connection string without -pooler in the host name. |
| Supabase | Database → Extensions: turn on vector and btree_gist. Use the direct connection or the session pooler (port 5432), not the transaction pooler (port 6543). |
| AWS RDS and Aurora PostgreSQL | pgvector is available on current versions. As the master user, run create extension vector; create extension btree_gist;. |
| Google Cloud SQL | pgvector is available. As the postgres user (a cloudsqlsuperuser), run the two create extension lines. |
| Azure Database for PostgreSQL (Flexible Server) | Server parameters → azure.extensions: add VECTOR and BTREE_GIST and save. Then run the two create extension lines. |
| DigitalOcean Managed PostgreSQL | pgvector is available. As doadmin, run the two create extension lines. |
"extension vector is not available"
The install wizard's database step shows this when the PostgreSQL server has no pgvector installed. Fix it where the database runs:
- Docker: the database image must be
pgvector/pgvector:pg17, as shipped, not the plainpostgresimage. If you changed it, change it back and rundocker compose up -d. - A managed database: turn the extension on as in the table above; on Azure it must be on the allow-list first.
- Your own PostgreSQL server: install the package for your version (on Debian and Ubuntu with the PostgreSQL apt repository:
apt install postgresql-17-pgvector), then runcreate extension vector; create extension btree_gist;as a superuser. - "permission denied to create extension" means the app's login may not add extensions: run the two lines once as the database's admin user.
Then press Check again in the wizard: the full app starts by itself.
26Backups, updates and exports
Back up
docker compose exec -T postgres sh -c 'pg_dump -U "$POSTGRES_USER" "$POSTGRES_DB"' > backup-$(date +%F).sql
Run it in the Askmark folder, every day (for example from cron), and keep copies off the server. It reads the database user and name from the postgres container; -T keeps a terminal out of the dump. Every chat, lead, booking and piece of knowledge your customers have lives in this database. With a managed database, use its own backups as well.
Also keep a copy of .env (above all APP_SECRET, without which the saved AI keys, gateway secrets and calendar tokens cannot be read) and of your files: the minio-data Docker volume, your own bucket, or the app-storage volume. Restore a database backup into an empty database with the pgvector image: docker compose exec -T postgres sh -c 'psql -U "$POSTGRES_USER" "$POSTGRES_DB"' < backup.sql.
Update
Docker names the stack, and with it the database volume, after the folder unless COMPOSE_PROJECT_NAME is set. If you move or rename the folder, set COMPOSE_PROJECT_NAME to the old folder name first, or the app starts with an empty database. Your data isn't lost; it's under the old name (docker volume ls shows it before _postgres-data).
- Back up as above.
- From the folder that holds
askmark/(not inside it), rununzip -o askmark-x.y.z.zipwith the new version's file name. The zip has a top-levelaskmark/folder, so it unpacks over your install. Your.env,compose.override.yamlandprebuilt/are kept, because the zip doesn't contain them. - Compare your
.envwith the new.env.example: this lists the keys your.envdoesn't have yet:
Copy the ones you need, with their comments, intocd askmark for k in $(grep -oE '^#? ?[A-Z][A-Z0-9_]*=' .env.example | tr -d '# ='); do grep -q "^$k=" .env || echo "$k"; done.env; a key you leave out keeps its default. - In the
askmarkfolder, rundocker compose up -d --build(with--profile httpson your server). The new version applies any new migrations when it starts; your data stays. Websites keep their snippet:/widget.jsserves the new widget, and visitors' browsers pick it up within a day. - If disk is tight, run
docker builder pruneafterwards to free the build cache.
If you changed the code, compare your changes with the new version first. CHANGELOG.md lists what changed and marks security fixes. New list prices in an update show up for models you have not edited yourself.
Exports
Each workspace can download all its data at any time (chapter 14), so a customer who leaves takes their chats, leads and knowledge with them. For the whole platform, the database backup above is the export.
27Security notes
What the server checks and limits, so you can answer your customers' questions and know what to keep safe.
Workspaces are kept apart
- The current workspace always comes from the signed-in session (or the API key), never from the request. Every query is filtered by it, knowledge search included, so a chat never reads another workspace's knowledge. Another workspace's id answers "not found".
- Roles are checked by the server on every request; the screens only hide what a role cannot use.
- The widget's requests carry the visitor's own token and are checked against the assistant's allowed websites before anything is read or written; a visitor sees only their own chats.
Accounts and sessions
- Passwords (at least 10 characters) are hashed with Argon2id. A password change or reset signs the person out on every other device.
- The session cookie (
am_session) is HttpOnly, Secure and SameSite=Lax (on the public demo only, cross-site, so the marketplace's preview frame can sign in); it lasts 30 days and is renewed while in use, or only until the browser closes when "keep me signed in" is off. - Every change made with the session cookie must carry the header
x-askmark: 1, which browsers cannot add from another site, so other sites cannot make changes for a signed-in person. - Session tokens, password reset links, invitations, API keys and visitor tokens are stored only as hashes.
- AI provider keys, gateway and SMTP secrets, calendar tokens and webhook secrets are sealed with AES-256-GCM, with a key derived from
APP_SECRET. KeepAPP_SECRETand your backups safe, and never change it after the install. - "Open as owner" sessions last 30 minutes, never renew, are audit-logged and cannot reveal secrets or reach the platform admin.
Outgoing calls
- Crawled websites, webhook addresses and OpenAI-compatible endpoints are typed by your customers, so every such call goes only to public addresses: never to a private, local, link-local or cloud-metadata address. The check runs after the name is resolved, and the connection is pinned to the checked address, so a name that changes its answer cannot reach your inside network.
ALLOW_PRIVATE_FETCH=truelifts this; keep it off. - Crawled pages are read with size and time limits (2 MB and 10 seconds a page); webhooks wait at most 10 seconds.
- AI provider keys never appear in logs or error messages. Every AI call is made by your server, never by a visitor's browser.
- The knowledge and the visitor's words are sent to the model as quoted data after the rules, and every reply is checked before it is shown (chapter 9), so a page or a visitor cannot make the assistant follow new instructions or link to a site outside the knowledge.
Rate limits
These limits are kept in PostgreSQL or per visitor, so they hold across restarts. They are keyed by a keyed hash of the account, the visitor token or the visitor address (taken only from trusted proxies, chapter 24), never by a plain address:
| Limit | Allowed | What it protects |
|---|---|---|
| Booking page views, per link | 120 per hour | Reads of one booking page an hour |
| Booking page changes, per link | 10 per hour | Changes from one booking page an hour |
| Transcript emails from the inbox, per chat | 5 per hour | Transcript emails from the inbox per chat an hour |
| Data exports, per workspace | 10 per hour | Exports a workspace may make in an hour (each one reads every chat it holds) |
| Sign-in, per address | 20 per 15 minutes | Sign-in attempts from one address |
| Sign-in, per account | 5 per 15 minutes | Wrong passwords for one account; after five the account waits, even for the right password |
| Sign-up, per address | 5 per hour | New accounts from one address |
| Password reset, per address | 5 per hour | Password reset emails asked for from one address |
| Password reset, per account | 3 per hour | Password reset emails sent to one account |
| Reset and invite links, per address | 20 per hour | Tries at a reset or invite link from one address |
| Demo sign-in, per address | 60 per hour | Public demo sign-ins from one address |
| Invites, per workspace | 50 per hour | Invites sent by one workspace |
| Widget messages, per visitor | 20 per minute | Messages one visitor may send a minute |
| Widget messages, per assistant (all its visitors) | 600 per minute | Messages one assistant takes a minute (all visitors together) |
| New chats, per visitor | 20 per hour | New chats one visitor may start an hour |
| Transcript emails, per chat | 3 per hour | Transcripts one chat may email an hour |
| Lead, contact and booking forms, per visitor | 10 per hour | Forms (lead, contact, booking) one visitor may send an hour |
Every other API call takes from short-term allowances in memory: each signed-in person may make 240 calls at once and then 20 a second, and all calls from one visitor address together (counted only behind a trusted proxy) 1,200 at once and then 60 a second. A REST API key may make 120 calls at once and then 4 a second. The payment webhooks are never limited. A refused call answers 429 with a Retry-After header.
Money
- Plans switch on only from verified gateway events; a workspace cannot give itself a plan. Plan limits and the reply meter are checked on the server and spent inside locked database steps, so parallel requests cannot go past them.
DEMO_PAYMENTSandDEMO_MODEare"false"in the shipped file; a fresh install never grants a plan without payment.- Payment and subscription records are never deleted with a workspace or a plan.
- The demo seed and reset commands touch only rows marked as demo and refuse to run on a database with real data (chapter 23).
What loads from other servers
The web app loads nothing from other servers: its fonts and icons are part of the build, and its pages send a Content-Security-Policy that allows scripts from your own address only. The widget loads only from your platform's address. Checkout and the billing portal open on the gateway's own pages, and a Google Calendar connection on Google's sign-in page.
Keep it safe
- Use https (chapter 24), long unique passwords and two-factor sign-in on your server, gateway, email and AI provider accounts.
- Set a monthly spending limit with each AI provider, as a second stop behind the plans' replies.
- Keep
.envand your backups private; anyone withAPP_SECRETand a backup can read the saved keys. - Install Askmark updates; security fixes are marked as such in the changelog.
For developers
28Architecture and money flow
Askmark is one compiled Rust program, askmark, next to PostgreSQL (with pgvector) and a file store. The program serves the web app, the widget's script, the API, the payment webhooks and the live streams, and runs the background jobs. There is no Redis, no separate worker and no Node.js server to run.
- The web app (React Router 7 in single-page mode, built with Vite) is attached to the program when it is built, so the program is the one file to ship. Public pages (landing, pricing, legal) are pre-rendered.
- The widget is plain TypeScript built into one file and served at
/widget.js. It talks only to/api/v1/widget/…with its visitor token, and receives replies as a stream (Server-Sent Events). - PostgreSQL holds everything, the job queue and the knowledge's embeddings included;
LISTEN/NOTIFYcarries live events and settings changes to every copy of the server. - The engines (
crates/engines) hold the AI provider clients behind one interface, the text tools (web pages, PDF, Word, Markdown, chunks, language, robots.txt, sitemaps) and the price table.
Money flow: paying for a plan
A plan switches on only from the gateway's signed webhook, never from the browser coming back from checkout. The event's id is stored in the same transaction as its effect, so every delivery is applied exactly once, and every apply step is safe to run twice.
Money flow: one reply, one credit
The credit is claimed before the AI provider is called, inside a locked database step that also counts the month, so replies that start at the same moment cannot pass the plan's limit, and a message the widget sends twice (same clientId) is never counted twice. When the call fails, the credit is given back once. "I don't know" and "not set up yet" replies call no model and claim nothing.
29REST API, webhooks and MCP
On plans with API keys, webhooks and MCP, a workspace's systems can read and change its data, hear about events as they happen, and let AI apps work with it. Owners and admins set it up in Developers.
The REST API
- Developers → API keys → Create key, with a name, a note and its scopes:
read(lists and reads) orwrite(also creates and changes: leads, Q&A, replies as an agent). The key (am_live_…) is shown once; afterwards only its prefix is listed, with when it was last used. Revoke stops it at once. - Send it as a Bearer token, without a cookie:
curl "https://chat.yourbrand.com/api/v1/leads?status=new" \ -H "Authorization: Bearer am_live_…"
- A key may call the documented routes of its own workspace under
/assistants,/sources,/documents,/qa,/knowledge/test,/chats,/leads,/bookings,/calendarsand/analytics(chapter 33 lists every route). It acts as the member who made it, never with more than their current role and at most as an admin; a read-only key acts as a viewer. A key whose maker left the workspace stops working. - A workspace whose plan has no API access gets
402 plan_limit; a key may make 120 calls at once and then 4 a second (429withRetry-Afterabove that). - Writes are the same as the web app's:
POST /api/v1/qawith{"question": "…", "answer": "…"}adds a Q&A pair,POST /api/v1/chats/{id}/replywith{"body": "…", "clientId": "…", "takeOver": true}answers a visitor as the key's member.
Webhooks
Developers → Webhooks → Add endpoint with an https address and the events it wants (none picked = all). Askmark then sends a signed POST for each event:
| Event | When |
|---|---|
chat.started | A visitor starts a chat. |
chat.waiting | A visitor asks for a person. |
chat.closed | A chat is closed. |
lead.created | A visitor leaves their details, or the team adds a lead. |
booking.created | A time is booked. |
booking.cancelled | A booking is cancelled. |
The body is JSON: {"id": "…", "event": "lead.created", "createdAt": "…", "data": {…}}, where data is the chat, lead or booking as the API shows it. The headers Askmark-Event and Askmark-Delivery name the event and the delivery, and Askmark-Signature: t=<unix time>,v1=<hex> signs it: v1 is the HMAC-SHA256 of t, a dot and the raw body, keyed with the workspace's signing secret (Developers → Webhooks → Secret, it starts with whsec_). Check it before you trust a delivery, and refuse one whose time is more than 5 minutes off.
Verify a delivery in Node.js
import crypto from "node:crypto";
// rawBody: the request body exactly as received (a Buffer), before any JSON parsing.
export function verifyAskmark(secret, header, rawBody, toleranceSeconds = 300) {
const parts = Object.fromEntries(header.split(",").map((p) => p.trim().split("=")));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
const expected = crypto.createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest("hex");
const given = Buffer.from(parts.v1 ?? "", "hex");
const wanted = Buffer.from(expected, "hex");
return given.length === wanted.length && crypto.timingSafeEqual(given, wanted);
}
Verify a delivery in PHP
<?php
function verify_askmark(string $secret, string $header, string $rawBody, int $tolerance = 300): bool {
$parts = [];
foreach (explode(',', $header) as $part) {
[$k, $v] = array_pad(explode('=', trim($part), 2), 2, '');
$parts[$k] = $v;
}
$t = (int) ($parts['t'] ?? 0);
if ($t === 0 || abs(time() - $t) > $tolerance) return false;
$expected = hash_hmac('sha256', $t . '.' . $rawBody, $secret);
return hash_equals($expected, $parts['v1'] ?? '');
}
$ok = verify_askmark(getenv('ASKMARK_WEBHOOK_SECRET'), $_SERVER['HTTP_ASKMARK_SIGNATURE'] ?? '', file_get_contents('php://input'));
Retries and missed deliveries
- Answer with any
2xxwithin 10 seconds. Anything else is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours; then the delivery is marked failed. - An endpoint that has failed for 24 hours without one success is turned off, and the workspace's admins get one email.
- Every delivery is listed with its tries and the answer it got. Send again sends one delivery again; Resend failed sends every failed delivery of an endpoint again. A delivery sent again keeps its event
id, so your receiver can drop one it has already handled. - After a long outage, read what you missed from the REST API (
GET /api/v1/leads,/chats,/bookings) and compare by id. - Test sends a signed
testevent at once and shows the answer. Rotate secret makes a new signing secret for every endpoint of the workspace.
The MCP server
Askmark is also an MCP server, so Claude, ChatGPT and other AI apps can read and act on a workspace in plain words ("Which questions couldn't Sunny answer this week?"). It answers at your APP_URL plus /mcp over Streamable HTTP (one JSON-RPC 2.0 message per POST, answered as JSON; MCP protocol versions 2025-06-18, 2025-03-26 and 2024-11-05) and signs in with the same API keys. Each tool calls the REST route it stands for with the same key, so the key's workspace, role, scopes and plan limits are exactly the REST API's; a tool that changes something needs a write key. Developers → MCP shows the address, each tool with the scope it needs, a button to create a key for it, and the latest calls.
- Claude Desktop: Settings → Developer → Edit config, add the server, then restart Claude:
{ "mcpServers": { "askmark-sunmere": { "url": "https://chat.yourbrand.com/mcp", "headers": { "Authorization": "Bearer am_live_…" } } } } - ChatGPT: Settings → Connectors → add a custom connector with the address and the
Authorizationheader. - Other apps: any MCP client that speaks Streamable HTTP; a raw request is
POST /mcpwith{"jsonrpc":"2.0","id":1,"method":"tools/list"}.
| Tool | What it does |
|---|---|
search_knowledge | Searches the knowledge (pages, files, Q&A) the way the assistant does, and gives the best passages with their sources. |
list_chats, get_chat | Chats, newest first, with their state and visitor; one chat with its messages (team notes included) and the visitor's lead and bookings. |
reply_to_chat | Replies to a chat as a person, taking over a chat nobody has yet; the assistant then pauses. Needs a write key. |
list_leads, update_lead | Leads, newest first, with status and owner; changes a lead's status or owner (write). |
list_bookings | Bookings from a date for a number of days. |
add_qa | Adds a question and answer to the knowledge, counted toward the plan's pages (write). |
get_analytics | Chats, resolution, handovers, leads, bookings, ratings and top questions for the last 7, 30 or 90 days. |
The widget's API
The widget's own routes (/api/v1/widget/… in chapter 33) are public by design: they need no session, only the visitor token the widget makes (X-Visitor-Token), and each one checks the page's site against the assistant's allowed websites. A message is answered as a Server-Sent Events stream: the stored visitor message, the reply's words, then the stored reply (or the chat's new state when a person has it). Use them only to build your own chat window; for anything else use the REST API.
Import formats
| What | Format |
|---|---|
| Websites | HTML pages, found through robots.txt sitemaps or /sitemap.xml (sitemap indexes and .xml.gz files followed) and links. The main text is kept; menus, footers and scripts are dropped. |
| Files | PDF (its text layer), Word .docx, plain text .txt and Markdown .md, up to 20 MB each, through the screen or POST /api/v1/sources/{id}/files (multipart). |
| Q&A pairs | One at a time on the screen or with POST /api/v1/qa, or many at once with Import CSV (chapter 8): UTF-8, columns question,answer and an optional source_url, an optional header row, commas (or semicolons), up to 2,000 rows and 2 MB. A question already there gets the new answer. |
| Leads | Out as CSV from Leads; the whole workspace out as JSON or CSV (chapter 14). |
30Every key, explained
Every setting in .env. The outside-service keys can also be set in the platform admin, which takes precedence. This table is generated from .env.example and the server's own settings code when the release is built.
| Key | Required | What it does |
|---|---|---|
| Required | ||
APP_URL | Yes | The public address of the app, without a trailing slash, for example https://help.example.com. The widget snippet, the links in emails, the payment webhook addresses, the Google Calendar sign-in return address and secure cookies all come from it. Use https on a public server. |
APP_SECRET | Yes | A long random string of at least 32 characters (openssl rand -hex 32). It seals the AI provider keys, calendar tokens, webhook secrets and the other secrets you save, signs export links, and keys the hashed visitor tokens and addresses. Never change it after the install: saved keys could no longer be read. |
POSTGRES_DB | No | The name of the database the stack creates. Default askmark. |
POSTGRES_USER | No | The database user the stack creates. Default askmark. |
POSTGRES_PASSWORD | Yes | The database password. Letters and digits only, because it goes into a connection address. Docker refuses to start without it. |
DATABASE_URL | Outside Docker | The database address, only when you run the server without Docker or use a managed database, for example postgres://askmark:password@db.example.com:5432/askmark?sslmode=require. The database needs the vector (pgvector) and btree_gist extensions (chapter 25). With Docker, the stack uses it when it is set. Leave it empty with the bundled database: the stack builds its own from the three keys above. |
INSTALL_TOKEN | No | The token the install wizard asks for. Empty: a new one is printed in the app's log at every start until the install is finished (docker compose logs app | grep -i "install token"). |
| File storage (uploads, workspace pictures, white label logos, the brand logo) | ||
STORAGE_DRIVER | No | s3 (the bundled MinIO, AWS S3, Cloudflare R2 or any S3-compatible store) or local (files in a Docker volume). Default in Docker s3. |
S3_ENDPOINT | With s3 | The storage address. The bundled MinIO is http://minio:9000; for R2 use your account's S3 address; for AWS S3 leave it empty. |
S3_REGION | No | The bucket's region. Default us-east-1; R2 uses auto. |
S3_BUCKET | No | The bucket name. Default askmark; the stack creates it in MinIO. |
S3_ACCESS_KEY_ID | With s3 | The storage access key. With the bundled MinIO this is also its admin user. |
S3_SECRET_ACCESS_KEY | Yes | The storage secret, at least 8 characters. With the bundled MinIO this is also its admin password, so Docker refuses to start without it. |
| Payments (all optional; every gateway left empty = paid plans off) | ||
STRIPE_SECRET_KEY | For Stripe | Your Stripe secret key (sk_live_…, or sk_test_… while testing), from Stripe → Developers → API keys (chapter 16). |
STRIPE_WEBHOOK_SECRET | For Stripe | The signing secret (whsec_…) of your Stripe webhook endpoint <APP_URL>/api/v1/webhooks/stripe. Without it, Stripe payments never switch a plan on (chapter 16). |
STRIPE_PUBLISHABLE_KEY | No | Your Stripe publishable key (pk_…). Shown next to the secret key in the platform settings, so you can see which Stripe account is in use. |
PAYPAL_CLIENT_ID | For PayPal | The client id of your PayPal REST app, from developer.paypal.com → Apps and credentials (chapter 16). |
PAYPAL_CLIENT_SECRET | For PayPal | The secret of the same PayPal REST app. |
PAYPAL_WEBHOOK_ID | For PayPal | The id PayPal gives the webhook that points at <APP_URL>/api/v1/webhooks/paypal. Askmark asks PayPal to verify every event against it. |
PAYPAL_MODE | For PayPal | sandbox while you test with PayPal's sandbox accounts, live for real payments. Use the sandbox app's id and secret with sandbox. |
RAZORPAY_KEY_ID | For Razorpay | Your Razorpay key id (rzp_test_… or rzp_live_…), from the Razorpay Dashboard → Account and settings → API keys (chapter 16). |
RAZORPAY_KEY_SECRET | For Razorpay | The key secret shown once with that key id. |
RAZORPAY_WEBHOOK_SECRET | For Razorpay | The secret you type when you add the webhook <APP_URL>/api/v1/webhooks/razorpay in Razorpay. Every event is checked against it (X-Razorpay-Signature). |
PAYSTACK_SECRET_KEY | For Paystack | Your Paystack secret key (sk_test_… or sk_live_…), from the Paystack Dashboard → Settings → API keys and webhooks. It also checks every webhook to <APP_URL>/api/v1/webhooks/paystack (x-paystack-signature, chapter 16). |
PAYSTACK_PUBLIC_KEY | No | Your Paystack public key (pk_…), shown in the platform settings so you can see which Paystack account is in use. |
DEMO_PAYMENTS | No | "true" turns on a test checkout that changes plans without any payment. It is "false" in the shipped file: keep it that way on a live site (chapter 16). |
| Email (SMTP; empty = emails are written to the app's log) | ||
SMTP_HOST | For email | Your email provider's SMTP server. Empty: emails (password resets, invites, new-chat and waiting notices, replies to visitors who left, transcripts, lead and booking notices) are written to the app's log instead of being sent. |
SMTP_PORT | No | The SMTP port. Default 587. |
SMTP_USERNAME | For email | The SMTP user name. |
SMTP_PASSWORD | For email | The SMTP password or API key. |
SMTP_SECURE | No | starttls (port 587, the default), tls (port 465) or none. |
SMTP_FROM | For email | The sender, for example Askmark <help@example.com>. Use an address on a domain your provider has verified. |
| AI providers (optional) | ||
OPENAI_API_KEY | No | The platform's OpenAI key (sk-…, from platform.openai.com → API keys), for replies and embeddings. Used for every workspace without a key of its own, unless a key saved in the platform admin → AI providers takes its place (chapter 6). OpenAI bills you for every reply and every embedded page. |
ANTHROPIC_API_KEY | No | The platform's Anthropic (Claude) key (sk-ant-…, from console.anthropic.com → API keys). Replies only: Anthropic has no embedding models, so pair it with an OpenAI, Gemini or OpenRouter key for embeddings (chapter 6). |
GEMINI_API_KEY | No | The platform's Google Gemini key (AIza…, from Google AI Studio → Get API key), for replies and embeddings (chapter 6). |
OPENROUTER_API_KEY | No | The platform's OpenRouter key (sk-or-…, from openrouter.ai → Keys), for replies and embeddings through OpenRouter's many models (chapter 6). |
| Calendars (optional) | ||
GOOGLE_CLIENT_ID | For Google Calendar | The client id of your Google OAuth client, from Google Cloud Console → APIs and services → Credentials (chapter 12). It can also be saved in Platform admin → Setup check → Google Calendar sync, which takes precedence. |
GOOGLE_CLIENT_SECRET | For Google Calendar | The client secret of the same Google OAuth client. |
| Network | ||
APP_PORT | No | The port on this server where the app answers. Default 8080. |
APP_BIND | No | Which address the port is open on. Default 127.0.0.1: this server only, so visitors come in through Caddy or your own proxy. Use 0.0.0.0 only with TRUSTED_PROXY_HOPS=0 or a firewall that lets only your proxy reach the port. |
APP_DOMAIN | With Caddy | The domain Caddy gets an HTTPS certificate for: the host of APP_URL, for example help.example.com. |
TRUSTED_PROXY_HOPS | No | How many reverse proxies in front of the app add the visitor's address to X-Forwarded-For. 1 = the bundled Caddy (the default in Docker); 0 = trust no proxy. Never set it higher than the proxies really in front of the app (chapter 24). |
ALLOW_PRIVATE_FETCH | No | "true" lets crawled websites, outgoing webhooks, OpenAI-compatible endpoints and calendars reach private, local and cloud-metadata addresses. Only for a model server or website on your own network that you trust; keep "false" (chapter 27). |
| Advanced | ||
COMPOSE_PROJECT_NAME | No | Only for a second copy on the same server (for example staging): give each copy its own name, so their containers, database, files, network, image and build cache stay apart. Empty = the name of the Askmark folder (chapter 24, Two copies on one server). |
SEARCH_INDEXING | No | on (the default): search engines may index the public pages (landing, pricing, legal, sign-in), never the app or the API. off, for a staging copy: /robots.txt closes every page and every answer carries X-Robots-Tag: noindex, nofollow. |
JOB_WORKERS | No | Background job workers in this server (crawls, embeddings, emails, webhook deliveries, housekeeping), 1 to 32. Default 4 (chapter 22). |
DEMO_MODE | No | Only for a public demo: "true" seeds the demo business and its one-click sign-ins, answers every visitor from stored sample answers (no paid AI call), sends no real email, locks risky actions and resets the data every night (chapter 23). It is "false" in the shipped file: never turn it on for a live site. |
RUST_LOG | No | How much the server logs: info (the default), warn or debug. |
STRIPE_API_URL | No | For tests only: another address for Stripe's API. |
GOOGLE_API_URL | No | For tests only: one address for Google's sign-in, token and Calendar endpoints. |
CALCOM_API_URL | No | For tests only, or a self-hosted Cal.com: another address for Cal.com's API. |
PAYPAL_API_URL | No | For tests only: another address for PayPal's API (PAYPAL_MODE picks the sandbox or the live one). |
RAZORPAY_API_URL | No | For tests only: another address for Razorpay's API. |
PAYSTACK_API_URL | No | For tests only: another address for Paystack's API. |
| Set by Docker, or for development | ||
ASSET_ARCHIVE | No | For your own zero-downtime deploys: a folder that keeps older builds' files, so pages still open in a browser keep working. |
BIND | No | The address the server listens on. Default 0.0.0.0: plus PORT. |
BUILD_TARGET | No | How Docker gets the program: built (the default, built on this server) or prebuilt (uses prebuilt/askmark, built elsewhere; chapter 24). |
DEMO_SITE_URL | No | Only with DEMO_MODE: the address of the demo business's website, which the demo knowledge links to and the demo widget may run on. |
DRAIN_SECS | No | For your own zero-downtime deploys: seconds a stopping server keeps answering while the health check reports it is stopping. Default 0. |
LOCAL_STORAGE_DIR | Set by Docker | The folder for files with STORAGE_DRIVER=local (/app/storage in Docker, a volume). |
PORT | Set by Docker | The port the server listens on inside its container (8080). |
READY_FILE | No | For your own zero-downtime deploys: the health check passes only once this file exists. |
WEB_DIST | Set by Docker | Where the built web app is, when it is not packed into the program. |
31File structure
askmark/
├── apps/
│ ├── backend/ the Rust server (Axum): crate askmark-server, program "askmark"
│ │ ├── src/main.rs the commands: serve, migrate, health, seed-demo, reset-demo, pack, export-assets
│ │ ├── src/lib.rs the HTTP app: /api/health, /api/v1, /widget.js, the web app, middleware
│ │ ├── src/api/ one module per area: auth, workspace, assistants, knowledge, chats, leads,
│ │ │ calendars, bookings, analytics, developers, widget, billing, providers, admin…
│ │ ├── src/answer/ the answer engine: prompt, the reply check, what to offer after a reply
│ │ ├── src/retrieval/ knowledge search (full-text + pgvector, reciprocal-rank fusion)
│ │ ├── src/crawler/ reading websites (sitemaps, robots.txt, the outgoing-call guard)
│ │ ├── src/knowledge/ sources, documents, chunks, file reading and the embedding job
│ │ ├── src/chats/ chats, messages and the handover state machine
│ │ ├── src/widget/ the widget's shared checks and /widget.js
│ │ ├── src/limits.rs plan limits and the message credits
│ │ ├── src/billing.rs checkout, portal, trials and signed gateway webhooks
│ │ ├── src/gateways/ Stripe, PayPal, Razorpay and Paystack behind one interface
│ │ ├── src/calendars.rs Google Calendar and Cal.com
│ │ ├── src/booking_mail.rs the booking emails to visitors and the team
│ │ ├── src/mcp.rs the MCP server at /mcp
│ │ ├── src/webhooks.rs outgoing webhooks, signing and retries
│ │ ├── src/jobs.rs the background job queue (PostgreSQL, FOR UPDATE SKIP LOCKED)
│ │ ├── src/settings.rs platform settings over .env, and the saved price table
│ │ ├── src/setup_check.rs the setup check rows and live tests
│ │ ├── src/demo.rs, demo/ the sample plans and the public demo
│ │ ├── tests/ server tests (need a PostgreSQL with pgvector)
│ │ └── README.md every module of the server, for developers
│ ├── frontend/ the web app (React Router 7, Vite, Tailwind CSS 4)
│ │ ├── src/routes.ts every page: URL → file (src/routes/ lists each area)
│ │ ├── src/pages/ workspace/, platform/, auth/, install/, public/ (with the booking page)
│ │ ├── src/ui/ buttons, tables, sheets, charts, toasts shared by the pages
│ │ ├── src/i18n/ the interface languages
│ │ ├── src/api/ the API client and types
│ │ ├── src/styles.css colours, fonts and sizes (design tokens)
│ │ └── e2e/ browser tests (Playwright)
│ └── widget/ the website widget (plain TypeScript, Shadow DOM)
│ ├── src/main.ts the script tag, window.Askmark and start-up
│ ├── src/widget.ts the chat window; src/ui/ its parts (messages, forms, booking)
│ ├── src/i18n.ts the widget's words in six languages
│ ├── test/, e2e/ unit tests (Vitest) and browser tests (Playwright)
│ └── build.mjs builds dist/widget.js
├── crates/engines/ AI provider clients, text tools, the price table, the demo's stand-in
├── migrations/ the database schema (applied on start)
├── docker/ Dockerfile, docker-compose.yml, Caddyfile
├── compose.yaml "docker compose up" from this folder
├── Cargo.toml, Cargo.lock the Rust workspace
├── rustfmt.toml, clippy.toml Rust formatting (lines up to 120 characters) and lint settings
├── .env.example every setting
└── docs/ this guide (HTML and PDF) and the third-party licences
32Customise the code
Run it for development
- Start a PostgreSQL with pgvector (for example
docker compose up -d postgreswithports: ["127.0.0.1:5432:5432"]added to the postgres service in acompose.override.yaml) and setDATABASE_URLin.env. For development setSTORAGE_DRIVER=local. - Start the server from
apps/backend:cargo run -- serve(it reads.envfrom the folder or the ones above it and listens on port 8080). - Start the web app from
apps/frontend:pnpm install, thenpnpm dev, and openhttp://localhost:5173. Calls to/apigo to the server on port 8080. Screens reload as you save. - Work on the widget from
apps/widget:pnpm install, thenpnpm devbuilds it and serves a test page with a stand-in API;pnpm buildwritesdist/widget.js, which the server serves at/widget.jswhile you develop.
Theme tokens
- Colours, fonts and sizes live in
apps/frontend/src/styles.cssas CSS variables, one block for light and one for dark ([data-theme="dark"]): surfaces (--bg,--surface,--surface-2,--line), text (--text,--text-2,--text-3), the brand (--brand,--brand-ink,--brand-soft,--on-brand), the visitor's message colour (--visitor), status colours (--up,--down,--warn,--blue) and the sidebar (--sidebar…). - The main colour set in Email and brand, and a workspace's white label colour, replace
--brandat run time, so most rebrands need no code. The widget takes its colour from each assistant's Look tab. - Fonts: Gabarito for headings, Geist for text, Geist Mono for numbers and code, Noto Sans Arabic for Arabic, all bundled with the app.
- Pages are in
apps/frontend/src/pages/, one folder per area;src/routes.tsmaps each URL to its file. The public landing and pricing pages are insrc/pages/public/.
Change the server
- Each area of the API is one module in
apps/backend/src/api/; itsroutes()function lists the addresses.apps/backend/README.mdlists every module. - How replies are written is in
apps/backend/src/answer/(prompt.rsfor the instructions,check.rsfor the reply check) and how knowledge is found insrc/retrieval/; the chunk size is incrates/engines/src/text/chunk.rs. - A database change is a new file in
migrations/namedYYYYMMDDHHMMSS_what.sql. Never edit a migration that has already run: the server checks them.
Tests, per suite
| Suite | Command | What it covers |
|---|---|---|
| Server | TEST_DATABASE_URL=postgres://user:password@127.0.0.1:5432/postgres cargo test -p askmark-server | The whole app in process against a real PostgreSQL with pgvector, one fresh database per test: sign-in, workspaces kept apart, knowledge and crawling (robots.txt, caps, the outgoing-call guard), answers and prompt injection, the take-over race, credits counted once, plan limits, billing, bookings (two visitors, one time), widget CORS, analytics, purge. Without TEST_DATABASE_URL these tests say so and pass. |
| Engines | cargo test -p askmark-engines | The AI provider clients against recorded replies (offline), errors, prices, and the text tools. |
| Rust checks | cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo deny check | Formatting (the shipped rustfmt.toml, 120 characters a line); lints; advisories and licences of every crate. |
| Web app | in apps/frontend: pnpm typecheck, pnpm lint, pnpm test, pnpm e2e | Types, Biome lint, Vitest unit tests (API client, language catalogues…), Playwright browser tests. |
| Widget | in apps/widget: pnpm typecheck, pnpm lint, pnpm test, pnpm e2e | Vitest unit tests (Markdown, colours, languages…) and Playwright tests of the whole widget against a stand-in API, including a host page with hostile styles, phones, keyboard and right to left. |
Worked example: add a provider
Most AI services speak the OpenAI Chat Completions format: then you need no code at all, only an OpenAI-compatible key with the service's base URL and model (chapter 6). For a service with its own format, all the work is in crates/engines:
- Add the kind to
ProviderKindincrates/engines/src/providers/mod.rs: the enum,ALL,as_str(the name stored in the database, for example"acme"),parse,label,needs_keyandcan_embed. - Add its default models and API address to
default_chat_model,default_embed_modelanddefault_base_urlinproviders/models.rs, and its list prices toDEFAULT_ROWSinproviders/pricing.rs. - Write
providers/acme.rsafter the model ofanthropic.rs: build the request, stream the reply's words through the shared HTTP and SSE helpers (which time the call and turn HTTP errors intoProviderError), report the token counts, and addtest_connection(and the embedding call, if it has one, giving 1,536 numbers). - Send the new kind to it in
chat_provider,embed_providerandtest_connectioninmod.rs. - Add a recorded success reply and a few error replies with a test next to the others in
crates/engines/tests/, and runcargo test -p askmark-engines. - On the web app, add the provider's name where the others are listed in the AI settings.
The server reads provider kinds from the engine and stores the new name in provider_keys.provider. If the provider needs a platform key in .env, add it to apps/backend/src/config.rs and env_key in apps/backend/src/ai_keys.rs.
Rebuild and deploy your changes
docker compose up -d --build # or with --profile https on your server
Docker rebuilds only what changed; a change to the web app or the widget alone reuses the compiled server. Keep your changes in a Git repository, so you can compare them with each new Askmark version.
33API reference
The web app uses the same /api/v1 API. These 222 addresses are generated from the server code when the release is built.
- JSON in and out with camelCase keys; times in ISO 8601 UTC; money in whole cents (
…Cents) or millionths of a dollar (…Micros); rates from 0 to 1. - Errors:
{"error": {"code": "…", "message": "…", "details": {…}}}. A plan limit answers402 plan_limitwith the limit it hit (for examplemessagesMonth,pages,assistants,seats,storageMb, or a feature such asapiAccess). A time someone else just booked answers409 slot_takenwith that day's free times indetails.slots. - Changes made with the session cookie need the header
x-askmark: 1; calls with an API key do not. - "Any member" means any member of the current workspace, viewers included; "Agent and up" an agent, admin or owner; "Platform admin (the read-only login reads)" lets the read-only platform login read too.
- Live events:
GET /api/v1/eventsis a Server-Sent Events stream for the current workspace (new chats and messages, chat states, typing, leads, crawl progress).
| Method | Address | Who may call it | What it does |
|---|---|---|---|
| System and the widget script | |||
GET | / | Anyone | The health check: 200 while the server is serving, 503 while a stopping copy hands over to a new one or the database still needs its extensions |
GET | / | Anyone | The running version: open pages compare it with their own and offer a reload after an update |
GET | / | Anyone | Tells search engines which pages they may index: the public pages, or none with SEARCH_INDEXING=off |
GET | / | Anyone (the widget script) | The chat widget script that websites load with one script tag; it reads the assistant's settings from the widget routes below |
| Public pages, install, the booking page and payment webhooks | |||
GET | / | Anyone | The brand, sign-up mode, demo sign-ins and what the web app needs before sign-in |
GET | / | Anyone | The public plans for the pricing page |
GET | / | Anyone | One legal page, body empty when the platform has not written its own text (404 for a page that does not exist) |
GET | / | Anyone, until the install is done (install token) | Whether the install wizard has run |
POST | / | Anyone, until the install is done (install token) | The wizard's database step: adds the extensions Askmark needs (pgvector and btree_gist) when they are missing |
POST | / | Anyone, until the install is done (install token) | Checks the install token and the setup before the wizard's last step |
POST | / | Anyone, until the install is done (install token) | Finishes the install: the super-admin, brand and sample plans (runs once) |
POST | / | Stripe (signed webhook) | A Stripe webhook event (signature checked, applied once) |
GET | / | Anyone | { booking, business: { name, logoUrl, color }, brand, calendarName, canChange } |
GET | / | Anyone | The free times of the booking's calendar, by the visitor's dates |
POST | / | Anyone | Moves the booking to another free time (409 with the day's fresh slots in details.slots when it was just taken) |
POST | / | Anyone | Cancels the booking |
POST | / | PayPal (signed webhook) | A gateway event, signature checked first (400 when forged), applied once |
POST | / | Razorpay (signed webhook) | A gateway event, signature checked first (400 when forged), applied once |
POST | / | Paystack (signed webhook) | A gateway event, signature checked first (400 when forged), applied once |
| Sign-in and account | |||
POST | / | Anyone | Creates an account and its first workspace (when sign-ups are open); country is kept with the workspace for the platform's lists |
POST | / | Anyone | Signs in with email and password (wrong passwords count down, then the account waits) |
POST | / | Signed in | Signs out of this browser |
GET | / | Signed in | The signed-in user, their workspaces, role and capabilities |
GET | / | Anyone | The signed-in user like /auth/me, or nobody (no error) when the browser is not signed in |
POST | / | Signed in | Makes another of the user's workspaces the current one |
POST | / | Signed in | Creates another workspace owned by the user |
POST | / | Anyone | Emails a password reset link when the email belongs to an account |
POST | / | Anyone | Sets a new password with a reset link and signs in (each link works once) |
GET | / | Anyone | Whose link this is (404 when it expired or was used) |
POST | / | Signed in | Ends an "open as owner" session and goes back to the super-admin's own |
GET | / | Anyone | What an invitation link is for (workspace, role, email) |
POST | / | Anyone | Accepts an invitation, signing in or creating the account |
PATCH | / | Signed in | Changes the user's name, email or picture |
POST | / | Signed in | Changes the password (the current one is asked for); other sessions end |
POST | / | Anyone, public demo only | One-click demo sign-in as the owner, the agent or the read-only platform admin (DEMO_MODE only) |
| Workspace, team, notices, files, export and live events | |||
GET | / | Any member | The current workspace |
PATCH | / | Admin or owner | Changes the workspace (white label needs the plan's feature; the phone is the business phone the widget shows) |
DELETE | / | Owner | Closes the workspace (owner only) |
POST | / | Admin or owner | The workspace picture (multipart file: PNG, JPEG or WebP up to 1 MB) |
DELETE | / | Admin or owner | Removes the workspace picture |
POST | / | Admin or owner | The white label logo (needs the plan's white label) |
DELETE | / | Admin or owner | Removes the white label logo |
GET | / | Anyone | A workspace picture or white label logo, with no sign-in (the name holds the file's hash: the widget and emails show it), cached for a year |
GET | / | Any member | The members and, for admins, the open invitations, with the seats used |
POST | / | Admin or owner | Invites someone by email as admin, agent or viewer |
POST | / | Admin or owner | Sends an invitation again with a new link |
DELETE | / | Admin or owner | Withdraws an invitation |
PATCH | / | Admin or owner | Changes a member's role (owners are changed only by an owner, and the last owner stays) |
DELETE | / | Admin or owner | Removes a member (never the last owner); their sessions leave the workspace |
GET | / | Any member | My notice choices in this workspace |
PUT | / | Any member | Saves my choices (any part of { chats: { email, browser }, waiting, leads, billing }) |
POST | / | Admin or owner | Exports everything the workspace holds as one JSON file or a zip of CSV files; the signed download link works for an hour |
GET | / | Anyone with the signed link, for an hour | The export file, for an hour after it was made, to whoever holds the signed link (403 link_expired after that, 404 for a wrong signature) |
GET | / | Any member | The live stream (Server-Sent Events) for the current workspace: new chats, messages, state changes and typing, with a heartbeat |
POST | / | Admin or owner | Uploads a file (multipart file: a picture, PDF, Word, CSV, Markdown or text file of at most 10 MB) |
GET | / | Any member | A workspace file, to members of that workspace only |
GET | / | Anyone | The uploaded brand logo (no sign-in; long cache, the name changes with the file) |
GET | / | Any member | { needsPerson, waiting, live, unread, messages }: chats waiting plus my chats whose visitor wrote last, chats waiting, visitors chatting in the last two minutes, unread notices, and this month's messages against the plan (max null = unlimited) |
GET | / | Any member | { rows: Notice[], unread } |
POST | / | Any member | Marks notices read |
| Plan and billing | |||
GET | / | Owner | The plan, subscription, usage, invoices and card on file |
GET | / | Owner | The plans a workspace can pick |
POST | / | Owner | Starts a plan change (Stripe Checkout link, test checkout, or a switch to a free plan) |
POST | / | Owner | A Stripe customer portal link (owner only) |
POST | / | Owner | Cancels the paid plan at the end of the period (owner only) |
| AI provider keys and list prices | |||
GET | / | Admin or owner | The workspace's AiStatus |
POST | / | Admin or owner | Calls the key the workspace answers with now, then answers its AiStatus with ok and error (409 when no key is set up anywhere) |
GET | / | Super-admin (the read-only login reads) | The platform's PlatformAi |
POST | / | Super-admin | Tests every platform key for real |
GET | / | Admin or owner | The workspace's own keys, hints only |
POST | / | Admin or owner | Adds a workspace key (plans with own AI keys only: 402 plan_limit ownAiKeys otherwise; 409 key_exists for a second key of a provider) |
PATCH | / | Admin or owner | Changes a workspace key |
DELETE | / | Admin or owner | Removes a workspace key |
POST | / | Admin or owner | Tests a workspace key |
GET | / | Super-admin (the read-only login reads) | The platform's keys, which .env keys are set, and demo mode |
POST | / | Super-admin | Adds a platform key |
PATCH | / | Super-admin | Changes a platform key |
DELETE | / | Super-admin | Removes a platform key |
POST | / | Super-admin | Tests a platform key |
GET | / | Any member | The list prices reply costs use |
GET | / | Super-admin (the read-only login reads) | The same list for the platform settings |
PUT | / | Super-admin | Changes the prices of a model (or adds the model) |
| Assistants | |||
GET | / | Any member | The workspace's assistants with their look, rules and widget key |
POST | / | Admin or owner | A new assistant (402 plan_limit assistants when the plan is full) |
GET | / | Any member | One assistant, with the snippet that puts its widget on a site |
PATCH | / | Admin or owner | Changes the fields sent |
DELETE | / | Admin or owner | Archives it (its chats stay; its widget stops answering) |
POST | / | Admin or owner | A new widget key (the old snippet stops working) |
POST | / | Admin or owner | Loads the site's page and looks for the widget's key in it |
POST | / | Admin or owner | A JPEG, PNG or WebP picture of up to 2 MB, counted in the workspace's storage; the old picture goes |
| Knowledge: sources, documents, Q&A and the search test | |||
GET | / | Any member | Every source with its counts, and the plan's page usage |
POST | / | Admin or owner | A website (crawled at once), a file source or a Q&A source |
GET | / | Any member | One knowledge source with its settings, schedule, status and crawl progress |
PATCH | / | Admin or owner | Changes a source's name, address, crawl settings or re-crawl schedule |
DELETE | / | Admin or owner | The source, its documents, chunks and files |
POST | / | Admin or owner | Reads a website again (files and Q&A pairs are read again at once) |
GET | / | Any member | The source's documents, newest first |
POST | / | Admin or owner | Adds a PDF, Word, text or Markdown file to a file source |
GET | / | Any member | A document and its chunks |
DELETE | / | Admin or owner | The document, its chunks and its file |
POST | / | Admin or owner | Reads one page or file again and replaces its chunks |
GET | / | Any member | Every Q&A pair of the workspace, with how often it was cited in the last 30 days and the name of who typed it in (null for imported and sample pairs) |
POST | / | Admin or owner | A new Q&A pair (counts toward the plan's pages), marked as added by the signed-in member |
PATCH | / | Admin or owner | Changes a Q&A pair's question and answer |
DELETE | / | Admin or owner | The document, its chunks and its file |
POST | / | Any member | The chunks search finds for a question (what the assistant would read) |
GET | / | Any member | KnowledgeSummary (numbers, sources, files, what needs a look, the crawl running) |
GET | / | Any member | The website pages (problems first), { rows: PageDoc[], total, page, size, counts } |
GET | / | Admin or owner | A look at a site before it is added: { sitemap, listed, robots } (the sitemap found, the pages it lists, and whether the site has a robots.txt) |
POST | / | Admin or owner | A running crawl stops after its current batch and the source waits (paused, no scheduled runs) until it is crawled again |
POST | / | Admin or owner | A running crawl stops after its current batch, a queued one is dropped; the pages read so far stay |
POST | / | Admin or owner | Leaves a website page out: its chunks go, it stops counting toward the plan, and later crawls skip it |
POST | / | Admin or owner | A PDF, Word or text file read into the workspace's "Files" source |
POST | / | Anyone | Imports Q&A pairs from a CSV file (question, answer, optional source URL; up to 2,000 rows and 2 MB); a question already there gets the new answer |
| Inbox: chats, replies, notes and handover | |||
GET | / | Any member | Chats where the visitor wrote, newest first, filtered by state (open = every state but closed), agent and words; with the counts per state and the next page's cursor |
GET | / | Any member | The chat row, every message (notes too) and the visitor's other chats, lead and bookings |
POST | / | Agent and up | The chat is mine (bot or waiting → human); 409 when someone else took it first |
POST | / | Agent and up | Gives the chat to a team member (agent or above), or to nobody |
POST | / | Agent and up | An agent's message to the visitor |
POST | / | Agent and up | An internal note (never shown to the visitor) |
POST | / | Agent and up | Hands the chat back to the assistant (human → bot) |
POST | / | Agent and up | Ends the chat (the widget then asks for a rating) |
POST | / | Agent and up | Opens a closed chat again with the assistant (closed → bot) |
POST | / | Agent and up | Emails the chat's transcript to the visitor's email (400 when the chat has none; five an hour per chat) |
POST | / | Agent and up | Shows "Freya is typing…" in the widget |
| Leads | |||
GET | / | Any member | The leads, newest first, with filters (status, owner, assistant, words) and paging |
POST | / | Agent and up | A lead added by the team (emailed and sent to the lead.created webhook like any other) |
GET | / | Agent and up | Every matching lead as a CSV file (agents and up) |
GET | / | Any member | The lead with its extra fields, the chat it came from, its booking, notes and history |
PATCH | / | Agent and up | Changes a lead's status (new, contacted, won, lost) or owner |
POST | / | Agent and up | A team note (never shown to the visitor) |
| Calendars and bookings | |||
GET | / | Any member | The bookings starting in those days (workspace time zone), the weekdays no calendar opens, the numbers and the calendars |
POST | / | Agent and up | Books a time for a visitor from the app (409 when it was just taken) |
GET | / | Any member | One booking |
POST | / | Agent and up | Cancels a booking (and its event in a synced calendar) |
POST | / | Agent and up | Moves a booking to another free time (409 when the new time is not free) |
GET | / | Any member | The workspace's calendars with their hours, rules and connection |
POST | / | Admin or owner | A new calendar: name, kind, time zone, weekly hours, slot length, buffer, notice and days ahead |
GET | / | Admin or owner | Google sends the admin back here; the refresh token is sealed on the calendar the signed state names (only within the admin's current workspace) |
GET | / | Any member | One calendar |
PATCH | / | Admin or owner | Changes a calendar's hours and booking rules |
DELETE | / | Admin or owner | Removes a calendar and its past bookings (409 while it has upcoming ones) |
GET | / | Any member | The calendar's free times by day, in its time zone |
POST | / | Admin or owner | The Google consent page to open |
POST | / | Admin or owner | Checked by reading a day of slots first |
POST | / | Admin or owner | Disconnects Google Calendar or Cal.com (the calendar keeps its own hours) |
GET | / | Any member | The assistant's booking setup: whether it books, on which calendar, and that calendar's rules |
PATCH | / | Admin or owner | The rules go on the assistant's calendar; types rename and resize existing meeting types (by id) and add new ones (no id) |
POST | / | Admin or owner | Google connect answers { url }; Cal.com connect takes { apiKey, eventTypeId }; disconnect answers { ok } |
GET | / | Super-admin (the read-only login reads) | Google's OAuth client as saved (the secret masked), the return address to give Google and how many calendars are connected |
PUT | / | Super-admin | Google's OAuth client (the secret sealed; "" clears) |
| Analytics | |||
GET | / | Any member | Every card of the page |
GET | / | Any member | One card — chats (per day), resolution, handover, leads, bookings, ratings, first-answer, top-questions, unanswered, languages or hours |
GET | / | Any member | Groups of questions the assistant could not answer, most asked first (total counts the questions) |
POST | / | Admin or owner | Adds a Q&A pair for the group (the plan's pages limit holds: 402 and nothing saved when full) and takes every wording of the group off the list |
GET | / | Any member | Rated chats, newest first |
GET | / | Any member | Live chats, the period's numbers and chart, today, the top and unanswered questions, the latest leads and the setup steps |
| Developers: API keys, webhooks and MCP | |||
POST | / | API key (Bearer) | The MCP server: one JSON-RPC 2.0 message per request (initialize, ping, tools/list, tools/call), answered as JSON; the key decides the workspace and read or write |
GET | / | Admin or owner | The workspace's API keys (prefix, scopes, last use; revoked keys last) |
POST | / | Admin or owner | The whole key is in secret, shown this once |
POST | / | Admin or owner | The key stops working at once |
GET | / | Admin or owner | The webhook endpoints, the signing secret's hint and the latest 100 deliveries |
POST | / | Admin or owner | Adds a webhook endpoint with the events it wants |
GET | / | Admin or owner | The signing secret in full (never on the demo or while impersonating) |
POST | / | Admin or owner | A new signing secret for every endpoint |
POST | / | Admin or owner | Sends every failed delivery of the endpoint again (each once) |
POST | / | Admin or owner | "Send again" (a new delivery with the same payload) |
PATCH | / | Admin or owner | Changes an endpoint's address, events or on/off (turning it on again clears its failures) |
DELETE | / | Admin or owner | Removes the endpoint and its deliveries |
POST | / | Admin or owner | Sends a signed test event now and shows the answer (no retries) |
GET | / | Admin or owner | The Developers page's MCP card: the server's address, its tools with the scope each needs, and the latest calls |
| The website widget | |||
GET | / | The website widget (visitor token, from the assistant's allowed sites) | The assistant's look, behaviour and state for the widget |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | The visitor's open chat on the assistant, or a new one |
GET | / | The website widget (visitor token, from the assistant's allowed sites) | The chat, its messages (internal notes never) and its latest confirmed booking |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | Sends the visitor's message and streams the reply (Server-Sent Events): the message, the sources read, the words as they come and the stored reply; or the chat's state when people answer; a repeated clientId never writes or pays twice |
GET | / | The website widget (visitor token, from the assistant's allowed sites) | The chat's live stream for the widget: the current state, messages missed since Last-Event-ID, then agent and system messages, state and typing as they happen (notes never), with a heartbeat every 20 seconds |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | The visitor asks for a person (409 when visitors can't ask for one) |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | The chat's lead (a second form updates it) |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | The visitor stops waiting for a person (409 when one is answering or the chat is closed) |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | Thumbs on one reply or on the chat |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | Emails the chat to the visitor (three an hour per chat) |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | The offline / out-of-replies form → a lead |
GET | / | The website widget (visitor token, from the assistant's allowed sites) | The assistant's picture (public, cached for an hour) |
GET | / | The website widget (visitor token, from the assistant's allowed sites) | The free times, by the visitor's dates, with the calendar's name |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | Books a free time (409 with the day's fresh slots when it was just taken) |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | Moves the booking to another free time (409 with the day's fresh slots when it was just taken) |
POST | / | The website widget (visitor token, from the assistant's allowed sites) | Cancels the booking (status cancelled) |
| Super-admin | |||
GET | / | Super-admin (the read-only login reads) | The platform dashboard: revenue, workspaces, chats, assistant replies, message credits and AI cost this month and last, the database, what needs attention, and the subscription figures (workspaces by status, trials ending this week, the past-due value, the busiest workspaces) |
GET | / | Super-admin (the read-only login reads) | The workspace list (search, status and plan filters, sorting, paging) |
GET | / | Super-admin (the read-only login reads) | One workspace |
PATCH | / | Super-admin | Changes a workspace's plan or status (suspending emails the owners) |
DELETE | / | Super-admin | Closes a workspace after cancelling its paid subscription; the data is purged 30 days later |
POST | / | Super-admin | "Open as owner": a 30-minute session as the workspace's owner |
GET | / | Super-admin (the read-only login reads) | The people of every workspace with their platform role and workspaces, newest first (search, platform role, status) |
PATCH | / | Super-admin | Changes a user's platform role or status (never your own role, never the last admin's) |
GET | / | Super-admin (the read-only login reads) | Every plan, archived ones too |
POST | / | Super-admin | Adds a plan |
POST | / | Super-admin | The "Found in Stripe" badge: reads a price id from Stripe |
PATCH | / | Super-admin | Changes a plan (prices, Stripe ids, limits, features) |
DELETE | / | Super-admin | Takes a plan off sale; its subscribers keep it |
POST | / | Super-admin | Puts an archived plan back on sale |
GET | / | Super-admin (the read-only login reads) | Every payment (filters, paging) |
GET | / | Super-admin (the read-only login reads) | Every subscription (filters, paging) |
GET | / | Super-admin (the read-only login reads) | The platform settings (secrets masked), server facts and storage stats |
POST | / | Super-admin | The brand logo (PNG, SVG or WebP up to 1 MB, checked by content), served publicly as the logo and favicon |
PUT | / | Super-admin | Saves one settings section (secrets are sealed; an empty secret keeps .env) |
GET | / | Super-admin (the read-only login reads) | The platform emails with their built-in and saved wording, for the email editor |
GET | / | Super-admin (the read-only login reads) | The setup check rows, with the last full live run (lastRun, ranAt) |
POST | / | Super-admin | Tests one setup check row against the real service |
GET | / | Super-admin (the read-only login reads) | Background jobs (status and kind filters) with counts per status |
POST | / | Super-admin | Queues a failed job again |
POST | / | Super-admin | Removes the demo data (demo-marked rows only) |
GET | / | Super-admin (the read-only login reads) | The platform's brand (name, logo, colour, support email, public site, docs and support links), the mail server and the emails it sends |
PUT | / | Super-admin | Saves the brand fields sent (and from, the SMTP sender); answers PlatformBrand |
POST | / | Super-admin | Sends a test email to the signed-in admin (409 until SMTP is set up) |
GET | / | Super-admin (the read-only login reads) | { pages: LegalPage[] } (an empty body shows the sample text on the public site) |
PUT | / | Super-admin | Saves a legal page's own title and text (an empty title keeps the built-in one) |
POST | / | Super-admin | A workspace for someone, on that plan (its free days start now) |
POST | / | Super-admin | Tests every testable setup check against the real service and keeps the result |
GET | / | Super-admin (the read-only login reads) | Every gateway with its keys (secrets masked) and the latest payments |
PUT | / | Super-admin | Saves a gateway's keys and turns it on or off (secrets are sealed; an empty secret clears it) |
POST | / | Super-admin | Tries the keys at the gateway |
34Database
PostgreSQL with pgvector and btree_gist. The schema is in migrations/ and is applied by the server on start. Ids are UUIDs, times are UTC, money is in whole cents or micros. Every row of a workspace carries its workspace id, knowledge chunks included; payment and subscription rows are never deleted with their workspace. These 38 tables are generated from the migrations when the release is built.
| Table | What it holds | Keys | Points to |
|---|---|---|---|
| Accounts and sign-in | |||
users | Every person: platform staff and workspace members, with their platform role (none, admin, or the read-only viewer) and interface language | primary key id; unique email (any case) | – |
sessions | Signed-in browsers (only a hash of the cookie is stored), including a super-admin's 30-minute "open as owner" sessions | primary key id; unique token_hash | users, workspaces |
password_resets | Password reset links (hashed, valid for a limited time, used once) | primary key id; unique token_hash | users |
invites | Open invitations to a workspace, with the role to join as (admin, agent or viewer) | primary key id; unique token_hash; unique email (any case) per workspace, when accepted_at is null | workspaces, users |
rate_limits | Fixed-window counters for sign-in, sign-up, reset, invite, export and widget limits (keys hold a keyed hash, never a plain address) | primary key key | – |
| Workspaces and teams | |||
workspaces | Your customers' businesses: plan, status, trial end, time zone, interface language, white label and the customer ids at each payment gateway | primary key id; unique slug; unique stripe_customer_id | plans, users |
workspace_members | Who belongs to a workspace, with which role (owner, admin, agent or viewer) and their own notice choices | primary key workspace_id + user_id | workspaces, users |
audit_log | What was done in a workspace and by whom (impersonation, deletes, settings changes) | primary key id | workspaces, users |
media | Uploaded files (knowledge files, avatars, logos); a workspace's storage use is the sum of its rows | primary key id; unique storage_key | workspaces |
| Plans, billing and the message meter | |||
plans | The plans you sell: prices, trial days, the ids at each payment gateway, limits (replies a month, pages, assistants, seats, storage) and features (white label, own AI keys, bookings, calendar sync, API access) | primary key id | – |
subscriptions | Subscriptions at Stripe, PayPal, Razorpay or Paystack; never deleted with a workspace | primary key id; unique provider + provider_ref | workspaces, plans |
payments | Invoices paid, failed or refunded, numbered AM-0001 and up; never deleted with a workspace | primary key id; unique number; unique provider + provider_ref | workspaces, plans |
gateway_events | Payment gateway events already applied (provider and event id), so a delivery a gateway sends again is never applied twice | primary key provider + event_id | – |
usage_months | The message meter: replies counted per workspace and calendar month (UTC) | primary key workspace_id + month | workspaces |
message_credits | One row per claimed message credit, keyed by the visitor message: a retried request is never counted twice, and a refund gives the credit back once | primary key workspace_id + idempotency_key | workspaces |
email_notices | Platform emails sent once per workspace and period (out of replies, payment failed, …) | primary key workspace_id + kind + period | workspaces |
| Platform | |||
platform_settings | Settings saved in the platform admin (they override .env); secret fields are sealed | primary key key | users |
jobs | The durable background job queue (crawls, embeddings, emails, webhook deliveries, housekeeping, the demo's visitors) | primary key id; unique dedupe_key, when dedupe_key is not null and status in ('queued', 'running') | workspaces |
| AI provider keys | |||
provider_keys | AI provider keys, sealed: a workspace's own, or the platform's for every workspace; with the chat and embedding models, base URL and the last test result | primary key id | workspaces |
| Assistants and knowledge | |||
assistants | A workspace's chat assistants: name, avatar, colour, greeting, suggested questions, tone, rules, languages, handover and lead rules, booking calendar, allowed sites and the public widget key | primary key id; unique widget_key | workspaces, media, calendars |
sources | Where knowledge comes from (a website, uploaded files or the Q&A pairs), with the crawl settings, schedule, status and progress | primary key id | workspaces |
documents | One crawled page, uploaded file or Q&A pair, with its language, content hash and whether it was indexed, skipped or excluded | primary key id; unique source_id + url, when kind = 'page' and url is not null | workspaces, media, sources, users |
chunks | The pieces of each document that search reads: text, headings, full-text index and the embedding (pgvector), always with its workspace | primary key id | workspaces, documents |
unanswered_answers | Answers added from Analytics → Unanswered questions, so the question drops off the list | primary key workspace_id + key | workspaces, documents |
stored_answers | Demo only: written answers for the suggested and top questions of the demo assistant, matched on the question | primary key id; unique assistant_id + normalized | workspaces, assistants |
| Visitors, chats and messages | |||
visitors | Website visitors per workspace (only a keyed hash of the widget's visitor token), with the name and email they gave | primary key id; unique token_hash | workspaces |
chats | One visitor conversation with one assistant: state (bot, waiting, human, closed), the person it is assigned to, the page, rating and counts | primary key id | workspaces, visitors, leads, users, assistants |
messages | Every line of a chat (visitor, assistant, agent, system or internal note), with the cited sources, the model, tokens, cost and the visitor's idempotency key | primary key id; unique chat_id + client_id; unique seq | workspaces, users, chats |
| Leads, calendars and bookings | |||
leads | Contact details a visitor left (or the team added), with status, owner and the answers to the assistant's extra fields | primary key id; unique chat_id, when chat_id is not null | workspaces, assistants, chats, users |
lead_notes | The team's notes on a lead (never shown to the visitor) | primary key id | leads, workspaces, users |
lead_events | What happened to a lead and who did it | primary key id | leads, workspaces, users |
calendars | Calendars visitors book on: weekly hours, slot length, buffer, notice, days ahead, time zone, and the Google Calendar or Cal.com connection (its token sealed) | primary key id | workspaces |
bookings | Booked times; a database rule makes two confirmed bookings on one calendar never overlap | primary key id | workspaces, chats, leads, calendars, users |
| API keys, webhooks and MCP | |||
api_keys | Workspace API keys for the REST API and MCP: name, prefix, scopes and use (only a hash of the key is stored) | primary key id; unique hash | workspaces, users |
webhooks | Outgoing webhook endpoints: address, events and delivery health | primary key id | workspaces |
webhook_secrets | The workspace's webhook signing secret (sealed) | primary key workspace_id | workspaces |
webhook_deliveries | Every webhook delivery with its payload, tries, answer and next try | primary key id | workspaces, webhooks |
mcp_calls | The latest MCP tool calls of a workspace, for the Developers page | primary key id | workspaces, api_keys |
Help
35Troubleshooting
A website's crawl is blocked or reads nothing
Open Knowledge → Website pages: every page that was not read shows its reason, and Retry reads one again. "Blocked by robots.txt": the site closes those pages to robots; the business can allow AskmarkBot in its robots.txt or, for its own site, turn robots.txt off for that source. Pages that answer 403 or a challenge page come from a firewall or bot protection (Cloudflare and others): allow the user agent AskmarkBot/1.0 or your server's IP address there. "No text on the page": the page draws its text with JavaScript only, which the crawler does not run; upload the content as files or Q&A instead. A crawl that stops after 8 minutes carries on at the next crawl.
The assistant answers "I don't know" or shows no sources
Ask the same question in Knowledge → Test answers. When no chunk comes back, the knowledge does not hold the answer (add a page, file or Q&A pair) or the assistant's source list leaves it out. When chunks come back but the reply still says it does not know, the chunks do not really answer it: write a Q&A pair in the visitor's words. Without an embedding key, only full-text search runs, which needs the visitor's words to appear in the text (chapter 6). The unanswered questions in Analytics list what to add next.
The assistant says it is not set up yet
No AI key was found for the workspace: none in the platform admin, none in .env and, on plans with own keys, none in the workspace. Add one and press Test (chapter 6). When a key exists but replies fail, the inbox and the AI providers page show the provider's reason; the table in chapter 6, When a provider refuses, says what to do.
The widget does not show on a website
- Open the install check in Widget and install: "Widget not seen yet" means the snippet never ran. Check that it is on the published page, before
</body>, and clear any cache plugin or CDN cache. - Open the browser's developer console on the website. A
403on/api/v1/widget/…means the site is not in the assistant's allowed websites: add it (with*.for subdomains). - "Refused to load the script" or "violates the following Content Security Policy" means the site's CSP must allow your platform's address (chapter 10).
- A website on https cannot load the widget from an http platform: your
APP_URLmust be https. - A workspace that is read-only, suspended or out of replies still shows the button, with a contact form instead of answers.
Emails don't arrive
Without SMTP, emails are written to docker compose logs app. With SMTP, press Send test email in Email and brand, or Test on the Email row of the setup check; check that the sender's domain is verified with your provider. Members choose their own notices in Settings → Notifications and language. Demo workspaces only write emails to the log.
Paid plans don't switch on
The setup check's gateway rows must be green. At the gateway, the webhook must point to your APP_URL plus /api/v1/webhooks/stripe (or /paypal, /razorpay, /paystack) and list the events in chapter 16; every gateway shows each delivery and the answer it got. Test-mode keys only work with test-mode webhooks and prices.
Replies or the inbox don't update live
A proxy is buffering the streams. With the bundled Caddy it works as is; with Nginx add proxy_buffering off; (chapter 24); behind Cloudflare, make sure the response is not cached.
The build stops with "killed" or "signal: 9"
The server ran out of memory while compiling. Add swap or build on another computer (chapter 24).
"extension vector is not available"
The database has no pgvector. Use the bundled pgvector/pgvector:pg17 image, or turn pgvector on at your managed database (chapter 25), then press Check again in the install wizard.
The install wizard asks for a token I don't have
The app prints it in its log at every start until the install is finished, and each restart makes a new one, so use the last line of docker compose logs app | grep -i "install token". Or set INSTALL_TOKEN in .env and run docker compose up -d.
After an upgrade everything is empty
The folder was moved or renamed: Docker names the stack and its database volume after the folder unless COMPOSE_PROJECT_NAME is set, so it started a new, empty one. docker volume ls shows the old one as <old name>_postgres-data. Stop the app with docker compose down, set COMPOSE_PROJECT_NAME to the part before _postgres-data and run docker compose up -d again.
The app does not start
docker compose logs app names the problem, for example "APP_SECRET must be at least 32 characters" or "DATABASE_URL is not set". docker compose ps shows whether PostgreSQL and MinIO are healthy.
Too many sign-in attempts from everyone at once
TRUSTED_PROXY_HOPS is 0 behind a proxy, so every visitor shares one address. Set it to the number of proxies in front of the app (chapter 24).
36FAQ
Does the assistant make things up?
It is told to answer only from the workspace's knowledge, to cite it, and to say when it does not know; every reply is checked for sources and links that are not in the knowledge (chapter 9). Like every AI it can still misread a source, so the inbox, the ratings and the unanswered questions show the business what it said.
Can I try it without any AI key?
Yes. Crawling, files, Q&A, the knowledge test, the inbox, leads and bookings all work without a key; the assistant then says it is not set up yet and offers a person. A test copy with DEMO_MODE="true" gives you the full demo with stored sample answers and 90 days of history (chapter 23).
How much will the AI replies cost me?
See chapter 7: with the default models one reply costs a fraction of a cent at list prices, and for example a workspace on the Growth plan that uses all 10,000 replies of its month on OpenAI gpt-5-mini costs about $17.50 in replies, plus about $0.06 to embed its 2,000 pages once ($17.57 in all, against the plan's $79). The plans' replies a month cap each workspace's use.
Can my customers use their own AI keys?
Yes, on plans whose Own AI keys switch is on: their workspace keys are used before yours, and their providers bill them. Their replies still count toward their plan.
Does it work with any website?
Yes: any site where you can add a script tag (chapter 10). The crawler reads pages that show their text in HTML; pages built only with JavaScript can be added as files or Q&A.
Do I need to know Rust?
No, not to install, rebrand or run it: Docker builds everything. Changing the screens needs React; changing the widget needs TypeScript; changing server rules needs Rust (chapter 32).
Can I use another database or host it without Docker?
PostgreSQL 15 or newer with pgvector is required; managed PostgreSQL services with pgvector work (chapter 25). Without Docker, run the one askmark program behind your own HTTPS proxy (chapter 3).
Which licence do I need?
To charge your customers (sell plans), the Envato Extended Licence. See chapter 39.
37Credits and licences
Askmark is built with these open-source projects, each under its own licence:
- Server: Rust, Axum, Tokio, SQLx, reqwest, rustls, Lettre, the RustCrypto crates (Argon2, AES-GCM, HKDF, HMAC, SHA-2), chrono and chrono-tz, mimalloc; for reading knowledge scraper (web pages), lopdf (PDF), zip and quick-xml (Word), flate2 (gzipped sitemaps) and whatlang (language detection); all MIT or Apache 2.0.
- Database: PostgreSQL (PostgreSQL Licence) with pgvector (PostgreSQL Licence).
- Web app: React, React Router, Vite, Tailwind CSS, shadcn/ui, Base UI, Radix UI, TanStack Query and Table, Sonner and React DayPicker, all MIT. The charts are drawn by Askmark's own code.
- Widget: no outside library at run time; built with TypeScript and esbuild.
- Icons: Lucide (ISC licence).
- Fonts: Gabarito, Rethink Sans, Geist and Geist Mono and Noto Sans Arabic, all under the SIL Open Font License 1.1, bundled through Fontsource and served by your own app.
- Docker images: pgvector/pgvector (PostgreSQL 17 with pgvector), MinIO (GNU AGPL 3.0, run unmodified as a separate service), Caddy (Apache 2.0), and the official Rust, Node.js and Debian images used to build and run the app.
Every dependency
The Rust crates (from Cargo.lock) and the npm packages of the web app and the widget, counted by licence when the release is built. docs/third-party-licenses.txt lists every package by name, version and licence.
| Licence | Rust crates | npm packages |
|---|---|---|
| MIT | 67 | 278 |
| Apache-2.0 OR MIT | 242 | 4 |
| Unicode-3.0 | 18 | – |
| ISC | 4 | 10 |
| Apache-2.0 | 1 | 10 |
| MPL-2.0 | 4 | 2 |
| BSD-3-Clause | 3 | 2 |
| OFL-1.1 | – | 5 |
| (MIT OR Apache-2.0) AND Unicode-3.0 | 3 | – |
| Apache-2.0 OR MIT OR Zlib | 3 | – |
| Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | 3 | – |
| MIT OR Unlicense | 3 | – |
| 0BSD | 1 | 1 |
| Apache-2.0 OR BSD-2-Clause OR MIT | 2 | – |
| Apache-2.0 OR BSL-1.0 OR MIT | 2 | – |
| Apache-2.0 OR ISC OR MIT | 2 | – |
| Apache-2.0 OR LGPL-2.1-or-later OR MIT | 2 | – |
| BSD-2-Clause | – | 2 |
| CDLA-Permissive-2.0 | 2 | – |
| Zlib | 2 | – |
| (Apache-2.0 OR MIT) AND BSD-3-Clause | 1 | – |
| 0BSD OR Apache-2.0 OR MIT | 1 | – |
| Apache-2.0 AND ISC | 1 | – |
| Apache-2.0 OR BSL-1.0 | 1 | – |
| Apache-2.0 OR CC0-1.0 OR MIT-0 | 1 | – |
| BlueOak-1.0.0 | – | 1 |
| BSD-3-Clause OR MIT | 1 | – |
| CC-BY-4.0 | – | 1 |
| MIT AND BSD-3-Clause | 1 | – |
| MIT-0 | – | 1 |
| Unlicense | – | 1 |
| Total | 371 | 318 |
Every licence above allows use in a commercial product. cargo deny check licenses checks the Rust crates against this list.
Third-party services
Askmark works with outside services you choose: OpenAI, Anthropic, Google Gemini, OpenRouter and any OpenAI-compatible endpoint for replies and embeddings; Stripe, PayPal, Razorpay or Paystack for payments; an SMTP email provider; optionally S3-compatible storage, Google Calendar and Cal.com. Each is run by another company with its own terms and its own pricing tiers, and you, the buyer, are responsible for any costs they charge (chapter 7 lists their list prices). Askmark is not affiliated with any of them.
Images
Askmark ships no stock photos. The logo and the demo assistant's sun picture are original SVGs drawn in code, and every image in this guide is a screenshot of the running app. The demo business's website seen in some screenshots shows a photo by NxTide from Pixabay (Pixabay Content License); that website is not part of the download.
38Changelog
1.0.0 (2026-11-30)
First release.
- Knowledge: websites read sitemap first, with depth and page caps, robots.txt, include and exclude paths, clean addresses, duplicate text kept once, and daily or weekly re-crawls that skip unchanged pages; PDF, Word, text and Markdown files up to 20 MB; Q&A pairs, typed in or imported from CSV; each page's status and skip reason, with Pause, Stop, Retry and Exclude; a test that shows the answer, its sources and the chunks it read.
- Answers: full-text and pgvector search joined by rank fusion; replies only from the workspace's own knowledge, with numbered sources shown as links; "I don't know" without a model call when nothing is found; every reply checked for sources and links that are not in the knowledge; the visitor's words and the knowledge passed as data, never as instructions; replies streamed word by word, with Stop.
- AI providers: OpenAI, Anthropic Claude, Google Gemini, OpenRouter and any OpenAI-compatible endpoint behind one interface, with the buyer's own keys; platform keys in
.envor the platform admin, and a workspace's own keys on plans that allow them; sealed at rest, shown only as a hint, each with a Test button; an editable list-price table behind every cost figure. - Assistants: name, picture, colour, position, greeting, suggested questions, tone, rules, languages, memory, sources, handover (when there is no answer or whenever the visitor asks, within weekly hours) and lead form, booking rules, allowed websites and a public widget key.
- Website widget: one script tag, plain TypeScript in a Shadow DOM, about 30 KB gzipped, keyboard and screen reader friendly, full screen on phones, light and dark, six languages with Arabic right to left, sources under each reply, lead and contact forms, bookings in the chat, ratings, transcripts by email, and
window.Askmarkwith open, close and ask. - Inbox and handover: live chats for the whole team in four states (with the assistant, waiting for a person, with a person, closed); take over, assign, reply, internal notes, hand back, close and reopen, with no two teammates able to take one chat; transcripts by email; the visitor's place in the queue; emails for new chats, visitors waiting and replies to visitors who left.
- Leads and bookings: leads from the chat with statuses, owners, notes, history and CSV export; calendars with weekly hours, slot length, buffer, notice and days ahead; Google Calendar (free/busy and events) and Cal.com sync; a database rule that stops two visitors booking one time; moving and cancelling from the chat or from the booking's own page; booking emails to the visitor and notices to the team.
- Analytics: chats, resolution, how chats ended, leads, bookings, ratings, first answer time, top and unanswered questions (grouped, with Add an answer), languages and busiest hours, over 7, 30 or 90 days, each against the period before.
- Developers: a REST API with workspace API keys and read or write scopes; signed outgoing webhooks for chats, leads and bookings, retried for 24 hours, with Send again; an MCP server for Claude, ChatGPT and other AI apps.
- Plans and billing: limits on replies a month, pages of knowledge, assistants, seats and file storage, plus bookings, calendar sync, API access, white label and own AI keys; enforced on the server, with a message credit claimed before each reply and given back when it fails. Stripe, PayPal, Razorpay and Paystack checkouts with signed webhooks applied once; trials; three sample plans.
- Teams: owner, admin, agent and viewer roles, invitations, each person's notices and language; the web app in English, Spanish, French, German, Portuguese and Arabic (right to left).
- Platform admin: revenue, workspaces, replies and AI cost; workspaces (create, plan, suspend, close, open as owner); users and platform roles; plans; payments; AI providers and prices; email and brand; legal pages; languages; a setup check with live tests, Google Calendar sync and demo data removal; background jobs with Retry.
- Install and hosting: one Docker Compose command (the app, PostgreSQL with pgvector, MinIO and optional HTTPS with Caddy), an install wizard with a pgvector check, rebranding without code, workspace export (JSON or CSV) and the purge of closed workspaces after 30 days.
- Demo mode: a solar installer with its knowledge, 90 days of chats, leads and bookings, stored sample answers, new visitors every few minutes, one-click sign-ins and a nightly reset, with no paid AI call.
39Support and licence
Questions, bug reports and help with installation: use the Support tab on the item's page on the marketplace. Please include your Askmark version (the top of CHANGELOG.md, or /api/app-version on your platform), how you host it, and what you see (a screenshot, or the lines from docker compose logs app). Never send us your .env, API keys, tokens or passwords.
Support covers questions about the item's features, help with bugs and help with installing it as described here. It does not cover custom changes to the code, or your accounts at the AI providers, payment gateways, calendars and other outside services, which are handled by those companies.
The Regular Licence lets you use Askmark for one product whose end users are not charged. To charge your customers (sell plans or subscriptions), you need the Envato Extended Licence. One licence covers one platform (one brand on one installation). The licences page at codecanyon.net/licenses/standard explains both licences in full.
Askmark is not affiliated with, endorsed by or sponsored by OpenAI, Anthropic, Google or OpenRouter.