Install docs

Add the Matter Chat widget to any site — copy-paste snippets for every stack, init options, and the REST API.

Step 1

Install the widget

Copy your bot key from any bot's Install tab, then drop the snippet into your stack. It loads after your page finishes, so it never blocks rendering.

Paste right before the closing </body> tag on every page.

<!-- Matter Chat — paste right before </body> -->
<script>
  window.MatterChat = window.MatterChat || { q: [] };
  window.MatterChat.q.push(["init", { id: "YOUR_BOT_KEY" }]);
</script>
<script async src="https://app.matterchat.co/widget.js"></script>
Reference

Init options

Appearance is normally managed in the dashboard — no code changes needed. Inline options win when both are set.

OptionRequiredWhat it does
idrequiredYour bot key from the dashboard (starts with bot_).
titleoptionalOverrides the header title set in the dashboard.
greetingoptionalOverrides the first message the visitor sees.
accentoptionalHex colour overriding the dashboard accent, e.g. "#0F9D6B".
positionoptional"right" (default) or "left".
Step 2

Before you go live

Three checks that keep the bot accurate and your spend safe.

  1. 1

    Set the domain allow-list. Add every domain the widget runs on — subdomains count separately (acme.com and www.acme.com are two entries). An empty list means any site can use your bot.

  2. 2

    Check the daily token cap. It's your spending ceiling; the widget politely pauses when it's reached.

  3. 3

    Ask it ten hard questions. Use the dashboard test chat. If it refuses something it should know, crawl the page that answers it.

Advanced

REST API

Create an API key under Account → API keys, then send it as Authorization: Bearer mc_sk_…. Your bot IDs are shown in each bot's dashboard URL.

Ask a question — POST /api/v1/query

curl -X POST https://app.matterchat.co/api/v1/query \
  -H "Authorization: Bearer mc_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"botId": "YOUR_BOT_ID", "question": "Do you ship internationally?"}'

// → { "answer": "...", "sources": [{ "n": 1, "title": "...", "url": "..." }], "grounded": true }

Rate limit 30/minute per key. grounded: false means the knowledge base had nothing relevant — no answer is invented.

Add or refresh a page — POST /api/v1/ingest

curl -X POST https://app.matterchat.co/api/v1/ingest \
  -H "Authorization: Bearer mc_sk_..." \
  -H "Content-Type: application/json" \
  -d '{"botId": "YOUR_BOT_ID", "url": "https://your-site.com/new-page"}'

// → { "sourceId": "...", "chunkCount": 12, "skipped": false, "error": null }

Rate limit 60/hour per key. skipped: truemeans the page content hasn't changed since the last ingest.