answerLoopsanswerLoops Docs
Integrations

Discourse

Connect a Discourse forum to answerLoops so new topics and replies in watched categories flow through the same confidence-gated support pipeline as every other channel.

Overview

Discourse is the forum platform many open-source projects, product communities, and education communities run as their primary support surface. answerLoops ingests new topics and posts from the categories you choose, runs each one through the standard triage → retrieval → confidence-review → escalation pipeline, and posts grounded answers back into the topic as a bot user.

The connection is per-organization: you create an API key inside your own Discourse admin, scoped to a bot account, and it is stored encrypted in your answerLoops database. There is no shared platform-wide app and no OAuth flow. Inbound events arrive over a Discourse webhook — no polling.

Automatic Deflections is off by default, same as every other channel. While it's off, even a high-confidence answer is held as a draft on the dashboard awaiting Approve/Edit/Dismiss, and the topic gets no automatic reply. Turn it on in Integrations → Discourse → Edit → Automatic Deflections → Save once you've reviewed enough approved drafts to trust answers going out unsupervised.


Setup

1. Create a bot user

In Discourse, create (or pick) a dedicated account for answerLoops to post as — for example answerloops-bot. Give it Trust Level 1 or higher so it can reply in the categories you want covered.

2. Create an API key

Go to Admin → API → New API Key:

  • User Level: Single User, set to the bot account from step 1 (or All Users if you prefer)
  • Scope: Granular is fine — the integration needs web_hooks (read/write), posts (write), and categories (read). Global also works.

Copy the key — Discourse only shows it once.

3. Connect in answerLoops

Go to Integrations → Discourse and fill in:

FieldValue
Discourse site URLYour forum's base URL, e.g. https://forum.example.com
API keyThe key from step 2
Bot usernameThe account from step 1
Watched category IDsNumeric category IDs, comma-separated — leave blank to watch every category

Click Update to save.

A category's numeric ID is in its URL: /c/support/6 is category 6. It's also shown on the category's settings page.

4. Register the webhook

After saving, click Register webhook on the Discourse card. answerLoops calls your forum's admin API to create (or update) a webhook that points at /api/discourse/webhook, subscribed to topic and post events, signed with a per-organization secret.

If your Discourse instance blocks admin API webhook management, the card also shows the Payload URL and Secret so you can add the webhook by hand in Admin → API → Webhooks — subscribe it to the Topic Event and Post Event groups, set Content type to application/json, and leave Check TLS certificate on.

Re-register (or update the manual webhook's URL) any time your app's public URL (AUTH_URL) changes.

5. Set an escalation user (optional)

Enter a Discourse username without the @ in Escalation user to have that person mentioned in the topic when AI confidence falls below your threshold.

6. Set the confidence threshold

Confidence threshold (0–1, default 0.8) is the score below which an answer is treated as low-confidence — held as a draft, or (with Automatic Deflections on) posted alongside the escalation mention instead of as a full answer.


Environment variables reference

Discourse is configured entirely per-organization through the Settings UI. There is no forum-wide credential and no environment variable to set.


Troubleshooting


On this page