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
| Name | Type | Required | Rules |
|---|---|---|---|
| bot_id | string | Yes | - |
| env | string | Yes | must 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
| Status | Error | When |
|---|---|---|
| 500 | server misconfigured | BOT_TOKEN_PEPPER env is not set (fails closed) |
| 400 | bot_id is required | missing bot_id |
| 400 | env must be 'live' or 'test' | env not live/test |
| 404 | bot not found | no such bot, not owned by caller, or deleted |
| 500 | could not revoke old token | revoke update failed |
| 409 | a rotation is already in progress - try again | unique-violation race on insert |
| 500 | could not issue new token | insert failed |