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: 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)

curl -sSX POST https://chat.zulip.org/api/v1/messages/43/report \
    -u BOT_EMAIL_ADDRESS:BOT_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

The target message's ID.


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: "spam", "harassment", "inappropriate", "norms", "other".


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 a maximum length of 1000 characters.

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"
}