-
Notifications
You must be signed in to change notification settings - Fork 0
Updated Reporting system
Reporting API
Overview
Base URL (Production) https://inscriptions.cdacb.in/api
Authentication Authorization: Bearer (required on all endpoints)
POST /report Submit a new report
GET /reports Fetch all reports
POST /moderate/{id} Moderate a specific report
1. Create Report
Submit a report against a Post, Comment, or User for moderation review.
Request
POST https://inscriptions.cdacb.in/api/report
Headers
http
Authorization: Bearer <jwt-token>
Content-Type: application/json
Access: user · admin
json
{
"targetType": "POST",
"targetId": "6817a9d9f2b7b12c34d56789",
"reason": "SPAM",
"details": "This post is repeatedly promoting unrelated links."
}
reason Values
* `SPAM` Unsolicited or repetitive content
* `HATE_SPEECH` Content promoting hatred or discrimination
* `MISINFORMATION ` False or misleading information
-
HARASSMENTTargeting or bullying another user -
EXPLICIT_CONTENTInappropriate or adult content -
OTHERAny other violation not listed above
json
{
"targetType": "POST",
"targetId": "6817a9d9f2b7b12c34d56789",
"reason": "SPAM",
"details": "This post is repeatedly promoting unrelated links."
}
json
{
"targetType": "USER",
"targetId": "6817a9d9f2b7b12c34d56000",
"reason": "HARASSMENT",
"details": "This user has been sending threatening messages to multiple members."
}
2) GET /reports
Fetch all moderation reports. Supports optional filtering by report status.
Auth: Required Roles: admin · moderator · human_moderator · ai_moderator
Request
http
GET https://inscriptions.cdacb.in/api/reports
Authorization: Bearer <jwt-token>
status Allowed Values
PENDING Report filed but not yet picked up by AI screening
AI_SCREENING AI is currently evaluating the report
ESCALATED AI flagged it — waiting for a human moderator
RESOLVED Final decision made, report is closed
Example Requests
http
GET /reports
Authorization: Bearer <jwt-token>
Returns all reports regardless of status.
http
GET /reports?status=ESCALATED
Authorization: Bearer <jwt-token>
Returns only reports that are waiting for human review.
http
GET /reports?status=PENDING
Authorization: Bearer <jwt-token>
Returns reports that are queued for AI screening
Moderate an escalated report by taking a moderation action on the reported content or user.
Auth: Required Roles: admin · moderator · human_moderator · ai_moderator
Request
http
POST https://inscriptions.cdacb.in/api/moderate/{id}
Authorization: Bearer <jwt-token>
Content-Type: application/json
id string Yes The _id of the report to moderate (MongoDB ObjectId)
Body :
{
"action": "REMOVE_CONTENT",
"note": "Content clearly violates community spam guidelines."
}
IMPORTANT
When the report status is ESCALATED, the action field is required. Omitting it or sending an invalid value will return 400 Bad Request.
These are the only actions a human moderator can submit. The AI uses ESCALATE and NONE internally — do not pass those.
WARN Issues a warning to the content author. Content remains visible.
REMOVE_CONTENT Deletes the reported post or comment. Increments author report count.
BAN_AUTHOR Deletes the content and permanently bans the content author.
BAN_REPORTER Blacklists the reporter (used when the report is false/abusive). Restores the reported content.
DISMISS Dismisses the report as invalid. Restores the reported content.
Notes
This endpoint is for human moderation only. It is called when a report has status: ESCALATED (i.e., the AI could not auto-resolve it).
A moderator cannot moderate their own content. If the moderator's ID matches the content author's ID, the request will be rejected with 400.
The action field is required for ESCALATED reports. Only these actions are accepted: WARN, REMOVE_CONTENT, BAN_AUTHOR, BAN_REPORTER, DISMISS.
Every action is permanently recorded in auditEntries — this is the full audit trail for the report.
Side effects by action:
-
REMOVE_CONTENT — deletes the post or comment from the platform.
-
BAN_AUTHOR — deletes the content and marks the author as blacklisted.
-
BAN_REPORTER — blacklists the reporter and restores the reported content to ACCEPTED status.
-
DISMISS — restores the reported content to ACCEPTED status, no penalty applied.
-
WARN — restores the content and increments the author's report count.
Once a report is RESOLVED, calling this endpoint again will return 400 Bad Request.