zulip/templates/zerver/api/update-message-flags.md

3.7 KiB

{generate_api_title(/messages/flags:post)}

{generate_api_description(/messages/flags:post)}

Usage examples

{start_tabs} {tab|python}

{generate_code_example(python)|/messages/flags:post|example}

{tab|js}

More examples and documentation can be found here.

{generate_code_example(javascript)|/messages/flags:post|example}

{tab|curl}

{generate_code_example(curl)|/messages/flags:post|example}

{end_tabs}

Parameters

{generate_api_arguments_table|zulip.yaml|/messages/flags:post}

Available flags

Flag Purpose
read Whether the user has read the message. Messages start out unread (except for messages the user themself sent using a non-API client) and can later be marked as read.
starred Whether the user has starred this message.
collapsed Whether the user has collapsed this message.
mentioned Whether the current user was mentioned by this message, either directly or via a user group. Cannot be changed by the user directly, but can change if the message is edited to add/remove a mention of the current user.
wildcard_mentioned Whether this message contained wildcard mention like @**all**. Cannot be changed by the user directly, but can change if the message is edited to add/remove a wildcard mention.
has_alert_word Whether the message contains any of the current user's configured alert words. Cannot be changed by the user directly, but can change if the message is edited to add/remove one of the current user's alert words.
historical True for messages that the user did not receive at the time they were sent but later was added to the user's history (E.g. because they starred or reacted to a message sent to a public stream before they subscribed to that stream). Cannot be changed by the user directly.

Response

Return values

{generate_return_values_table|zulip.yaml|/messages/flags:post}

Example response

A typical successful JSON response may look like:

{generate_code_example|/messages/flags:post|fixture(200)}