Update the navigation view

PATCH https://chat.zulip.org/api/v1/navigation_views/{fragment}

Update the details of an existing configured navigation view, such as its name or whether it's pinned.

Changes: New in Zulip 11.0 (feature level 390).

Usage examples

#!/usr/bin/env python3

import zulip

# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")

# Update a navigation view's location
request = {
    "is_pinned": True,
}
result = client.call_endpoint(
    url=f"navigation_views/{fragment}",
    method="PATCH",
    request=request,
)
print(result)

curl -sSX PATCH https://chat.zulip.org/api/v1/navigation_views/narrow/is/alerted \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY \
    --data-urlencode is_pinned=true \
    --data-urlencode 'name=Watched Phrases'

Parameters

fragment string required in path

Example: "narrow/is/alerted"

The unique URL hash of the navigation view to be updated.

This also serves as the identifier for the navigation view.


is_pinned boolean optional

Example: true

Determines whether the view is pinned (true) or hidden in the menu (false).


name string optional

Example: "Watched Phrases"

The user-facing name for custom navigation views. Omit this field for built-in views.


Response

Example response(s)

Changes: As of Zulip 7.0 (feature level 167), if any parameters sent in the request are not supported by this endpoint, a successful JSON response will include an ignored_parameters_unsupported array.

A typical successful JSON response may look like:

{
    "msg": "",
    "result": "success"
}

A typical failed JSON response for invalid parameters.

{
    "code": "BAD_REQUEST",
    "msg": "Built-in views cannot have a custom name",
    "result": "error"
}

A typical failed JSON response when no navigation view exists with the provided fragment:

{
    "code": "NOT_FOUND",
    "msg": "Navigation view does not exist.",
    "result": "error"
}