Skip to content

API Keys

Manage API keys for programmatic access.

⚠️ All API-key endpoints require the calling key to have the ADMIN permission. The easiest way to manage keys is the CLI: tokenbot apikey create | list | revoke.

MethodPathDescription
GET/v1/api-keysList API keys
POST/v1/api-keysCreate API key
DELETE/v1/api-keys/:idDelete API key
POST/v1/api-keys/:id/rotateRotate API key

GET /v1/api-keys
Terminal window
curl https://api.tokenbot.com/v1/api-keys \
-H "X-API-Key: tb_live_your_key"

POST /v1/api-keys

Returns the full key only once — store it securely.

Terminal window
curl -X POST https://api.tokenbot.com/v1/api-keys \
-H "X-API-Key: tb_live_your_key" \
-H "Content-Type: application/json" \
-d '{"name":"CI/CD Key"}'

DELETE /v1/api-keys/:id

POST /v1/api-keys/:id/rotate

Generates a new key value. The old key is immediately invalidated.

Terminal window
curl -X POST https://api.tokenbot.com/v1/api-keys/key_abc123/rotate \
-H "X-API-Key: tb_live_your_key"