Bot

Create a bot

Creates a new bot within an application. Creating a bot is similar to creating a normal user, except a callback URL should be specified for a bot to receive events.

Note: The bot must first join a group channel to interact with users. In group channels, you can also invite a bot through the invite as members action.

https://sendbird.com/docs/chat/platform-api/v3/bot/creating-a-bot/create-a-bot#1-create-a-bot

post/v3/bots

Request

  • Base URL
    https://api-APP_ID.sendbird.com
  • Auth
    none declared

Headers

api-tokenstring
Example:{{API_TOKEN}}

Request body

bot_callback_urlstring required
bot_nicknamestring required

Specifies the bot's nickname. The length is limited to 80 characters.

bot_profile_urlstring required
bot_typestring required
bot_useridstring required

Specifies the unique ID of a bot. The length is limited to 80 characters.

is_privacy_modeboolean required

Determines whether to forward all or specific messages to the bot in channels where the bot is a member. If set to true, only messages starting with a "/" or mentioning the bot_userid are forwarded to the bot. If set to false, all messages are forwarded. This property can help protect the privacy of users' chat logs by configuring the bot to only receive messages addressed to the bot.

channel_invitation_preferenceinteger
enable_mark_as_readboolean
show_memberboolean

Response

Successful response

bot_callback_urlstring
channel_invitation_preferenceinteger
created_atinteger
enable_mark_as_readboolean
is_privacy_modeboolean
show_memberboolean

Example response

{
  "show_member": true,
  "enable_mark_as_read": true,
  "is_privacy_mode": true,
  "bot_callback_url": "bot_callback_url",
  "bot": {
    "feedback": true,
    "bot_profile_url": "bot_profile_url",
    "bot_userid": "bot_userid",
    "bot_metadata": "{}",
    "bot_type": "bot_type",
    "bot_nickname": "bot_nickname",
    "bot_token": "bot_token",
    "bot_require_auth_for_profile_image": true,
    "ai_agent_type": "ai_agent_type"
  },
  "bot_style": {
    "color": {
      "accent_color": "accent_color",
      "bot_message_color": "bot_message_color",
      "theme": "theme"
    },
    "toggle_button_type": "toggle_button_type",
    "toggle_button_url": "toggle_button_url",
    "auto_open": true
  },
  "created_at": 6,
  "channel_invitation_preference": 0
}

Changes

    • breaking

      the response property / became nullable for the status

    • warning

      deleted the header request parameter Api-Token

    • info

      api operation id createBot removed and replaced with createABot

    • info

      added the new optional header request parameter api-token

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      the response property became required for the status

    • info

      the response property / became required for the status