How to test all DevOps AI Agent APIs using Postman or curl.
- Agent running locally:
cp .env.example .env
# Set ANTHROPIC_API_KEY, SLACK_WEBHOOK_URL (optional for testing), ORG_ID
uvicorn api.server:app --reload --port 8000- For durable storage (optional):
# Local with MinIO
docker compose up -d
# Or use in-memory (default, data lost on restart)
STORAGE_PROVIDER=memory- Open Postman → Import
- Import both files:
postman/DevOps-AI-Agent.postman_collection.jsonpostman/DevOps-AI-Agent-Local.postman_environment.json
- Select DevOps AI Agent — Local environment (top-right dropdown)
| Variable | Default | Description |
|---|---|---|
baseUrl |
http://localhost:8000 |
Agent URL |
orgId |
acme-corp |
Your organization ID |
docPath |
runbooks/k8s-oom.md |
Doc path for file upload tests |
incidentId |
(auto-set) | Set by webhook test scripts |
Use the End-to-End Test Flow folder — run requests in order:
| Step | Request | Expected |
|---|---|---|
| 1 | Health Check | status: ok, queue_worker: true |
| 2 | Upload Runbook | status: uploaded |
| 3 | Trigger K8s Incident | status: queued, saves incidentId |
| 4 | Poll Audit | Incident appears after ~30–60s (re-run if needed) |
Tip: Use Postman Collection Runner on the "End-to-End Test Flow" folder. Add a 30s delay before step 4, or run step 4 manually after waiting.
| Folder | What it tests |
|---|---|
| Health, status & audit | /health, /status, /audit |
| Organization Documentation | CRUD for org runbooks |
| Webhooks | Manual, Alertmanager, GitHub triggers |
| Slack Integration | Approval callbacks (normally Slack-only) |
curl -s http://localhost:8000/health | python3 -m json.toolExpected:
{
"status": "ok",
"auto_apply": "false",
"storage_provider": "memory",
"org_id": "acme-corp",
"queue_worker": true
}curl -H "Authorization: Bearer $API_TOKEN" -s -X POST http://localhost:8000/orgs/acme-corp/docs \
-H "Content-Type: application/json" \
-d '{
"path": "runbooks/k8s-oom.md",
"content": "# OOM Runbook\n1. Run get_k8s_context\n2. Increase memory to 512Mi\nEvidence: cite exact log lines."
}' | python3 -m json.toolVerify listed:
curl -H "Authorization: Bearer $API_TOKEN" -s "http://localhost:8000/orgs/acme-corp/docs?prefix=runbooks" | python3 -m json.toolVerify content:
curl -H "Authorization: Bearer $API_TOKEN" -s http://localhost:8000/orgs/acme-corp/docs/runbooks/k8s-oom.md | python3 -m json.toolecho "# Server Runbook\nCheck disk with df -h" > /tmp/server-runbook.md
curl -H "Authorization: Bearer $API_TOKEN" -s -X POST "http://localhost:8000/orgs/acme-corp/docs/upload?path=runbooks/server-disk.md" \
-F "file=@/tmp/server-runbook.md" | python3 -m json.toolRESPONSE=$(curl -s -X POST http://localhost:8000/webhook/manual \
-H "Content-Type: application/json" \
-H "X-Org-ID: acme-corp" \
-d '{
"type": "k8s",
"namespace": "default",
"pod": "test-pod",
"description": "E2E test incident"
}')
echo "$RESPONSE" | python3 -m json.tool
INCIDENT_ID=$(echo "$RESPONSE" | python3 -c "import sys,json; print(json.load(sys.stdin)['incident_id'])")
echo "Incident ID: $INCIDENT_ID"Expected: "status": "queued"
curl -s -X POST http://localhost:8000/webhook/alertmanager \
-H "Content-Type: application/json" \
-H "X-Org-ID: acme-corp" \
-d '{
"alerts": [{
"status": "firing",
"labels": {
"alertname": "HighMemory",
"severity": "warning",
"namespace": "staging"
},
"annotations": {
"summary": "Memory usage above 85%"
}
}]
}' | python3 -m json.toolWait 30–60 seconds for the queue worker, then:
curl -H "Authorization: Bearer $API_TOKEN" -s "http://localhost:8000/audit?org_id=acme-corp&limit=10" | python3 -m json.toolLook for your incident_id in the events array. Each entry includes:
diagnosis— agent conclusion with Evidence sectiongrounding.grounded—trueif backed by tool evidenceactions_taken— tools called and resultsresolved— whether incident was grounded and resolved
curl -s -X POST http://localhost:8000/webhook/manual \
-H "Content-Type: application/json" \
-H "X-Org-ID: acme-corp" \
-d '{
"type": "cicd",
"repo": "acme-corp/api-service",
"run_id": 12345678,
"description": "Build failed on main"
}' | python3 -m json.toolcurl -H "Authorization: Bearer $API_TOKEN" -s -X DELETE http://localhost:8000/orgs/acme-corp/docs/runbooks/server-disk.md | python3 -m json.toolRun the included simulation script:
# Start agent first, then:
python3 scripts/test_api_flow.shOr use pytest for service-layer tests:
python3 -m pytest tests/test_services.py -vdocker compose up -d
# In .env:
STORAGE_PROVIDER=minio
STORAGE_ENDPOINT_URL=http://localhost:9000
STORAGE_ACCESS_KEY=minioadmin
STORAGE_SECRET_KEY=minioadmin
STORAGE_BUCKET=devops-agent
ORG_ID=acme-corpMinIO console: http://localhost:9001 (login: minioadmin / minioadmin)
After triggering an incident, verify objects in bucket:
acme-corp/queue/pending/
acme-corp/audit/2026/06/INC-...
acme-corp/logs/2026/06/INC-.../
acme-corp/docs/runbooks/
| Symptom | Fix |
|---|---|
status: queued but no audit entry |
Wait longer; check agent logs for queue worker errors |
queue_worker: false in /status |
Server still starting — wait a few seconds |
resolved: false, grounded: false |
Expected without real infra — agent requires tool evidence |
401 on GitHub webhook |
Set WEBHOOK_SECRET and sign payload, or unset secret for local testing |
| Empty audit for wrong org | Pass matching org_id query param or X-Org-ID header |
| Anthropic API errors | Verify ANTHROPIC_API_KEY in .env |
-
GET /healthreturns{"status": "ok"}andGET /status(with a token) returnsqueue_worker: true - Upload runbook via
POST /orgs/{org}/docs - Trigger test incident via
POST /webhook/manual - Audit entry appears in
GET /audit?org_id=... - Slack notification received (if configured)
- Objects visible in cloud storage bucket
- PII scrubbed in audit (no raw emails/tokens)
- Restart agent — pending queue items resume processing
- API Reference — full endpoint documentation
- Postman collection
- Getting Started