Skip to main content
The reports module lets a user report an entity, comment, or chat message, and lets moderators read the queue of reports they’re responsible for.
Both functions act on behalf of a named user. Pass that user’s Sublay ID as actingUserId, the user your service key acts as. For createReport this is the reporter; for fetchModeratedReports it is the moderator whose queue is returned.

createReport

Files a report against an entity, comment, or chat message on behalf of a user. A user has at most one open report of a target: reporting it again returns that same report. Only content users posted can be reported: content with no author (the app’s own, or a deleted account’s) answers 400 report/no-author, and content its author deleted or a moderator removed answers 404 report/target-not-found. See Create Report.
string
required
The user the service key acts as: the reporter.
string
required
What is being reported: "entity", "comment", or "message".
string
required
The Sublay ID of the entity, comment, or chat message being reported.
ReportReason
required
One of spam, inappropriateContent, harassment, misinformation, hateSpeech, violence, illegalActivity, selfHarm, other. The API rejects anything else — use other plus details for the rest.
string | null
Optional free-text details about the report. null or an empty string stores none.
Reporting a chat message uses targetType: "message" with the message id as targetId — the conversation is resolved server-side. Reports on space conversations reach space moderators; reports on DMs and group chats are project-level and appear only in the Sublay dashboard.
Returns — Promise<CreateReportResponse>
The user’s own report of the target, never the shared report other reporters joined: the same record whether this call filed it or the user had already reported the open report. See Create Report.

fetchModeratedReports

Returns a paginated list of reports in the spaces the user moderates. Each report is aggregated across all users who reported the same target, and is populated with the target content and space.
string
required
The user the service key acts as: the moderator whose queue to fetch.
string
Filter to reports within a specific space.
string
Filter by target type: "entity", "comment", or "message". Message reports appear in this queue only for space conversations — DM and group reports are project-level and surface in the dashboard.
string
Filter by report status: "pending", "on-hold", "escalated", "dismissed", "actioned", or "auto-closed".
"createdAt"
Reports are sorted by when they were created.
"asc" | "desc"
Direction of the createdAt sort. Default "desc" (newest first).
number
Page number (1-indexed). Defaults to 1.
number
The number of reports to return per page: a whole number from 1 to 100. Defaults to 20. A larger value is rejected with 400 report/invalid-query, never lowered to 100.
Returns — Promise<PaginatedResponse<Report>>. Each report carries every user’s individual report in userReports ({ id, reportId, userId, reason, details, createdAt, updatedAt }), the moderator’s actionTaken (or null), and:
  • target — the reported content, typed by targetType: the stored entity, comment or chat message record with its author as user (User | null), without the computed fields and associations a regular fetch adds. null when the content can no longer be found.
  • space — the stored record of the space the report was filed in, or null.
To act on a report (remove content, ban the author, or dismiss it), use spaces.handleSpaceReport, which handles every report type in a space.