2020-06-19 07:30:42 +02:00
|
|
|
# Edit a message
|
2018-01-04 23:49:11 +01:00
|
|
|
|
2020-04-28 20:00:46 +02:00
|
|
|
{generate_api_description(/messages/{message_id}:patch)}
|
2018-01-04 23:49:11 +01:00
|
|
|
|
|
|
|
## Usage examples
|
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{start_tabs}
|
|
|
|
{tab|python}
|
2018-01-19 17:43:26 +01:00
|
|
|
|
2018-05-15 19:28:42 +02:00
|
|
|
{generate_code_example(python)|/messages/{message_id}:patch|example}
|
2018-01-19 17:43:26 +01:00
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{tab|js}
|
2018-01-04 23:49:11 +01:00
|
|
|
|
2018-01-13 22:40:16 +01:00
|
|
|
More examples and documentation can be found [here](https://github.com/zulip/zulip-js).
|
2020-06-22 00:31:56 +02:00
|
|
|
|
|
|
|
{generate_code_example(javascript)|/messages/{message_id}:patch|example}
|
2018-01-13 22:40:16 +01:00
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{tab|curl}
|
|
|
|
|
2020-02-19 01:38:34 +01:00
|
|
|
{generate_code_example(curl, exclude=["stream_id"])|/messages/{message_id}:patch|example}
|
2018-01-04 23:49:11 +01:00
|
|
|
|
2018-09-17 16:27:32 +02:00
|
|
|
{end_tabs}
|
2018-01-04 23:49:11 +01:00
|
|
|
|
2018-01-20 22:03:05 +01:00
|
|
|
## Permissions
|
|
|
|
|
|
|
|
You only have permission to edit a message if:
|
|
|
|
|
|
|
|
1. You sent it, **OR**:
|
|
|
|
2. This is a topic-only edit for a (no topic) message, **OR**:
|
2020-06-14 17:00:27 +02:00
|
|
|
3. This is a topic-only edit and you are an admin, **OR**:
|
|
|
|
4. This is a topic-only edit and your realm allows users to edit topics.
|
2018-01-20 22:03:05 +01:00
|
|
|
|
2020-06-18 15:35:25 +02:00
|
|
|
## Parameters
|
2018-01-20 22:03:05 +01:00
|
|
|
|
2018-05-15 19:28:42 +02:00
|
|
|
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}:patch}
|
2018-01-20 22:03:05 +01:00
|
|
|
|
2018-01-04 23:49:11 +01:00
|
|
|
## Response
|
|
|
|
|
|
|
|
#### Example response
|
|
|
|
|
|
|
|
A typical successful JSON response may look like:
|
|
|
|
|
2018-05-15 19:28:42 +02:00
|
|
|
{generate_code_example|/messages/{message_id}:patch|fixture(200)}
|
2018-01-04 23:49:11 +01:00
|
|
|
|
|
|
|
A typical JSON response for when one doesn't have the permission to
|
|
|
|
edit a particular message:
|
|
|
|
|
2018-05-15 19:28:42 +02:00
|
|
|
{generate_code_example|/messages/{message_id}:patch|fixture(400)}
|