Tokens · Developer account

regenerateToken

Rotate a bot token

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.

Rotates one env's token: the old token is revoked immediately (revoked_at stamped), then a new token is issued. The new token is shown once and cannot be retrieved again.

Request

curl https://api.sprintelex.com/regenerateToken \
  # authenticated with your dashboard session \
  -H "Content-Type: application/json" \
  -d '{"bot_id":"<bot-id>","env":"test"}'

Parameters

NameTypeRequiredRules
bot_idstringYes-
envstringYesmust be 'live' or 'test'

Response

{ ok: true, result: { token, env, warning: 'The previous token was revoked immediately. This token is shown once.' } }

Rate limit: none in code

Errors

StatusErrorWhen
500server misconfiguredBOT_TOKEN_PEPPER env is not set (fails closed)
400bot_id is requiredmissing bot_id
400env must be 'live' or 'test'env not live/test
404bot not foundno such bot, not owned by caller, or deleted
500could not revoke old tokenrevoke update failed
409a rotation is already in progress - try againunique-violation race on insert
500could not issue new tokeninsert failed