How to integrate a third-party moderation service with Discourse?

Not as a dedicated feature, but everything in our review queue goes through our API so anything a human can do in /review is doable via the API. So you can create a dedicated user with moderation permissions for your integration, and generate an API key for that user.

Yes, but there are lots of variations in the details. The review queue only sees posts if they’re pending (based on site/category/user settings) or flagged by a user. If you need every post to go through your system you’d need to use the post webhooks like post_created/post_edited.

You can poll /review.json or use webhooks like reviewable_created/reviewable_updated. You can fetch individual items with /review/:id.json — this will include the actions available and current version.

To send an action back you can use PUT /review/:id/perform/:action_id?version=N. The version is required so you don’t create conflicts if the item has changed post fetch.

If you want to figure out how to execute a specific action, you can reverse engineer it by doing it in your browser via the Discourse UI and copying the request from the network tab, check out Reverse engineer the Discourse API

Discourse Akismet (probably closest example) and Discourse AI are both first-party plugins that can reach out to third parties as part of a flagging process. These might be useful to look at.

Also out of curiosity, which service are you looking to integrate?