Reporting Content
Mobile review/community-post reporting, permanent duplicate handling, content snapshots, and the admin moderation actions.
The current mobile contract reports reviews and community posts through one authenticated endpoint:
POST /api/v1/reports HTTP/1.1
Authorization: Bearer oat_xxx
Content-Type: application/json
{
"targetType": "review",
"targetId": "rev_01jq...",
"reason": "harassment",
"note": "Targets another user by name."
}The server verifies that the content exists and is still visible, rejects reporting your own content, freezes a content/author snapshot for moderators, and creates the report at status: "pending".
The duplicate contract is permanent for the same (reporter, targetType, targetId). A second
mobile report returns 409 ALREADY_REPORTED, even after moderation closes the first report.
Disable the report action after a successful submission or handle the 409 as “already sent.”
Mobile create contract
Request fields
| Field | Rules |
|---|---|
targetType | Required: review or community_post. |
targetId | Required string, max 30 characters. |
reason | Required enum listed below. |
note | Optional free text, max 500 characters. |
Accepted reason values:
spam
harassment
hate_speech
inappropriate
scam
false_information
otherSuccess response — 201
{
"data": {
"id": "rpt_01jq...",
"targetType": "review",
"targetId": "rev_01jq...",
"reason": "harassment",
"status": "pending",
"createdAt": "2026-07-13T12:00:00.000Z"
},
"meta": { "requestId": "req_01..." }
}The mobile app only needs the 2xx result to show its confirmation. Filing a report does not immediately hide the content.
Expected errors
| Status | Code | Meaning |
|---|---|---|
401 | AUTH_REQUIRED | Missing or invalid Bearer token. |
403 | FORBIDDEN | The caller authored the target content. |
404 | NOT_FOUND | Target missing, deleted, or no longer visible. |
409 | ALREADY_REPORTED | Caller previously reported this target. |
422 | VALIDATION_ERROR | Invalid target/reason or note longer than 500 chars. |
429 | RATE_LIMITED | More than 20 report attempts in one hour. |
What is snapshotted
For a review, moderation receives the review text, rating, original creation time, and author id/name. For a community post it receives the body, creation time, and author id/name. Later edits or deletion do not erase the evidence attached to the report.
The API rejects self-reports by comparing the authenticated user with the snapshotted author.
Legacy compatibility route
Older clients remain supported:
POST /api/v1/reviews/:reviewId/report
{ "reportType": "inappropriate", "description": "..." }This wrapper retains the legacy nested response and legacy new | under_review | resolved | rejected lifecycle. Existing generic requests using reportType also remain accepted. New mobile work should use reason on POST /api/v1/reports and should parse the top-level data response shown above.
Admin moderation API
These routes require an authenticated admin role and are not part of the customer app.
Queue and grouping
GET /api/v1/admin/reports?status=pending&targetType=review&reason=harassment&group=target&limit=20&cursor=...Supported filters are status, targetType, reason, priority, from, to, group=target, cursor, and limit. Each item includes:
- reporter id/name;
- target and author ids;
- reason, note, status, resolution, and moderation metadata;
reportsCountfor the same target;- the frozen
contentsnapshot and author; - resolution/admin timestamps.
GET /api/v1/admin/reports/:id returns the selected report plus every report filed against the same target. GET /api/v1/admin/reports/summary returns { pending, reviewing, last7Days }.
Take action
PATCH /api/v1/admin/reports/:id
Content-Type: application/json
{ "action": "remove_content", "adminNote": "Community policy violation." }| Action | Result |
|---|---|
remove_content | Soft-deletes/moderates the review or community post, resolves all reports for that target with content_removed, and recalculates truck review aggregates when needed. |
dismiss | Keeps the content and dismisses this report with content_kept. |
warn_user | Notifies the content author and resolves related target reports with user_warned. |
ban_user | Bans the author, revokes access/device tokens, and resolves related target reports with user_banned. |
Every action records resolvedBy, resolvedAt, adminNote, and an audit-log entry. The legacy admin status body remains accepted for the existing web dashboard.
Mobile integration checklist
- Send only
revieworcommunity_postfor the new contract. - Send the exact
reasonenum value; UI labels remain client-localized. - Keep
noteat or below 500 characters. - Treat
201as queued, not removed. - Treat
409 ALREADY_REPORTEDas a stable already-submitted state. - Do not build a “My reports” polling screen; there is no mobile list endpoint.
Related
Support Tickets
How a signed-in customer opens a support ticket, reads their tickets, and runs the chat-style reply thread with the support team — including why a "create" lands live and why a resolved ticket goes read-only.
Payments — Paymob, Cards & Webhooks
How an owner pays for a featured truck, an advertised job, or a distributed marketplace listing — the quote → create → pay → webhook pipeline, and why the paid create call is only an intent until settlement.