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
userId — 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. If the same user has already reported the same target, the existing report is updated rather than duplicated.string
required
The Sublay user ID filing the report (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
Optional free-text details about the report.
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.Promise<CreateReportResponse>
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 Sublay user ID of 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", or "actioned".string
Sort order:
"new" (most recent first) or "old" (oldest first).number
Page number (1-indexed). Defaults to
1.number
Results per page. Defaults to
20.Promise<PaginatedResponse<Report>>
To act on a report (remove content, ban the author, or dismiss it), use
handleEntityReport / handleCommentReport on the
Space Moderation module.
