Docs / Sources

Discourse

Connect Discourse with an admin API key. Verified email addresses and linked logins connect forum members to accounts from other sources.

Matches onVerified email, GitHub sign-in
HistoryFull, forum-wide
Also doesLive webhooks, presence
You'll needDiscourse admin access

Why the admin key matters

A Discourse admin key provides the full member list with addresses, profile links such as GitHub and LinkedIn, and linked login providers. A member who uses Sign in with GitHub can link to their GitHub account without an email address.

A non-admin key reads topics and posts but cannot read the member list or email addresses. It cannot link accounts automatically. Uncertain matches enter your review queue.

Connect Discourse

  1. Create an admin API key

    Open Admin → API → Keys on your forum. Select New API Key. Set the description to ocmgr. Set User Level to All Users. Set Scope to Global, or Granular with read access to users, topics and posts. Copy the key before closing the dialog.

    All Users enables admin API access. Other user levels lack the member list and email addresses, which prevents automatic linking across sources. Datum uses the key only for reads.

  2. Open Sources

    Open Sources → Connect a source → Discourse.

    • Enter the forum root without a path in Forum URL, for example https://forum.example.com.
    • Enter the key in API key.
    • Enter an admin account in API username, for example system.

    The key uses that account’s permissions.

  3. Choose what to read

    Open Advanced settings for optional import settings. Categories limits topics to specified category IDs or slugs. Read member profiles and Read linked login accounts start on. Each option adds one request per member, which increases sync time for large forums.

    Leave Identity provider empty unless multiple forums share one single sign-on provider.

  4. Verify

    Press Verify. Check that adminApi and emailAccess both show true in the details.

    A successful result identifies the API user and ends with (admin API available).

  5. Start the first sync

    Daily full reconciliation starts off. When enabled, Datum starts the first sync automatically and rereads the forum daily.

    During setup, set Daily full reconciliation to Enabled for automatic syncs. Alternatively, open the forum on Sources for a manual sync. Press Run now on its page. You can also run ocmgr ingest <connectionId> from your terminal or agent.

    Check Health on Sources for incoming pages. Check the last-run time after the sync finishes.

Add live updates

Optional webhooks deliver new members, topics, posts and likes as they occur. Without webhooks, Datum reads records during scheduled or manual syncs.

  1. Generate a long random secret, for example with openssl rand -hex 32.
  2. Open Advanced settings during setup.
  3. Enter the secret in Webhook secret.
  4. Open the forum’s ··· menu on Sources.
  5. Select Webhook URL.
  6. Copy the address.
  7. Open Admin → API → Webhooks in Discourse.
  8. Select New Webhook.
  9. Enter the address in Payload URL.
  10. Set the content type to application/json.
  11. Enter the same value in Secret.
  12. Select User Event, Topic Event, Post Event and Like Event under Select individual events.
  13. Save the webhook.

Alternatively, store the connection secret later with ocmgr connection update <connectionId> --secret webhookSecret=<secret>. If Discourse supplies a secret, copy it into Datum’s Webhook secret field instead. Both values must match.

Datum requires a stored secret before it supplies the webhook address. That address combines your Datum address with /webhooks/discourse/ and the connection ID.

Discourse signs each delivery with the secret. Datum rejects invalid signatures before storing anything. This includes all deliveries from webhooks without a secret.

Data Datum imports

Members Username, name, avatar, bio, website, custom user fields, email address and every login provider they signed in with
Activity Topics, replies and likes, with links back to the forum, and suspensions
Presence Optional: who visited each day, from Discourse’s last-seen time. See Presence
Not collected Personal messages, and the text of posts

Datum treats a primary address as verified only for an activated account that is not a staged account. It keeps role addresses such as support@ and secondary addresses as unverified values. Verified addresses link accounts across sources automatically. Other addresses contribute to matching.

Datum has completed end-to-end tests against a live hosted Discourse forum, including webhook deliveries.

From your terminal or agent

ocmgr connection create --kind discourse \
  --config '{"baseUrl":"https://forum.example.com"}' \
  --secret-file discourse.json --json   # {"apiKey":"…","apiUsername":"system"}
ocmgr connection verify <connectionId> --json
ocmgr ingest <connectionId> --json
ocmgr connection update <connectionId> --config '{"enabled":true}' --json   # daily re-read

Troubleshooting

“This key cannot read /admin/users”

The key lacks All Users access, or API username does not identify a staff account. Datum still reads topics and posts, but cannot collect addresses or linked logins.

Create a key with User Level set to All Users. Store it with ocmgr connection update <connectionId> --secret apiKey=<key>. Press Verify again.

“The member list came back without email addresses”

The key can list members but cannot read addresses. Check for All Users access with Global scope or users read access under Granular.

FAQ

Can I connect two forums?

Yes. Create one connection per forum. Set the same Identity provider on both connections if the forums share a sign-in provider.

Each forum retains separate accounts. The shared provider setting allows linking through sign-in IDs.

Does it read private categories?

Datum reads content that API username can access. Admin accounts can see staff-only categories. Use Categories to exclude unwanted categories.

A large forum is taking hours.

Profiles and linked logins each require one request per member. Datum limits request frequency to meet Discourse’s limits. Disable Read member profiles to reduce sync time. This removes profile links that contribute to matching.