Skip to main content
The recommendations endpoints expose InfraAudit’s Gemini-powered suggestions for cost savings, security improvements, and performance optimisations. Recommendations are generated per resource and include estimated monthly savings where applicable. Base path: /api/v1/recommendations

GET /recommendations — list recommendations

Returns a paginated list of recommendations across all resources.
GET /api/v1/recommendations
Authorization: Bearer <token>

Query parameters

type
string
Filter by recommendation type: cost, security, or performance.
status
string
Filter by status: pending, applied, or dismissed.
resource_id
integer
Filter by resource.
provider_id
integer
Filter by provider.
page
integer
default:"1"
Page number.
per_page
integer
default:"20"
Results per page. Maximum is 100.

Response

{
  "data": [
    {
      "id": 1,
      "type": "cost",
      "title": "Downsize overprovisioned EC2 instance",
      "description": "Instance web-server-01 uses 8% average CPU over 30 days. Downsizing from t3.large to t3.small saves approximately $42/month.",
      "estimated_monthly_savings": 42.00,
      "resource_id": 15,
      "resource_name": "web-server-01",
      "status": "pending",
      "created_at": "2024-01-15T04:30:00Z"
    }
  ],
  "meta": { "total": 8, "page": 1, "per_page": 20 }
}
estimated_monthly_savings
number
Estimated monthly cost savings in USD. Present only for cost type recommendations.

GET /recommendations/ — get recommendation

Returns full recommendation details including step-by-step remediation instructions.
GET /api/v1/recommendations/{id}
Authorization: Bearer <token>

POST /recommendations/generate — generate recommendation

Generates a new AI recommendation for a specific resource, or updates an existing pending one.
POST /api/v1/recommendations/generate
Authorization: Bearer <token>
Content-Type: application/json

Request body

resource_id
integer
required
The resource to generate a recommendation for.
{
  "resource_id": 15
}

POST /recommendations//apply — apply recommendation

Marks a recommendation as applied and optionally creates a remediation action.
POST /api/v1/recommendations/{id}/apply
Authorization: Bearer <token>

POST /recommendations//dismiss — dismiss recommendation

Dismisses a recommendation with an optional reason.
POST /api/v1/recommendations/{id}/dismiss
Authorization: Bearer <token>
Content-Type: application/json

Request body (optional)

reason
string
Explanation for dismissing this recommendation.
{
  "reason": "Not applicable — instance is reserved"
}