Skip to main content
Access Bots endpoints via client.bots (BotsClient).

Methods

create_bot

POST /2/bots Create a Bot Creates a bot account in the calling app’s project and returns its bearer token. Idempotent on handle: repeating the request for a handle that already names one of the project’s bots returns that bot with a freshly minted token, revoking the previous one — safe to retry when a response was lost, since the replaced token was never seen. With an OAuth 2.0 user token, the user must be an admin of the project’s developer account. On API Connect, where the request bills the user’s own account, the bot is created in the user’s project instead; its token is still minted for the calling app.

Parameters

CreateBotRequest
required
Request payload.
Returns: CreateBotResponse

delete_bot

DELETE /2/bots/{id} Delete Bot Deletes a bot account from the calling app’s project. With an OAuth 2.0 user token, the user must be an admin of the project’s developer account. On API Connect, where the request bills the user’s own account, the bot is deleted from the user’s project instead.

Parameters

str
required
id (path parameter).
Returns: DeleteBotResponse

get

GET /2/bots Get Bots Retrieves the bot accounts in the calling app’s project. meta.max_bots is the most bots the project can have.

Parameters

Returns: GetResponse

revoke_bot_token

DELETE /2/bots/{id}/token Revoke Bot Token Revokes a bot’s bearer token. The bot account is kept, and rotating its token mints a new one.

Parameters

str
required
id (path parameter).
Returns: RevokeBotTokenResponse

rotate_bot_token

POST /2/bots/{id}/token Rotate Bot Token Mints a new bearer token for a bot and invalidates every token previously issued for it. The new token is returned only once.

Parameters

str
required
id (path parameter).
RotateBotTokenRequest
required
Request payload.
Returns: RotateBotTokenResponse

update_bot

PUT /2/bots/{id} Update Bot Updates a bot’s handle, display name, or who may send it Direct Messages.

Parameters

str
required
id (path parameter).
UpdateBotRequest
required
Request payload.
Returns: UpdateBotResponse