fegura.ai

Scans

The Scans API lets you trigger infrastructure scans on your connected AWS accounts and monitor their progress. Each scan discovers resources in the specified region and generates architecture diagrams.

POST/api/scanswrite

Create a new infrastructure scan

GET/api/scansread

List all scans

GET/api/scans/{id}read

Get scan details and status


Create Scan

POST/api/scanswrite

Triggers a new infrastructure scan for the specified AWS account and region. The scan runs synchronously and returns when complete.

Request Body

ParameterTypeDescription
awsAccountIdrequiredstringThe Fegura account connection ID (UUID), not the AWS account ID
regionstringAWS region to scan (e.g., "us-east-1")Default: us-east-1

Example Request

curl -X POST "https://api.fegura.ai/api/scans" \
  -H "Authorization: Bearer feg_live_your_api_key" \
  -H "Fegura-Version: 2026-02-01" \
  -H "Content-Type: application/json" \
  -d '{
    "awsAccountId": "550e8400-e29b-41d4-a716-446655440000",
    "region": "us-east-1"
  }'

Response

{
  "success": true,
  "data": {
    "id": "660e8400-e29b-41d4-a716-446655440000",
    "awsAccountId": "550e8400-e29b-41d4-a716-446655440000",
    "customerAwsAccountId": "123456789012",
    "region": "us-east-1",
    "status": "completed",
    "progress": {
      "vpcs": 2,
      "subnets": 6,
      "ec2Instances": 4,
      "lambdaFunctions": 12,
      "s3Buckets": 3
    },
    "errorMessage": null,
    "createdAt": "2026-01-20T14:30:00.000Z",
    "updatedAt": "2026-01-20T14:32:15.000Z"
  }
}

List Scans

GET/api/scansread

Returns a paginated list of all scans for your organization.

Query Parameters

ParameterTypeDescription
accountIdstringFilter by Fegura account connection ID
limitintegerNumber of scans to return per page (1-100)Default: 20
statusstringFilter by scan status (queued, scanning, completed, failed)
cursorstringPagination cursor from previous response

Example Request

curl "https://api.fegura.ai/api/scans?limit=10" \
  -H "Authorization: Bearer feg_live_your_api_key" \
  -H "Fegura-Version: 2026-02-01"

Response

{
  "success": true,
  "data": {
    "scans": [
      {
        "id": "660e8400-e29b-41d4-a716-446655440000",
        "awsAccountId": "550e8400-e29b-41d4-a716-446655440000",
        "customerAwsAccountId": "123456789012",
        "region": "us-east-1",
        "status": "completed",
        "progress": {
          "vpcs": 2,
          "subnets": 6,
          "ec2Instances": 4
        },
        "errorMessage": null,
        "createdAt": "2026-01-20T14:30:00.000Z",
        "updatedAt": "2026-01-20T14:32:15.000Z"
      }
    ],
    "meta": {
      "hasMore": false
    }
  }
}

Get Scan

GET/api/scans/{id}read

Retrieves details about a specific scan including status and progress.

Path Parameters

ParameterTypeDescription
idrequiredstringThe scan ID (UUID)

Example Request

curl "https://api.fegura.ai/api/scans/660e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer feg_live_your_api_key" \
  -H "Fegura-Version: 2026-02-01"

Response Fields

ParameterTypeDescription
idstringUnique scan identifier (UUID)
awsAccountIdstringFegura account connection ID
customerAwsAccountIdstring12-digit AWS account ID that was scanned
regionstringAWS region that was scanned
statusstringScan status (see table below)
progressobject | nullPer-resource-type discovery counts (e.g., { vpcs: 2, subnets: 6 }), or null if scan has not started
errorMessagestring | nullError details if scan failed
createdAtstringISO 8601 timestamp when scan was created
updatedAtstringISO 8601 timestamp of last update

Scan Statuses

StatusDescription
queuedScan is queued and waiting to start
scanningActively discovering resources
completedScan finished successfully
failedScan failed; check errorMessage

CI/CD Integration

Scans are commonly triggered from CI/CD pipelines to automatically document infrastructure changes. Here's an example GitHub Actions workflow:

.github/workflows/scan.yml
name: Infrastructure Scan
on:
  push:
    branches: [main]
    paths:
      - 'terraform/**'
      - 'cloudformation/**'

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Fegura Scan
        run: |
          curl -X POST "https://api.fegura.ai/api/scans" \
            -H "Authorization: Bearer ${{ secrets.FEGURA_API_KEY }}" \
            -H "Content-Type: application/json" \
            -d '{
              "awsAccountId": "${{ vars.FEGURA_ACCOUNT_ID }}",
              "region": "us-east-1"
            }'