Update a message
Edit/update the content or topic of a message.
PATCH https://omegaletter.chat/api/v1/messages/<msg_id>
<msg_id>
in the above URL should be replaced with the ID of the
message you wish you update.
Usage examples
curl -X "PATCH" https://omegaletter.chat/api/v1/messages/<msg_id> \ -u BOT_EMAIL_ADDRESS:BOT_API_KEY \ -d "content=New content"
#!/usr/bin/env python3 import zulip # Download ~/zuliprc-dev from your dev server client = zulip.Client(config_file="~/zuliprc-dev") # Edit a message # (make sure that message_id below is set to the ID of the # message you wish to update) request = { "message_id": message_id, "content": "New content" } result = client.update_message(request) print(result)
More examples and documentation can be found here.
const zulip = require('zulip-js'); // Download zuliprc-dev from your dev server const config = { zuliprc: 'zuliprc-dev', }; zulip(config).then((client) => { // Update a message const params = { message_id: 131, content: 'New Content', } client.messages.update(params).then(console.log); });
Permissions
You only have permission to edit a message if:
- You sent it, OR:
- This is a topic-only edit for a (no topic) message, OR:
- This is a topic-only edit and you are an admin.
Arguments
Argument | Example | Required | Description |
---|---|---|---|
message_id |
134 |
Required | The ID of the message that you wish to edit/update. |
subject |
Castle |
Optional | The topic of the message. Only required for a stream message. Defaults to |
content |
Hello |
Optional | The content of the message. Maximum message size of 10000 bytes. |
propagate_mode |
change_all |
Optional | In the case of a topic update, |
Response
Example response
A typical successful JSON response may look like:
{ "msg": "", "result": "success" }
A typical JSON response for when one doesn't have the permission to edit a particular message:
{ "code": "BAD_REQUEST", "msg": "You don't have permission to edit this message", "result": "error" }