Get a bot's API key

GET https://chat.zulip.org/api/v1/bots/{bot_id}/api_key

Fetch the API key for a bot user. Only the bot's owner and organization administrators have access to a bot's API key.

Changes: New in Zulip 12.0 (feature level 463).

Usage examples

curl -sSX GET -G https://chat.zulip.org/api/v1/bots/16/api_key \
    -u BOT_EMAIL_ADDRESS:BOT_API_KEY

Parameters

bot_id integer required in path

Example: 16

The user ID of the target bot.


Response

Return values

  • api_key: string

    The API key for the bot.

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:

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

An example JSON response when the bot ID is invalid:

{
    "code": "BAD_REQUEST",
    "msg": "No such bot",
    "result": "error"
}