Skip to main content

Overview

Reviews Admin API provides moderation tools for managing flagged reviews, processing review reports, viewing platform-wide review analytics, and maintaining content quality across the platform. All functions require admin authorization. Location: convex/admins/reviewsAdmin.ts

Get Flagged Reviews

Lists flagged reviews with pagination. Returns flag details, review content, customer info, reporter info, and store info.
paginationOpts
PaginationOptions
required
Pagination options
status
string
Filter by flag status: pending, reviewed, dismissed, action_taken

Process Review Flag

Takes action on a flagged review. Updates the flag status and optionally modifies or removes the review.
flagId
Id<'reviewFlags'>
required
Flag ID to process
action
string
required
Action to take:
  • dismiss — Flag is dismissed, review stays visible
  • hide_review — Review is hidden (isVisible set to false), flag marked as action_taken
  • remove_review — Review and all associated data (votes, flags) are permanently deleted
  • warn_customer — Flag marked as action_taken (customer warning system is TODO)
adminNotes
string
Admin notes about the decision

Get Review Statistics

Returns platform-wide review analytics. When no timeRange is specified, uses pre-computed all-time aggregate stats for fast reads. Time-filtered queries compute stats on the fly.
timeRange
string
Filter period: 7d, 30d, 90d, 1y. Omit for all-time stats (fastest).
Top rated stores require a minimum of 3 reviews to appear in the ranking. Up to 10 stores are returned.

Bulk Hide Reviews

Hides multiple reviews at once. Sets isVisible to false for each review and recalculates stats for all affected stores.
reviewIds
Id<'storeReviews'>[]
required
Array of review IDs to hide
reason
string
required
Reason for bulk hiding

Get Store Review Summary

Returns a detailed review summary for a specific store, including all reviews (visible and hidden), statistics, and the 10 most recent reviews with customer names.
storeId
Id<'stores'>
required
Store ID to get summary for
Unlike the customer-facing store reviews query, this admin view includes hidden reviews in the total count and statistics.