Prerequisites
The connector should already be set up, with a Connector Profile and a Linked Account. See Getting Started on the Discourse connector page.Automatic webhook subscription
StackOne creates and manages the Discourse webhook automatically. When webhook events are enabled for a connected account, StackOne creates one webhook on your forum, subscribed to the events you enable and covering every category. You don’t need to configure anything in Discourse.
Check the API key access
The webhook is created with the API Key and API Username of the connected account.
- The API key must have Scope set to Global. Keys with granular or read-only scopes cannot manage webhooks.
- The API Username must belong to an administrator. Discourse rejects webhook requests from moderators and regular users.
Enable events in StackOne
Select the webhook events you want in StackOne. StackOne registers the Discourse webhook with exactly those events. You can view it on your forum at /admin/api/web_hooks.
Change or remove events
Changing the event selection replaces the StackOne webhook with a new one for the updated event list. Disconnecting the account deletes the webhook, which stops deliveries.
Available webhook events
The following Discourse events can be enabled. Only events selected in StackOne are included in the webhook subscription — Discourse will not deliver events that are not subscribed. Events from the Solved, Assign, Topic Voting, Chat and Calendar plugins are delivered only when that plugin is enabled on your forum.
Topic events
Events related to topics, including private message topics.
- Topic Created (
topic_created) — Fired when a topic is created, including private message topics - Topic Edited (
topic_edited) — Fired when a topic is edited or its status changes. Status changes arrive astopic_closed_status_updated,topic_archived_status_updated,topic_visible_status_updated,topic_pinned_status_updated,topic_pinned_globally_status_updatedortopic_autoclosed_status_updated - Topic Deleted (
topic_destroyed) — Fired when a topic is deleted - Topic Recovered (
topic_recovered) — Fired when a deleted topic is recovered
Post events
Events related to posts, replies, and likes, including posts in private messages.
- Post Created (
post_created) — Fired when a post or reply is created, including the first post of a new topic and private message posts - Post Edited (
post_edited) — Fired when a post is edited - Post Deleted (
post_destroyed) — Fired when a post is deleted - Post Recovered (
post_recovered) — Fired when a deleted post is recovered - Post Liked (
post_liked) — Fired when a user likes a post
User events
Events related to user accounts, sign-ins, and trust levels.
- User Created (
user_created) — Fired when a user account is created - User Updated (
user_updated) — Fired when a user profile is updated - User Logged In (
user_logged_in) — Fired when a user logs in - User Logged Out (
user_logged_out) — Fired when a user logs out - User Confirmed Email (
user_confirmed_email) — Fired when a user confirms their email address - User Approved (
user_approved) — Fired when a staff member approves a pending user - User Suspended (
user_suspended) — Fired when a user is suspended - User Unsuspended (
user_unsuspended) — Fired when a user suspension is lifted - User Anonymized (
user_anonymized) — Fired when a user is anonymized - User Deleted (
user_destroyed) — Fired when a user is deleted - User Promoted (
user_promoted) — Fired when a user is promoted to a higher trust level
Group events
Events related to groups and group membership.
- Group Created (
group_created) — Fired when a group is created - Group Updated (
group_updated) — Fired when a group is updated - Group Deleted (
group_destroyed) — Fired when a group is deleted - User Added to Group (
user_added_to_group) — Fired when a user is added to a group - User Removed from Group (
user_removed_from_group) — Fired when a user is removed from a group
Category events
Events related to categories.
- Category Created (
category_created) — Fired when a category is created - Category Updated (
category_updated) — Fired when a category is updated - Category Deleted (
category_destroyed) — Fired when a category is deleted
Tag events
Events related to tags.
- Tag Created (
tag_created) — Fired when a tag is created - Tag Updated (
tag_updated) — Fired when a tag is renamed or updated - Tag Deleted (
tag_destroyed) — Fired when a tag is deleted
Badge events
Events related to badges granted to users.
- User Badge Granted (
user_badge_granted) — Fired when a badge is granted to a user - User Badge Revoked (
user_badge_revoked) — Fired when a badge is revoked from a user
Review queue events
Events related to the review queue, such as flagged posts, queued posts, and users awaiting approval.
- Reviewable Created (
reviewable_created) — Fired when an item enters the Discourse review queue, such as a flagged post, a queued post, or a user awaiting approval - Reviewable Updated (
reviewable_score_updated,reviewable_transitioned_to) — Fired when a review queue item gets a new score or changes status (approved, rejected, ignored, or deleted)
Notification events
Events related to notifications sent to any user on the forum.
- Notification Created (
notification_created) — Fired when Discourse creates a notification for any user on the forum
Solved plugin events
Delivered only when the Solved plugin is enabled on your forum.
- Solution Accepted (
accepted_solution) — Fired when a post is marked as the accepted solution of a topic - Solution Unaccepted (
unaccepted_solution) — Fired when an accepted solution is removed from a topic
Assign plugin events
Delivered only when the Assign plugin is enabled on your forum.
- Topic Assigned (
assigned) — Fired when a topic or post is assigned to a user or group - Topic Unassigned (
unassigned) — Fired when an assignment is removed from a topic or post
Topic Voting plugin events
Delivered only when the Topic Voting plugin is enabled on your forum and voting is turned on for the category.
- Topic Upvoted (
topic_upvote) — Fired when a user votes for a topic - Topic Vote Removed (
topic_unvote) — Fired when a user removes their vote from a topic
Chat events
Delivered only when chat is enabled on your forum.
- Chat Message Created (
chat_message_created) — Fired when a chat message is sent in a Discourse chat channel or direct message - Chat Message Edited (
chat_message_edited) — Fired when a chat message is edited - Chat Message Deleted (
chat_message_trashed) — Fired when a chat message is deleted - Chat Message Restored (
chat_message_restored) — Fired when a deleted chat message is restored
Calendar plugin events
Delivered only when the Calendar plugin and its events feature are enabled on your forum.
- Calendar Event Created (
calendar_event_created) — Fired when a calendar event is created on a post - Calendar Event Updated (
calendar_event_updated) — Fired when a calendar event is updated - Calendar Event Deleted (
calendar_event_destroyed) — Fired when a calendar event is deleted
Delivery format
Details of how Discourse delivers events to StackOne.
One event per request
Discourse sends one event per HTTP POST. The JSON body has a single root key named after the event group, for example topic or post, and the event name is carried in the X-Discourse-Event header, for example topic_created. StackOne uses the ID of the changed record as the event ID. Likes, assignments and votes have no ID of their own, so the liked post, assigned topic or voted topic ID is used.
Private messages
Topic and post events also fire for private messages. Check archetype on topics, or topic_archetype on posts, for the value private_message to tell them apart.
Signatures and retries
Each delivery is signed in the X-Discourse-Event-Signature header with an HMAC-SHA256 of the body. Discourse does not retry failed deliveries unless the retry_web_hook_events site setting is turned on.