Edit a saved snippet
PATCH https://calyx.zulipchat.com/api/v1/saved_snippets/{saved_snippet_id}
Edit a saved snippet for the current user.
Changes: New in Zulip 10.0 (feature level 368).
Usage examples
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
# Edit a saved snippet.
request = {"title": "New welcome message", "content": "Welcome to Zulip!"}
result = client.call_endpoint(
request=request,
url=f"/saved_snippets/{saved_snippet_id}",
method="PATCH",
)
print(result)
curl -sSX PATCH https://calyx.zulipchat.com/api/v1/saved_snippets/3 \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
--data-urlencode 'title=Welcome message' \
--data-urlencode 'content=Welcome to the organization.'
Parameters
saved_snippet_id integer required in path
Example: 3
The ID of the saved snippet to edit.
title string optional
Example: "Welcome message"
The title of the saved snippet.
content string optional
Example: "Welcome to the organization."
The content of the saved snippet in text/markdown format.
Clients should insert this content into a message when using
a saved snippet.
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 when no saved snippet exists
with the provided ID:
{
"code": "BAD_REQUEST",
"msg": "Saved snippet does not exist.",
"result": "error"
}