Overview
The moderation system provides:- Moderation queue: Centralized view of flagged content
- Status-based workflows: Content goes through pending → published → moderated states
- Role-based access: Moderators and admins can take moderation actions
- Audit logging: All moderation actions are logged
- User notifications: Authors are notified when content is moderated
- Self-moderation prevention: Users cannot moderate their own content
Moderation Permissions
Two permissions control moderation capabilities:- Moderators: Both
moderation.queueandmoderation.action - Administrators: Both permissions plus additional content deletion rights
- Regular users: No moderation permissions
Content Status Model
Most user-generated content follows a status-based lifecycle:Status Values
Content Types with Status
Moderation API
The moderation API is located at/api/admin/moderate.ts.
Endpoint
Request Body
Supported Content Types
blogComments- Blog post comments
reviews- Place reviewsforumPosts- Forum postsclassifieds- Classified adscomments- General comments
Authentication & Authorization
- User must be authenticated
- User must have
moderation.actionpermission - User cannot moderate their own content
- Content must exist and not already be moderated
Validation
- All fields are required
postTypemust be a valid entity typereasonmust be at least 5 characters
Self-Moderation Prevention
Moderation Action
- Update content status to
"moderated" - Send notification to content author with reason
- Return success response
Moderation Workflow
1
Content flagged or reported
User reports inappropriate content or automated system flags it
2
Appears in moderation queue
Moderators see flagged content in their moderation dashboard
3
Moderator reviews content
Moderator examines the content and context
4
Moderation decision
Moderator takes action:
- Approve: Keep published (remove from queue)
- Hide: Set status to
"moderated" - Delete: Soft-delete the content
5
Author notified
If content is moderated, author receives notification with reason
6
Audit logged
Moderation action is recorded in audit log
Notification System
When content is moderated, the author receives a notification:- Clear title indicating moderation
- Full reason provided by moderator
- Link to the moderated content (via
targetTypeandtargetId) - Type marker for filtering/display
Moderator Permissions
Moderators have extensive permissions to manage community content:Content Deletion Rights
Moderators can delete:- Reviews (any)
- Comments (any)
- Forum posts (any)
- Classifieds (any)
- Events (any)
- Groups (any)
- Galleries (any)
- Products (any)
- Pin threads (highlight important discussions)
- Lock threads (prevent further replies)
Admin vs Moderator
Error Codes
The moderation API returns specific error codes:Usage Example
Client-Side Request
Success Response
Error Response
Audit Logging
All moderation actions should be logged to the audit log:- Who performed the moderation (userId)
- What was moderated (targetId, postType)
- Why it was moderated (reason)
- When it occurred (createdAt)
Future Enhancements
Planned moderation features:Automated Moderation
Automated Moderation
- AI-based content filtering
- Automatic flagging of suspicious content
- Spam detection
- Profanity filters
Advanced Queue Management
Advanced Queue Management
- Priority levels for moderation queue
- Assignment of items to specific moderators
- SLA tracking for moderation response times
- Bulk moderation actions
Appeals Process
Appeals Process
- Users can appeal moderation decisions
- Appeal review by senior moderators
- Audit trail of appeals and outcomes
Moderation Templates
Moderation Templates
- Pre-defined moderation reasons
- Quick action buttons
- Custom response templates
Reporting System
Reporting System
- User-initiated content reports
- Report categorization
- Report status tracking
- Reporter notifications
Best Practices
1
Always provide clear reasons
When moderating content, provide specific, actionable reasons so authors understand what violated community standards.
2
Be consistent
Apply moderation standards consistently across all users and content types to maintain fairness.
3
Review context
Before moderating, review the full context of the content, including surrounding discussion and user history.
4
Document decisions
Use the audit log to track patterns and ensure moderation actions are defensible.
5
Respond promptly
Process moderation queue items quickly to maintain community trust and content quality.
6
Educate users
Use moderation as an opportunity to educate users about community standards.