Bots · Developer account

createBot

Create a new bot

This method authenticates with your developer account. The easiest way to call it is the dashboard, which signs the request for you. Direct calls need a dashboard session cookie.

Creates a bot owned by the caller and issues one live token and one test token. Tokens are shown ONCE in the response and never stored (only HMAC-SHA256(token, BOT_TOKEN_PEPPER) is kept); they cannot be retrieved again. If token issuance fails, the bot row is rolled back (deleted). Token format: sxb_<live|test>_<48 base64url chars> (36 random bytes, 288 bits).

Request

curl https://api.sprintelex.com/createBot \
  # authenticated with your dashboard session \
  -H "Content-Type: application/json" \
  -d '{"name":"My Bot","username":"mybot_bot"}'

Parameters

NameTypeRequiredRules
namestringYestrimmed; 1-64 characters
usernamestringYestrimmed and lowercased; 5-32 chars; only a-z, 0-9, underscore; must end in 'bot'; reserved names blocked (sprintelexbot, officialbot, supportbot, adminbot, systembot, securitybot, helpbot, infobot, teambot, staffbot, billingbot, paymentbot, paymentsbot, moolrebot, moderatorbot, modbot, and anything containing 'sprintelex'); must be unique
descriptionstringNotrimmed; at most 512 characters
avatar_urlstringNomust be an https URL when provided

Response

{ ok: true, result: { bot: { id, name, username, avatar_url, description, created_at }, live_token, test_token, warning: 'Tokens are shown once. Save them now - they cannot be retrieved again.' } }

Rate limit: none in code

Errors

StatusErrorWhen
500server misconfiguredBOT_TOKEN_PEPPER env is not set (fails closed)
400name must be 1-64 charactersname empty or longer than 64
400username must be 5-32 charactersusername length out of range
400username may only contain a-z, 0-9 and underscoreillegal characters
400bot usernames must end in 'bot'username does not end in 'bot'
400that username is reservedblocked or contains 'sprintelex'
400description must be at most 512 charactersdescription longer than 512
400avatar_url must be an https URLavatar_url not https
409username is takenusername already exists (also race-guarded via unique violation)
500could not create botDB insert failed
500could not issue tokenstoken insert failed; bot row rolled back