API keys give you a stable way to authenticate requests to the SQLBot API from scripts, CI pipelines, or external services — without embedding your account password. Each key consists of anDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dataease/SQLBot/llms.txt
Use this file to discover all available pages before exploring further.
access_key (public identifier) and a secret_key (credential), generated as cryptographically secure random strings.
API keys authenticate the same API surface as session-based login. They carry the permissions of the user who created them, including workspace membership and role-based access controls.
Generating an API key
Open your profile settings
In the SQLBot web UI, click your username in the top-right corner and select Settings, then navigate to API Keys.
Create a new key
Click Generate. SQLBot creates a new key pair immediately.The backend generates both values using Python’s This means
secrets module, which produces URL-safe random strings:access_key is 16 bytes of randomness (22 characters URL-safe base64) and secret_key is 32 bytes (43 characters). Both are unique.Key limits
Each user account can hold a maximum of 5 API keys at one time. Attempting to create a sixth key returns an error. Frombackend/apps/system/api/apikey.py:
Using an API key in requests
Pass your API key in theAuthorization header of every request. The format is:
The
TokenMiddleware in SQLBot’s backend intercepts every request and validates the Authorization header. If the key is disabled or not found, the request is rejected before it reaches any route handler.Enabling and disabling keys
You can toggle any key on or off without deleting it. A disabled key is rejected at the middleware layer — theaccess_key lookup succeeds but the status check fails. This lets you temporarily revoke access without losing the key ID.
From the API key management endpoint:
access_key is cleared immediately so the change takes effect without a server restart.
Deleting a key
To permanently revoke a key, delete it from the API Keys settings page or via the API:Security best practices
Treat the secret_key like a password
Treat the secret_key like a password
The
secret_key provides full API access under your account. Do not commit it to source control, log it, or share it in plain text. Store it in a secrets manager (e.g., AWS Secrets Manager, HashiCorp Vault, or a .env file excluded from version control).Rotate keys regularly
Rotate keys regularly
Rotate API keys periodically and whenever a key may have been exposed — for example, after a team member with access leaves, or after a repository is accidentally made public. Generate a new key, update your integrations, then delete the old key.
Use one key per integration
Use one key per integration
Rather than sharing a single key across multiple systems, generate a separate key for each integration. This makes it straightforward to revoke access for one system without affecting others, and gives you a clearer audit trail.
Disable rather than delete when troubleshooting
Disable rather than delete when troubleshooting
If you suspect a key is being misused but are not sure, disable it first. A disabled key is immediately rejected but can be re-enabled if the suspicion turns out to be a false alarm. Deletion is irreversible.