Content reports API
The content reports API manages user-filed moderation reports against AI-generated content. Reports are produced by the Report button in the Chat view and reviewed in the Content reports view (Organisation › Governance & security › Content reports for a tenant user, or Platform › Operations › Feedback & reports › Content reports for the platform admin; the old /reports address redirects by role).
All endpoints require an authenticated admin session.
Listing reports
GET /admin/v1/reports
Required permission: TENANT_SETTINGS_MANAGE — held by default by an admin or tenant admin, and delegable by a tenant admin to a custom role.
The result is tenant-scoped on the server: every caller sees only reports from their own tenant, except a platform admin (the admin role), who sees reports across all tenants. Delegating TENANT_SETTINGS_MANAGE to a custom role never widens this — a custom-role holder is still confined to their own tenant. Paging (offset/limit) does not bypass the scope: a high offset returns later pages of the caller's own tenant only, never another tenant's rows.
Optional query parameters:
| Parameter | Description |
|---|---|
status |
Filter by status: open, triaged, or dismissed. The value is not validated: any other value matches no report and returns an empty array. |
limit |
Maximum reports to return. Default 100, clamped to 500. Anything but a plain integer ≥ 1 is 400 {"code": "invalid_limit"}. |
offset |
Number of reports to skip, for paging. Default 0. Anything but a plain integer ≥ 0 is 400 {"code": "invalid_offset"}. |
The response is 200 with an array of report objects (fields listed below), newest first (created_at descending). A non-platform caller without a tenant is refused 403. A transient database fault returns 503.
Updating a report
PATCH /admin/v1/reports/<ID>
Required permission: TENANT_SETTINGS_MANAGE.
The same tenant scope applies: a non-platform caller may update only a report that belongs to their own tenant. A PATCH targeting a report in another tenant is answered exactly like an unknown report id — 404 { "error": "not found" } — and the row is left unchanged. Recorded as access.denied (status 404, no entity; see ids of another tenant). A platform admin may update a report in any tenant.
Validation. status must be exactly open, triaged, or dismissed; an absent body, an absent status or "" is rejected 400 {"error":"invalid status","code":"status_required"}; null, a non-string (number, boolean, object, array), a whitespace-only string (" "; status is never trimmed, only the trimmed free-text fields treat blank as absent) or an unknown value is rejected 400 {"error":"invalid status","code":"invalid_status"}. Nothing is written. An unknown <ID> returns 404 { "error": "not found" }, identical to another tenant's report; a transient database fault returns 503 (retryable).
| Field | Type | Description |
|---|---|---|
status |
open | triaged | dismissed |
The new status. |
Response: 200 {"ok": true}.
Every successful PATCH sets triaged_by_id to the calling user's ID. Setting triaged or dismissed sets triaged_at to the current time (also when the status was already triaged or dismissed); setting open clears triaged_at to null. A report that leaves open is also marked processed in the unified triage queue; setting open un-marks it.
Filing a report
POST /admin/v1/reports
The body must be valid JSON: a string carrying an invalid escape (for example a lone UTF-16 surrogate such as \ud83d) is refused 400 malformed_body and no report is stored. The web app replaces any lone surrogate with U+FFFD (�) before sending.
Required role: authenticated.
| Field | Type | Required | Description |
|---|---|---|---|
reason |
offensive | inaccurate | unsafe | other |
Yes | The reason flag. Absent → 400 {"error":"reason required","code":"reason_required"}; "" or blank (invisible characters only) → 400 {"error":"invalid reason","code":"reason_required"}; false → 400 {"error":"reason required","code":"invalid_reason"}; null, any other non-string or an unknown string → 400 {"error":"invalid reason","code":"invalid_reason"}. The sentences are the historic ones and are shared between absent and malformed values; branch on code. |
conversation_id |
string | No | Source conversation. It must be a conversation the reporter can open (own, shared or team-visible); otherwise 404 not found (audited, identical to a missing conversation, nothing written). A non-string → 400 invalid_conversation_id; a blank, over-36-byte or invalid-UTF-8 string → 400 invalid_id. null/absent → no link. A client-side placeholder id (ghost- followed by at most 36 id characters, a conversation not yet saved) is filed without a link, not an error; any other ghost- string → 400 invalid_id. A report without a conversation link is not covered by conversation erasure. |
message_id |
string | No | Reported message identifier. Must belong to conversation_id; a stale or foreign message id drops only the message link (the report and the conversation link are kept). A bare message_id without a conversation, and a ghost-... placeholder, are filed without a link. A non-string → 400 invalid_message_id; a blank, over-36-byte or invalid-UTF-8 string → 400 invalid_id. |
message_text |
string | No | Snapshot of the reported message body. Truncated to 16 000 bytes on a UTF-8 codepoint boundary (never mid-character); invalid UTF-8 bytes are scrubbed to U+FFFD; null/blank → SQL NULL; a non-string → 400 invalid_message_text. |
notes |
string | No | Free-form notes from the reporter. Truncated to 2 000 bytes on a codepoint boundary; invalid UTF-8 scrubbed; null/blank → SQL NULL; a non-string → 400 invalid_notes. |
request_log_id |
string | No | Identifier of the related request-log row. Must match [A-Za-z0-9-] and be at most 36 characters, otherwise 400 invalid_id. The id is matched byte-exact (case-sensitive, no trailing-space match): a case variant of a real id is treated as not found and the link is dropped; a non-string → 400 invalid_request_log_id. The report is always filed: the link is dropped and request_log_id is stored as null when the caller has no tenant, the request-log row has no tenant, the row is not written yet (the entry is written shortly after the response finishes), or it belongs to another tenant. A storage fault while checking the link answers 503. With the setting request_log_read_source_report_intake on "clickhouse" the decision and the stored report are unchanged; ClickHouse is only compared in the log. |
client_context |
object | No | Client-side context (page, build, etc.) captured by the SPA. Not a JSON object (an array, including [], a string, a number) → 400 {"error":"client_context must be an object","code":"invalid_client_context"}; an unsupported schema_version → 400 invalid_schema_version; a context over the size cap → 400 client_context_too_large; null/absent → not stored. String values are UTF-8-scrubbed before storage. Legacy keys (submitted_at, app_version, app_type, uptime_sec, timezone, locale, screen, viewport, user_agent, platform, online, connection, save_data, color_scheme, reduced_motion, current_route, referrer, battery_pct, battery_charging) are each typed: a value outside its shape is dropped and the server sets _<key>_invalid: true (the report is still stored); the per-key shapes, the 3075-byte text limit and the back-compat note for rows stored before 2026-11-05 are under App feedback — submitting an entry. last_deeplink (optional): the native app shell's verdict on the last tapped link, exactly { "received_at_ms", "via", "route", "outcome" } with received_at_ms an integer 0..4102444800000, via one of activity / openURL / intent, route one of shared / auth / c / other (a route class, never a path or token) and outcome one of loaded / dropped_host / dropped_scheme / dropped_app_complete / dropped_env / switch_prompted. Absent or null → nothing stored. Anything else (not an object, an array, a missing or extra key, a wrong type, an unknown enum value, an out-of-range or fractional timestamp) is dropped and the server records _last_deeplink_invalid: true in the stored context instead, so triage can tell "no link" from "garbage"; the request is still accepted (the last_deeplink value itself never causes a 400; the context-level size and schema rules still apply). _last_deeplink_invalid is set only by the server: a client-sent copy is stripped. recent_errors / recent_failed_requests (optional diagnostic rings): each is a JSON array of at most 20 items, oldest first, and every item is a closed record of TYPED fields only; there is no free-text field, so no error message, request or response body, header, cookie, token, query string or stack text can be represented. recent_errors item: at_ms (integer 0..4102444800000) and source (report / uncaught / rejection / react) are required; optional tag (1-64 characters of a-z 0-9 : _ . / -, starting with a letter, with no run of six or more digits, no 32-hex run and no UUID-shaped part), name (1-40 letters/digits, starting with a letter), status (integer 100-599), code (1-64 of A-Za-z0-9_.:-, no run of six or more digits), transport (offline / timeout / interrupted / blocked / unreachable / unverified), frame (<file>.<js|mjs|jsx|ts|tsx>:<line>:<col> of the app's own bundle, file name only, no path) and count (integer 2-1000000, the number of collapsed repeats). recent_failed_requests item: required at_ms, method (GET / POST / PUT / PATCH / DELETE / HEAD / OPTIONS), host (host[:port] in lower case, a bracketed IPv6 literal such as [::1]:8080 (2 to 45 characters of 0-9 a-f : . between the brackets, at least two :), or - when the URL was unparsable; a host that fails this shape drops the whole array and sets _recent_failed_requests_invalid) and endpoint (a route template of at most 256 bytes of a-z 0-9 / : _ -, cut at a segment boundary); optional status, code, request_id (32 lower-case hex characters or a lower-case UUID), transport and origin (app / cdn_block / cdn_upstream). The server re-templates endpoint itself, for every item whatever its host: the segment after a share or shared segment becomes :token; a segment is then kept only if it is empty, a placeholder (:id, :token, :seg), an API version of one to three digits such as v1, or a known route word, one of the fixed path words of the admin API routes (for example admin, conversations, feedback, stats; a word list derived from the route table and pinned by a test). A segment shaped like a route word (lower-case letters, words joined by - or _, up to 32 characters) that is not a known route word, such as a tenant, organisation or gateway slug, becomes :seg; everything else (digits, uuids, hex, mixed case, any other character) becomes :id. The app sends the endpoint / for a request to a host that is not one of its own API hosts. Stated assumption: only share / shared segments carry a bearer secret; every kept segment is a route word the server itself defines. Absent (key missing, null, or an empty [] / {}, which JSON decoders cannot tell apart) stores nothing and sets no marker. Malformed (not an array, more than 20 items, a non-object item, a missing or unknown key such as message, body, authorization, headers, cookie, stack, url or query, a value outside its charset, range or enum, or text that does not match exactly, including a trailing newline) drops the WHOLE array and the server records _recent_errors_invalid: true / _recent_failed_requests_invalid: true; the request is still accepted. A client-sent _recent_errors_invalid / _recent_failed_requests_invalid is stripped: only the server sets them. The shared 16 KiB client_context cap still applies (client_context_too_large). Never collected: error messages, stack text, request or response bodies, headers, cookies, authorization values, query strings, URL fragments, user or conversation content, and any identifier that survives templating. The shared token mask also covers the API share route: the segment after a share segment (same case-insensitive, percent-decoded match) is replaced by :token wherever a path is scrubbed. native_os is derived by the server from the MYRAai app token in user_agent; it is server-only (a client-sent copy and _native_os_invalid are stripped) and its grammar and absent vs malformed rules are under App feedback — submitting an entry. ua_hints / ua_hints_failure (and the app-state keys) follow the contract under App feedback — submitting an entry, including absent vs malformed, the server-only _ua_hints_invalid / _ua_hints_failure_invalid markers, and the stripping of a client-sent copy. referrer / current_route are URL-scrubbed before storage: the path segment after a shared segment becomes :token, a referrer keeps only an absolute http(s) origin and path (no userinfo, query or fragment), and a malformed, non-http(s) or non-string value is dropped and flagged with a server-set _referrer_invalid: true / _current_route_invalid: true (the report is still stored). The SPA keeps its context well inside the cap: it always shortens every top-level text value longer than 1024 characters to that length plus a trailing "…" (a trailing "…" on such a field is a client cut, not the real value), and omits the context if its estimate of the server encoding is still over 8 KiB. |
Response: 201 { "id": "..." }
Every free-text and identifier field is sanitized at this trust boundary: a JSON null (which is truthy server-side) never persists a literal "userdata: NULL", a value of the wrong JSON type is rejected (400 {"error": "<field> must be a string", "code": "invalid_<field>"}) instead of being stringified into the row, an over-long or invalid value never reaches the database as-is, and no input path returns a 5xx.
💡 Note: Each filed report is also mirrored, best-effort, into the unified triage queue (
source="content_report"). Mirroring never fails the submission and content reports are not included in the triage notification digest.
Report object fields
| Field | Type | Description |
|---|---|---|
id |
string | Report identifier. |
user_id |
string | The reporting user. |
user_email |
string | null | Email of the reporting user. |
tenant_id |
string | null | Tenant of the reporting user at filing time. |
conversation_id |
string | null | Source conversation. |
message_id |
string | null | Reported message identifier. |
message_text |
string | null | A snapshot of the reported message body. |
reason |
offensive | inaccurate | unsafe | other |
The reason flag chosen by the reporter. |
notes |
string | null | Optional free-form notes from the reporter. |
status |
open | triaged | dismissed |
Current status. |
created_at |
unix seconds | Submission timestamp. |
triaged_at |
unix seconds | null | Set when the status leaves open. |
triaged_by_id |
string | null | User who triaged or dismissed the report. |
request_log_id |
string | null | The request-log entry the reported message belongs to, when known. |
request_log_provider |
string | null | Provider that served the reported message. |
request_log_model |
string | null | Model that served the reported message. |
request_log_status |
integer | null | HTTP status of the underlying request. |
request_log_latency_ms |
integer | null | Upstream latency of the underlying request, in milliseconds. |
request_log_input_tokens |
integer | null | Input token count of the underlying request. |
request_log_output_tokens |
integer | null | Output token count of the underlying request. |
request_log_payload_expired |
boolean | true when the operator-run payload expiry deleted the prompt and response of the underlying request-log entry; false otherwise, including when no entry is linked or its content was never logged. |
request_log_payload_expired_at |
integer | null | Unix seconds when the content expired; null when request_log_payload_expired is false or the stored marker is unreadable. |
client_context |
object | null | Client-supplied context captured with the report. |