Reviews
Moderate user reviews — stats, list, approve / reject, delete.
Reviews live on reviewable_items (the thing being reviewed) and reviews (user-submitted). Aggregations are done server-side with COUNT(*) FILTER so stats never pull whole tables into Node.
Source: apps/api/src/routes/admin/reviews.ts.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /admin/projects/:projectId/reviews/stats | Total, avg rating, pending count, 1-5 distribution. |
| GET | /admin/projects/:projectId/reviews | Paginated reviews with user + item info; optional ?is_approved=true|false. |
| GET | /admin/projects/:projectId/reviews/export | Stream reviews as CSV/NDJSON. |
| PATCH | /admin/projects/:projectId/reviews/:reviewId | Flip is_approved. |
| DELETE | /admin/projects/:projectId/reviews/:reviewId | Hard-delete. |
| GET | /admin/projects/:projectId/reviews/items | Paginated list of reviewable items ordered by avg rating. |
GET /admin/projects/:projectId/reviews/stats
Response 200
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/reviews/statscurl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/reviews/stats'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/reviews
Query
| Param | Default | Description |
|---|---|---|
limit | 50 | |
offset | 0 | |
is_approved | — | "true" or "false". |
Response 200
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/reviewscurl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/reviews'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
PATCH /admin/projects/:projectId/reviews/:reviewId
Request
| Field | Type | Required |
|---|---|---|
is_approved | boolean | yes |
Errors
404 NOT_FOUND.
Try it:
PATCH
developer auth/admin/projects/%7B%7BprojectId%7D%7D/reviews/%7B%7BreviewId%7D%7Dcurl -X PATCH 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/reviews/%7B%7BreviewId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
DELETE /admin/projects/:projectId/reviews/:reviewId
Try it:
DELETE
developer auth/admin/projects/%7B%7BprojectId%7D%7D/reviews/%7B%7BreviewId%7D%7Dcurl -X DELETE 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/reviews/%7B%7BreviewId%7D%7D'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/reviews/export
Stream reviews as CSV (default) or NDJSON. Streamed via a postgres.js cursor with batch size 500.
Query
| Param | Type | Default | Description |
|---|---|---|---|
format | csv | ndjson | csv | Output format. |
since | ISO-8601 | — | Optional lower bound on created_at. |
rating_min | int (1-5) | 1 | Minimum star rating. |
rating_max | int (1-5) | 5 | Maximum star rating. |
Response 200
Content-Type: text/csv; charset=utf-8 or application/x-ndjson; charset=utf-8. Columns: id, reviewable_item_id, app_user_id, rating, title, body, is_approved, created_at, updated_at.
Errors
400 INVALID_SINCE—sinceis not a parseable ISO-8601 timestamp.400 INVALID_RATING_MIN/INVALID_RATING_MAX— outside 1-5.
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/reviews/exportcurl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/reviews/export'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl:
GET /admin/projects/:projectId/reviews/items
Reviewable items ordered by avg_rating DESC.
Query
| Param | Default |
|---|---|
limit | 50 |
offset | 0 |
Response 200
Try it:
GET
developer auth/admin/projects/%7B%7BprojectId%7D%7D/reviews/itemscurl -X GET 'https://api.amba.dev/admin/projects/%7B%7BprojectId%7D%7D/reviews/items'Loading auth… Configure auth in the settings drawer (top-right) to run this request.
Curl: