POST /messages/flags/narrow

Add or remove personal message flags like read and starred on a range of messages within a narrow.

See also the endpoint for updating flags on specific message IDs.

Changes: New in Zulip 6.0 (feature level 155).

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

Request body fields

Name Type Required Description
narrow[] Array Yes

The narrow you want update flags within. See how to construct a narrow.

Note that, when adding the read flag to messages, clients should consider including a narrow with the is:unread filter as an optimization. Including that filter takes advantage of the fact that the server has a database index for unread messages.

Changes: See changes section of search/narrow filter documentation.

flag String Yes

The flag that should be added/removed. See available flags.

num_before Integer Yes

Limit the number of messages preceding the anchor in the update range. The server may decrease this to bound transaction sizes.

num_after Integer Yes

Limit the number of messages following the anchor in the update range. The server may decrease this to bound transaction sizes.

op String Yes

Whether to add the flag or remove it.

Valid values:

  • "remove"
  • "add"
anchor String Yes

Integer message ID to anchor updating of flags. Supports special string values for when the client wants the server to compute the anchor to use:

  • newest: The most recent message.
  • oldest: The oldest message.
  • first_unread: The oldest unread message matching the query, if any; otherwise, the most recent message.
include_anchor Boolean No

Whether a message with the specified ID matching the narrow should be included in the update range.

Default value: true

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.