Skip to content

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.

  1. Log in to the Controlinfra Dashboard
  2. Go to Settings > API Tokens
  3. Click Create Token
  4. Select the scopes you need
  5. 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/dashboard

This 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_ID

5. Check Scan Status

bash
curl -H "Authorization: Bearer $TOKEN" \
  https://api.controlinfra.com/api/scans/SCAN_ID

6. View Detected Drifts

Once the scan completes:

bash
curl -H "Authorization: Bearer $TOKEN" \
  https://api.controlinfra.com/api/scans/SCAN_ID/details

Or 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-fix

8. Create a Pull Request

bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://api.controlinfra.com/api/drifts/DRIFT_ID/create-pr

Next Steps