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

Methods

createBot

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

Schemas.CreateBotRequest
required
Request payload.
Returns: Schemas.CreateBotResponse

deleteBot

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

String
required
id (path parameter).
Returns: Schemas.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: Schemas.GetBotsResponse

revokeBotToken

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

String
required
id (path parameter).
Returns: Schemas.RevokeBotTokenResponse

rotateBotToken

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

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

updateBot

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

Parameters

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