zulip/templates/zerver/api/update-message.md
Suyash Vardhan Mathur 1fa82c2fcd apidocs: Fix response in API templates.
Now, the descriptions and all subschemas
are directly returned just by
`generate_code_example`, and so, these individual
subschemas and descriptions can be removed from the
templates.

All API endpoints docs are exactly the same after the
change, except few where missing 400 responses got added
due to the modification
2021-06-09 12:43:12 -07:00

1.0 KiB

{generate_api_title(/messages/{message_id}:patch)}

{generate_api_description(/messages/{message_id}:patch)}

Usage examples

{start_tabs} {tab|python}

{generate_code_example(python)|/messages/{message_id}:patch|example}

{tab|js}

More examples and documentation can be found here.

{generate_code_example(javascript)|/messages/{message_id}:patch|example}

{tab|curl}

{generate_code_example(curl, exclude=["stream_id"])|/messages/{message_id}:patch|example}

{end_tabs}

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

Parameters

{generate_api_arguments_table|zulip.yaml|/messages/{message_id}:patch}

Response

Example response

{generate_code_example|/messages/{message_id}:patch|fixture(200)}

{generate_code_example|/messages/{message_id}:patch|fixture(400)}