NETRA provides a REST API at /api/v1/.
Most endpoints require JWT authentication:
# Login to get token
curl -X POST "http://localhost:8000/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{"email": "admin@example.com", "password": "password"}'
# Use token in requests
curl "http://localhost:8000/api/v1/scans" \
-H "Authorization: Bearer YOUR_TOKEN"GET /api/v1/scans?page=1&per_page=20&status=completedPOST /api/v1/scans/
Content-Type: application/json
{
"target_id": "uuid",
"name": "My Scan",
"profile": "standard"
}GET /api/v1/scans/{scan_id}PATCH /api/v1/scans/{scan_id}
Content-Type: application/json
{
"status": "paused"
}DELETE /api/v1/scans/{scan_id}GET /api/v1/scans/{scan_id}/phasesPOST /api/v1/scans/{scan_id}/resumePOST /api/v1/scans/diff
Content-Type: application/json
{
"scan_a_id": "uuid",
"scan_b_id": "uuid"
}GET /api/v1/findings?page=1&per_page=20&severity=high&status=newGET /api/v1/findings/{finding_id}POST /api/v1/findings/
Content-Type: application/json
{
"scan_id": "uuid",
"title": "SQL Injection",
"description": "...",
"severity": "critical",
"tool_source": "sqlmap"
}PATCH /api/v1/findings/{finding_id}
Content-Type: application/json
{
"status": "confirmed"
}POST /api/v1/findings/{finding_id}/mark-false-positivePOST /api/v1/findings/bulk-update
Content-Type: application/json
{
"finding_ids": ["uuid1", "uuid2"],
"status": "resolved"
}POST /api/v1/reports/{scan_id}/generate?report_type=executiveGET /api/v1/reports/{report_id}GET /api/v1/reports/scan/{scan_id}DELETE /api/v1/reports/{report_id}GET /api/v1/compliance/{scan_id}/score/{framework}GET /api/v1/compliance/{scan_id}/framework/{framework}GET /api/v1/compliance/{scan_id}/gap-analysis/{framework}POST /api/v1/compliance/map
Content-Type: application/json
{
"scan_id": "uuid",
"frameworks": ["iso27001", "pci_dss"]
}GET /api/v1/targets?page=1&per_page=20POST /api/v1/targets/
Content-Type: application/json
{
"name": "Example.com",
"target_type": "domain",
"value": "example.com"
}POST /api/v1/targets/import
Content-Type: multipart/form-data
file: targets.txtPOST /api/v1/agent/start?target=example.com&profile=standardGET /api/v1/agent/{session_id}/statusPOST /api/v1/agent/{session_id}/approvePOST /api/v1/agent/{session_id}/reject?reason=Out+of+scopeGET /api/healthResponse:
{
"status": "healthy",
"version": "1.0.0",
"database": "connected"
}WS /ws/scans/{scan_id}
WS /ws/findings
WS /ws/agent/{session_id}
Default: 100 requests per minute per IP.
Configure with NETRA_API_RATE_LIMIT:
NETRA_API_RATE_LIMIT=200/minuteInteractive API docs available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc