Reports
Report users for violations and manage report moderation.
Base Endpoint
Section titled “Base Endpoint”All report endpoints are prefixed with /reports
User Reporting
Section titled “User Reporting”Report User
Section titled “Report User”POST /reports/users/:userIdReport a user for violating community guidelines.
Authentication: Required
URL Parameters:
userId(string) - User ID to report
Request Body:
{ "reason": "HARASSMENT", "description": "Detailed description of the violation", "evidence": "Optional evidence or links"}Report Reasons:
HARASSMENT- Harassment or bullyingSPAM- Spam or unwanted contentINAPPROPRIATE_CONTENT- Inappropriate or offensive contentIMPERSONATION- Impersonating another userCHEATING- Cheating or exploitingOTHER- Other violations
Response:
{ "id": "report-id", "reporterId": "your-user-id", "reportedUserId": "user-id", "reason": "HARASSMENT", "status": "PENDING", "createdAt": "2024-01-01T00:00:00Z"}My Reports
Section titled “My Reports”Get My Reports
Section titled “Get My Reports”GET /reports/meGet all reports submitted by the current user.
Authentication: Required
Response:
{ "reports": [ { "id": "report-id", "reportedUser": { "id": "user-id", "username": "username", "displayName": "Display Name" }, "reason": "HARASSMENT", "status": "PENDING", "createdAt": "2024-01-01T00:00:00Z", "updatedAt": "2024-01-01T00:00:00Z" } ]}Report Statuses:
PENDING- Waiting for reviewUNDER_REVIEW- Being reviewed by a moderatorRESOLVED- Report has been resolvedDISMISSED- Report was dismissed
Get My Report Details
Section titled “Get My Report Details”GET /reports/:reportIdGet details of one of your submitted reports.
Authentication: Required
URL Parameters:
reportId(string) - Report ID
Response:
{ "id": "report-id", "reportedUser": { "id": "user-id", "username": "username" }, "reason": "HARASSMENT", "description": "Detailed description", "evidence": "Evidence provided", "status": "UNDER_REVIEW", "moderatorNotes": "Notes from moderator (if any)", "resolution": "Resolution details (if resolved)", "createdAt": "2024-01-01T00:00:00Z", "updatedAt": "2024-01-02T00:00:00Z"}Cancel Report
Section titled “Cancel Report”DELETE /reports/:reportIdCancel a pending report that you submitted.
Authentication: Required
URL Parameters:
reportId(string) - Report ID
Response:
{ "message": "Report cancelled successfully"}Note: Can only cancel reports with PENDING status.
Moderation Endpoints
Section titled “Moderation Endpoints”Get All Reports
Section titled “Get All Reports”GET /reports/moderation/allGet all reports for moderation.
Authentication: Required (Moderator, Admin, or Super Admin)
Query Parameters:
status(string, optional) - Filter by status (PENDING, UNDER_REVIEW, RESOLVED, DISMISSED)
Response:
{ "reports": [ { "id": "report-id", "reporter": { "id": "reporter-id", "username": "reporter" }, "reportedUser": { "id": "user-id", "username": "username" }, "reason": "HARASSMENT", "status": "PENDING", "createdAt": "2024-01-01T00:00:00Z" } ], "total": 15}Get Report Details
Section titled “Get Report Details”GET /reports/moderation/:reportIdGet detailed information about a report for moderation.
Authentication: Required (Moderator, Admin, or Super Admin)
URL Parameters:
reportId(string) - Report ID
Response:
{ "id": "report-id", "reporter": { "id": "reporter-id", "username": "reporter", "email": "reporter@example.com" }, "reportedUser": { "id": "user-id", "username": "username", "email": "user@example.com", "previousReports": 2 }, "reason": "HARASSMENT", "description": "Detailed description", "evidence": "Evidence", "status": "PENDING", "history": [...], "createdAt": "2024-01-01T00:00:00Z"}Moderate Report
Section titled “Moderate Report”PATCH /reports/moderation/:reportIdTake action on a report.
Authentication: Required (Moderator, Admin, or Super Admin)
URL Parameters:
reportId(string) - Report ID
Request Body:
{ "action": "RESOLVE", "resolution": "User has been warned", "moderatorNotes": "Internal notes about the decision", "userAction": "WARNING"}Actions:
TAKE_UNDER_REVIEW- Mark as under reviewRESOLVE- Resolve the report (action taken)DISMISS- Dismiss the report (no action needed)
User Actions: (when resolving)
WARNING- Issue a warningSUSPENSION- Suspend the userBAN- Ban the userNONE- No action taken on the user
Response:
{ "message": "Report moderated successfully", "report": { "id": "report-id", "status": "RESOLVED", "resolution": "User has been warned", "moderatedBy": "moderator-id", "moderatedAt": "2024-01-02T00:00:00Z" }}Delete Report
Section titled “Delete Report”DELETE /reports/moderation/:reportIdPermanently delete a report.
Authentication: Required (Admin or Super Admin)
URL Parameters:
reportId(string) - Report ID
Response:
{ "message": "Report deleted successfully"}Note: This action is permanent and should be used carefully.