Report a message
POST https://chat.zulip.org/api/v1/messages/{message_id}/report
Sends a notification to the organization's moderation request
channel, if it is configured, that
reports the targeted message for review and moderation.
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
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
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 Zulip users and bots.
curl -sSX POST https://chat.zulip.org/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_id integer required in path
Example: 43
report_type string required
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".
description string optional
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"
}