Remove a bot's stored data

DELETE https://podc-disc.zulipchat.com/api/v1/bot_storage

Note: This endpoint is only available to bot user accounts.

Delete data stored for a bot user.

Changes: Prior to Zulip 12.0 (feature level 494), users who were not bots could access this endpoint.

Usage examples

#!/usr/bin/env python3

import zulip

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

# Remove all data stored for a bot user.
result = client.call_endpoint(
    url="/bot_storage",
    method="DELETE",
)
print(result)

The -u line implements HTTP Basic authentication. See the Authorization header documentation for how to get those credentials for Zulip users and bots.

curl -sSX DELETE https://podc-disc.zulipchat.com/api/v1/bot_storage \
    -u EMAIL_ADDRESS:API_KEY \
    --data-urlencode 'keys=["foo"]'

Parameters

keys (string)[] optional

Example: ["foo"]

A JSON-encoded list of keys to delete from the bot's storage.

If not provided, then all data that's stored for the bot is deleted.


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 when a key to be deleted does not exist in the bot's storage:

{
    "code": "BAD_REQUEST",
    "msg": "Key does not exist.",
    "result": "error"
}

A typical failed JSON response when the user is not a bot:

{
    "code": "PERMISSION_DENIED",
    "msg": "Must be a bot user",
    "result": "error"
}