Skip to main content
POST
Create
The uid must already belong to a User. If no such user exists, the API returns ERR_UID_NOT_FOUND. enabled defaults to false, so send enabled: true — or call the Update Bot API afterwards — before the bot will relay anything. groupChatSetting defaults to none, so a new bot receives no group messages until you set it. username and password are stored only when useBasicAuth is true; otherwise they are discarded. A bot’s name and avatar belong to its user, not to the bot — set them with the Update User API.

Constraints

When useBasicAuth is true, the API returns the stored password value in the response. The example masks it as ********; a real response contains the password you sent.
For the complete error reference, see Error Guide.

Authorizations

apikey
string
header
required

API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).

Body

application/json
uid
string
default:""
required

UID of an existing user to turn into a bot. Maximum 50 characters, forced to lowercase.

webhookURL
string
default:""
required

URL that receives the messages relayed to the bot. Maximum 255 characters.

groupChatSetting
enum<string>
default:none

Which group messages are relayed to the webhook. Possible values: allMessages, slashedMessages, mentionedMessages, none.

Available options:
allMessages,
slashedMessages,
mentionedMessages,
none
useBasicAuth
boolean
default:false

Sends HTTP basic auth credentials with every webhook call.

username
string
default:""

Basic auth username. Maximum 50 characters. Ignored unless useBasicAuth is true.

password
string
default:""

Basic auth password. Maximum 50 characters. Ignored unless useBasicAuth is true.

enabled
boolean
default:false

Whether the bot relays messages to its webhook.

Response

200 - application/json

Created a new Bot

data
object