Skip to main content
These examples walk through complete, real-world workflows using the InfraAudit REST API. Each example includes the full request sequence with curl commands and explains what to expect at each step.

Connect an AWS Account

Authenticate, connect AWS, and verify the initial resource sync.

Run a Drift Scan

Trigger a drift scan, poll for completion, and list findings by severity.

Fetch a Cost Report

Pull 30-day cost trends, check for anomalies, and generate a PDF report.

Subscribe to Webhooks

Register a webhook, verify signatures, and handle incoming events in Node.js.

Before you start

All examples require a Bearer token. Get one from the InfraAudit web UI under Settings → API Keys, or by calling POST /api/v1/auth/login. Set these environment variables before running any example:
export TOKEN="your-api-token"
export BASE_URL="https://api.infraaudit.dev"   # SaaS
# or
export BASE_URL="http://localhost:8080"         # Self-hosted