API Authentication
Managing API keys and tokens for secure access.
API Keys
API keys provide long-lived access to the Hacker Bot API.
Creating an API Key
- Navigate to Settings → API Keys
- Click Generate New Key
- Enter a descriptive name (e.g., "Production CI/CD")
- Select permissions scope
- Set expiration (optional)
- Copy the key immediately—it won't be shown again
Using API Keys
Include the API key in the Authorization header:
# Using Bearer token
curl -H "Authorization: Bearer hb_live_xxxxxxxxxxxx" \
https://api.hackerbot.io/v1/scans
# Using X-API-Key header (alternative)
curl -H "X-API-Key: hb_live_xxxxxxxxxxxx" \
https://api.hackerbot.io/v1/scans Key Prefixes
| Prefix | Environment | Usage |
|---|---|---|
| hb_live_ | Production | Real scans, billed usage |
| hb_test_ | Test | Development, no billing |
Permission Scopes
Limit API key access with granular scopes:
scans:read— View scan status and resultsscans:write— Create and cancel scansfindings:read— Access vulnerability datafindings:write— Update finding statusprojects:read— List projectsprojects:write— Create and modify projects
Security Best Practices
- ⚠️ Never commit API keys to version control
- ⚠️ Use environment variables or secrets managers
- ⚠️ Rotate keys regularly (90 days recommended)
- ⚠️ Use minimum required scopes
- ⚠️ Set expiration dates on keys
- ⚠️ Monitor API key usage in your dashboard
Revoking Keys
If a key is compromised:
- Go to Settings → API Keys
- Find the compromised key
- Click Revoke
- Generate a new key if needed
- Update your applications with the new key