API User Reports
This section describes the User Reports management in the admin panel. Admins can view, filter, and take actions on user reports submitted by platform users
API Calls
- Fetch all user reports:
fetchAllUserReports
- Get a specific user report:
fetchUserReportById
- Take action on a user report:
handleUserReportAction
- Delete a user report:
deleteUserReport
- Get pending user reports count:
getPendingUserReportsCount
API Documentation
1. Get All User Reports
Endpoint: /reports/users
Method: GET
Description: Retrieves all user reports with filtering options.
Query Parameters:
page
: Number (pagination)limit
: Number (pagination limit)status
: String (pending
,resolved
)blockUser
: String (yes
,no
)
Response:
2. Get a Specific User Report
Endpoint: /reports/users/{reportId}
Method: GET
Description: Retrieves details of a specific reported user.
Response:
3. Take Action on a User Report
Endpoint: /reports/users/{reportId}/action
Method: POST
Description: Performs administrative actions on a reported user.
Request Body:
Available Actions:
block_user
– Blocks the reported user.delete_user
– Deletes the reported user account.resolve
– Marks the report as resolved.
Response:
4. Delete a User Report
Endpoint: /reports/users/{reportId}
Method: DELETE
Description: Deletes a user report from the system.
Response:
5. Get Pending User Reports Count
Endpoint: /reports/users/pending-count
Method: GET
Description: Retrieves the number of pending user reports.
Response:
Conclusion
The User Reports Management system ensures that administrators can efficiently handle reported users, maintaining community integrity on the platform. The API endpoints streamline moderation and provide a structured approach to handling reports.