From 96daef400e5e1a2c653ef9f92e4ae2000d7d9748 Mon Sep 17 00:00:00 2001 From: David Rosa Date: Fri, 9 Feb 2024 14:49:12 -0700 Subject: [PATCH] api-docs: Update "API keys". Updates API doc to follow current help center documentation patterns. Fixes #28876. --- api_docs/api-keys.md | 73 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/api_docs/api-keys.md b/api_docs/api-keys.md index 1f902fa9e8..bc0b3ee958 100644 --- a/api_docs/api-keys.md +++ b/api_docs/api-keys.md @@ -1,34 +1,89 @@ # API keys -An **API key** is how a bot identifies itself to Zulip. Anyone with a -bot's API key can impersonate the bot, so be careful with it! +An **API key** is how a bot identifies itself to Zulip. For the official +clients, such as the Python bindings, we recommend [downloading a `zuliprc` +file](/api/configuring-python-bindings#download-a-zuliprc-file). +This file contains an API key along with other necessary configuration values +for using the Zulip API with a specific account on a Zulip server. ## Get a bot's API key +{start_tabs} + +{tab|desktop-web} + {settings_tab|your-bots} 1. Click **Active bots**. 1. Find your bot. The bot's API key is under **API KEY**. +{end_tabs} + +!!! warn "" + + Anyone with a bot's API key can impersonate the bot, so be careful with it! + ## Get your API key -Anyone with your API key can impersonate you, so be doubly careful with it. +{start_tabs} + +{tab|desktop-web} {settings_tab|account-and-privacy} 1. Under **API key**, click **Manage your API key**. 1. Enter your password, and click **Get API key**. If you don't know your - password, click **reset it** and follow the - instructions from there. + password, click **reset it** and follow the instructions from there. 1. Copy your API key. +{end_tabs} + +!!! warn "" + + Anyone with your API key can impersonate you, so be doubly careful with it. + + ## Invalidate an API key -To invalidate a key, follow the instructions above, and click -**Generate new API key** or click the **refresh** -() icon as appropriate. +To invalidate an existing API key, you have to generate a new key. -This will generate a new key for you or the bot, and invalidate the old one. +### Invalidate a bot's API key + +{start_tabs} + +{tab|desktop-web} + +{settings_tab|your-bots} + +1. Click **Active bots**. + +1. Find your bot. + +1. Under **API KEY**, click the **refresh** () icon + to the right of the bot's API key. + +{end_tabs} + +### Invalidate your API key + +{start_tabs} + +{tab|desktop-web} + +{settings_tab|account-and-privacy} + +1. Under **API key**, click **Manage your API key**. + +1. Enter your password, and click **Get API key**. If you don't know your + password, click **reset it** and follow the instructions from there. + +1. Click **Generate new API key** + +{end_tabs} + +## Related articles + +* [Configuring the Python bindings](/api/configuring-python-bindings)