Delete a message

Permanently delete a message.

DELETE https://yourZulipDomain.zulip.iemn.fr/api/v1/messages/<msg_id>

This API corresponds to the delete a message completely feature documented in the Zulip Help Center.

Usage examples

#!/usr/bin/env python

import zulip

# The user for this zuliprc file must be an organization administrator
client = zulip.Client(config_file="~/zuliprc-admin")

# Delete the message with ID "message_id"
result = client.delete_message(message_id)
print(result)

curl -X DELETE https://yourZulipDomain.zulip.iemn.fr/api/v1/messages/{message_id} \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY \

Arguments

Argument Example Required Description
message_id 42 Yes

The ID of the message to delete.

Response

Example response

A typical successful JSON response may look like:

{
    "msg": "",
    "result": "success"
}

An example JSON response for when the specified message does not exist:

{
    "code": "BAD_REQUEST",
    "msg": "Invalid message(s)",
    "result": "error"
}

An example JSON response for when the user making the query does not have permission to delete the message:

{
    "code": "BAD_REQUEST",
    "msg": "You don't have permission to delete this message",
    "result": "error"
}