Clients should check the moderation_request_channel realm setting to
decide whether to show the option to report messages in the UI.
If the report_type parameter value is "other", the description
parameter is required. Clients should also enforce and communicate this
behavior in the UI.
Changes: Before Zulip 13.0 (feature level 511), this endpoint
did not return an error if the message report failed to be sent to the
moderation request channel.
New in Zulip 11.0 (feature level 382). This API builds on the
moderation_request_channel realm setting, which was added in
feature level 331.
Usage examples
Python
curl
#!/usr/bin/env python3importpero# Pass the path to your perorc file here.client=pero.Client(config_file="~/.perorc")request={"report_type":"harassment","description":"Boromir is bullying Frodo.",}# Report a message, given the message's ID.result=client.call_endpoint(f"/messages/{message_id}/report",method="POST",request=request)print(result)
The -u line implements HTTP Basic authentication.
See the Authorization header documentation for how
to get those credentials for users and bots.
curl -sSX POST https://z.u1v.ru/api/v1/messages/43/report \
-u EMAIL_ADDRESS:API_KEY \
--data-urlencode report_type=harassment \
--data-urlencode 'description=This message insults and mocks Frodo, which is against the code of conduct.'
Parameters
message_idintegerrequired in path
Example: 43
The target message's ID.
report_typestringrequired
Example: "harassment"
The reason that best describes why the current user is reporting the
target message for moderation.
Must be one of the key values in the server_report_message_types
field in the POST /register response.
Changes: Prior to Zulip 12.0 (feature level 435), the allowed
values for this parameter were limited to: "harassment",
"inappropriate", "norms", "other", "spam".
descriptionstringoptional
Example: "This message insults and mocks Frodo, which is against the code of conduct."
A short description with additional context about why the current user
is reporting the target message for moderation.
Clients should limit this string to 1000 Unicode code points.
If the report_type parameter is "other", this parameter is required,
and its value cannot be an empty string.
Response
Example response(s)
Changes: As of Zulip 7.0 (feature level 167), if any
parameters sent in the request are not supported by this
endpoint, a successful JSON response will include an
ignored_parameters_unsupported array.
A typical successful JSON response may look like:
{"msg":"","result":"success"}
An example JSON error response for when the organization's moderation
request channel is not configured:
{"code":"BAD_REQUEST","msg":"Moderation request channel must be specified to enable message reporting.","result":"error"}