Discourse provides a robust REST API that allows you to:
- List all users, groups, and user-group memberships
- Monitor new user registrations and group join/leave actions (via polling or webhooks)
- Retrieve category membership configurations
You can query either the full list or attempt to track recent changes. For full incremental change detection, you may need to implement time-based checks and manage differences locally. Authentication is handled through HTTP headers (Api-Key, Api-Username).
However, for more efficient and integrated control, I recommend creating a custom Discourse plugin. A plugin runs inside the Discourse server environment and provides direct access to Discourse internals, such as:
- User, group, and category membership updates
- Lifecycle event hooks for registrations and group changes
- Direct access to Discourse’s internal APIs and database
This approach gives you real-time capabilities and greater flexibility for implementing automated workflows like mail handling or user segmentation.