Quick Start
Make your first API call to Controlinfra in under 5 minutes.
1. Get an API Token
You have two options:
Option A: Login with Email
bash
curl -X POST https://api.controlinfra.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "your@email.com", "password": "your-password"}'Save the token from the response.
Option B: Create a CLI Token (Recommended for Automation)
- Log in to the Controlinfra Dashboard
- Go to Settings > API Tokens
- Click Create Token
- Select the scopes you need
- Copy the generated
ci_token
See CLI Tokens for details.
2. View Your Dashboard
bash
export TOKEN="your-token-here"
curl -H "Authorization: Bearer $TOKEN" \
https://api.controlinfra.com/api/scans/dashboardThis returns a summary of your scans, drifts, and active repositories.
3. List Your Repository Configs
bash
curl -H "Authorization: Bearer $TOKEN" \
https://api.controlinfra.com/api/repo-configs/4. Trigger a Scan
Pick a repository config ID from the previous step:
bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://api.controlinfra.com/api/scans/trigger/REPO_CONFIG_ID5. Check Scan Status
bash
curl -H "Authorization: Bearer $TOKEN" \
https://api.controlinfra.com/api/scans/SCAN_ID6. View Detected Drifts
Once the scan completes:
bash
curl -H "Authorization: Bearer $TOKEN" \
https://api.controlinfra.com/api/scans/SCAN_ID/detailsOr list all drifts:
bash
curl -H "Authorization: Bearer $TOKEN" \
"https://api.controlinfra.com/api/drifts/?status=detected"7. Generate a Fix
For a specific drift:
bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://api.controlinfra.com/api/drifts/DRIFT_ID/generate-fix8. Create a Pull Request
bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://api.controlinfra.com/api/drifts/DRIFT_ID/create-prNext Steps
- Authentication — Learn about all auth methods
- CLI Tokens — Set up tokens for CI/CD pipelines
- Rate Limiting — Understand rate limits for automation
- Runners — Set up self-hosted scan runners