{
  "openapi": "3.1.0",
  "info": {
    "title": "CloudFix API",
    "version": "3",
    "description": "This file covers the read-only operations of the CloudFix API.\n\nThey need an API token with the Reader role. A signed-in person creates the token in the CloudFix app under API Tokens. A token works with the lower of its own role and the role of the person who created it.\n\nOperations that change things are not described here yet. Each operation lists its role in x-required-role."
  },
  "servers": [
    {
      "url": "https://app.cloudfix.com/api/v3"
    }
  ],
  "security": [
    {
      "cloudfixToken": []
    }
  ],
  "tags": [
    {
      "name": "Recommendations"
    },
    {
      "name": "Savings and reports"
    },
    {
      "name": "Account"
    },
    {
      "name": "Actions"
    }
  ],
  "paths": {
    "/recommendations": {
      "get": {
        "summary": "Get recommendations",
        "description": "Endpoint to retrieve the recommendations",
        "operationId": "getRecommendations",
        "tags": [
          "Recommendations"
        ],
        "x-required-role": "Reader",
        "parameters": [
          {
            "name": "pageLimit",
            "in": "query",
            "description": "Maximum number of items to return per page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "description": "The field to sort the results by",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "finderFixerId",
            "in": "query",
            "description": "The identifier of the Finder/Fixer",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page number to retrieve",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "from",
            "in": "query",
            "description": "The start date for the time range to retrieve recommendations for",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "The end date for the time range to retrieve recommendations for",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "description": "The order to sort the results in (ascending or descending)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filterBy",
            "in": "query",
            "description": "The field to filter the results by",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filterValue",
            "in": "query",
            "description": "The value to filter the results by",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "The status of the resources to retrieve recommendations for",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeParameters",
            "in": "query",
            "description": "Set to `true` or `1` (case-insensitive) to return each recommendation's `parameters`. Parameters are also returned whenever an `ids` query parameter is supplied. Otherwise `parameters` is an empty object. Independent of `includeTags`.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "includeTags",
            "in": "query",
            "description": "Set to `true` or `1` (case-insensitive) to add a `tags` object to each returned recommendation; any other value, or omitting it, leaves the field out. `tags` holds every tag stored with the recommendation, with each key spelled exactly as stored and its original JSON value: customer tags such as `Owner`, `TechnicalOwner` and `CostCenter`, and CloudFix virtual tags (`Cloudfix_account_owner`, `cloudfix_L4`, `cloudfix_L5`). These are the tags recorded with the recommendation, not live AWS tags or validated ownership. Selection, order and pagination are the same with and without it; tags add to each page's size, so page through large result sets with `pageNumber` and `pageLimit`.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recommendations retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "description": "The page of recommendations, returned as a top-level array.",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Unique identifier of the opportunity"
                      },
                      "customerId": {
                        "type": "integer",
                        "description": "Customer identifier"
                      },
                      "accountId": {
                        "type": "string",
                        "description": "Account identifier"
                      },
                      "accountNickname": {
                        "type": "string",
                        "description": "Nickname for the account"
                      },
                      "opportunityType": {
                        "type": "string",
                        "description": "Type of opportunity"
                      },
                      "region": {
                        "type": "string",
                        "description": "Region where the opportunity exists"
                      },
                      "organizationalUnitName": {
                        "type": "string",
                        "description": "Name of the organizational unit"
                      },
                      "opportunityDescription": {
                        "type": "string",
                        "description": "Description of the opportunity"
                      },
                      "primaryImpactedNodeId": {
                        "type": "string",
                        "description": "Unique identifier for the primary impacted node"
                      },
                      "otherImpactedNodeIds": {
                        "type": "array",
                        "description": "Array of other impacted node IDs",
                        "items": {
                          "type": "string"
                        }
                      },
                      "resourceId": {
                        "type": "string",
                        "description": "Unique identifier of the resource"
                      },
                      "resourceName": {
                        "type": "string",
                        "description": "Name of the resource"
                      },
                      "level": {
                        "type": "integer",
                        "description": "Level of the opportunity"
                      },
                      "applicationEnvironment": {
                        "type": "string",
                        "description": "Environment in which the application runs"
                      },
                      "annualSavings": {
                        "type": "number",
                        "description": "Annual savings from the opportunity"
                      },
                      "annualCost": {
                        "type": "number",
                        "description": "Annual cost of the opportunity"
                      },
                      "actualSavings": {
                        "type": "number",
                        "description": "Actual savings from the opportunity"
                      },
                      "changeRequestId": {
                        "type": "string",
                        "description": "Unique identifier of the change request"
                      },
                      "changeRequestStatus": {
                        "type": "string",
                        "description": "Status of the change request"
                      },
                      "createdAt": {
                        "type": "string",
                        "description": "Date and time when the opportunity was created",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "description": "Date and time when the opportunity was updated",
                        "format": "date-time"
                      },
                      "status": {
                        "type": "string",
                        "description": "Status of the opportunity"
                      },
                      "scheduledAt": {
                        "type": "string",
                        "description": "Date and time when the opportunity is scheduled",
                        "format": "date-time"
                      },
                      "parameters": {
                        "type": "object",
                        "description": "Additional parameters for the opportunity"
                      },
                      "isTemplateApproved": {
                        "type": "boolean",
                        "description": "Indicates that a fixer runbook is deployed for this opportunity's finder. Field name retained for backwards compatibility."
                      },
                      "autoApproved": {
                        "type": "boolean",
                        "description": "Indicates if the opportunity is auto-approved"
                      },
                      "isTemplateAvailable": {
                        "type": "boolean",
                        "description": "Always true. Retained for backwards compatibility; runbooks are created on demand."
                      },
                      "ouId": {
                        "type": "string",
                        "description": "Unique identifier of the organizational unit"
                      },
                      "manualFix": {
                        "type": "boolean",
                        "description": "Indicates if the opportunity can only be executed manually"
                      },
                      "manualFixInfoUrl": {
                        "type": "string",
                        "description": "Link to the support article on how the opportunity can be executed manually"
                      },
                      "fixUnavailable": {
                        "type": "object",
                        "description": "Present only when CloudFix has no automated fix for this specific recommendation. Absent means executable.",
                        "properties": {
                          "reason": {
                            "type": "string",
                            "description": "Machine-readable reason, stable across finders"
                          },
                          "detail": {
                            "type": "string",
                            "description": "Customer-facing explanation"
                          }
                        }
                      },
                      "maintenanceWindow": {
                        "type": [
                          "object",
                          "null"
                        ],
                        "description": "Where the recommendation stands with its tenant's maintenance windows. null unless it is Suggested or Manual Approval and can run: it cannot when the pricing plan leaves its fixer out, when the fixer is switched off for a Manual Approval or person-scheduled recommendation (status Disabled), when the stack cannot run fixers (status Needs Stack Upgrade), or when it has no automated fix (manualFix, or fixUnavailable present).",
                        "required": [
                          "state",
                          "windowName",
                          "isOpenNow",
                          "nextOpensAt",
                          "requestedBy",
                          "requestedAt"
                        ],
                        "properties": {
                          "state": {
                            "type": "string",
                            "enum": [
                              "scheduled",
                              "blocked",
                              "fault"
                            ],
                            "description": "scheduled: a window covers the recommendation's account and region. blocked: none does, so it does not run. fault: the tenant's maintenance windows could not be evaluated for this response."
                          },
                          "windowName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "null unless scheduled.",
                            "example": "Weekend"
                          },
                          "isOpenNow": {
                            "type": "boolean"
                          },
                          "nextOpensAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time",
                            "description": "UTC; null unless scheduled, and when the window does not open before the recommendation expires.",
                            "example": "2026-10-17T22:00:00.000Z"
                          },
                          "requestedBy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Who asked for the recommendation to run in its window; null unless a person did and it is still waiting."
                          },
                          "requestedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time",
                            "description": "UTC."
                          }
                        }
                      },
                      "windowRequestedAt": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time",
                        "description": "UTC. When a person asked for the recommendation to run in its maintenance window; null when nobody has. A cancel clears it, as do the revalidation ahead of the run when it ends the request because the fix changed, and a Jira ticket that returns the recommendation to Manual Approval. Every other change keeps it, so a dispatched, finished or No Longer Applicable recommendation still carries the request it ran or was retired under. Set even when maintenanceWindow is null, as on a recommendation held while its fixer is switched off."
                      },
                      "tags": {
                        "type": "object",
                        "additionalProperties": true,
                        "description": "Present only when `includeTags` is set. Every tag stored with the recommendation: keys exactly as stored, values with their original JSON types (usually strings). `{}` when the recommendation has no stored tags.",
                        "example": {
                          "Owner": "Example owner",
                          "TechnicalOwner": "Example operations",
                          "CostCenter": "CC-001",
                          "cloudfix_L4": "Example division",
                          "custom/key": "alpha; beta=gamma"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request, the request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized, authentication failed or user does not have permission to access the resource."
          },
          "404": {
            "description": "User not found or tenant does not exist."
          },
          "422": {
            "description": "Unprocessable Entity."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/recommendations/export": {
      "get": {
        "summary": "Get all recommendations preview",
        "description": "Returns up to 100 deduplicated recommendations matching the given filters, along with the total count and available finder list.",
        "operationId": "getAllRecommendationsPreview",
        "tags": [
          "Recommendations"
        ],
        "x-required-role": "Reader",
        "parameters": [
          {
            "name": "statuses",
            "in": "query",
            "description": "Filter by recommendation status (repeatable)",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "accountIds",
            "in": "query",
            "description": "Filter by AWS account ID (repeatable)",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "regions",
            "in": "query",
            "description": "Filter by AWS region (repeatable)",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "finderTypes",
            "in": "query",
            "description": "Filter by finder type (repeatable)",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "categories",
            "in": "query",
            "description": "Filter by category (repeatable)",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "dateFrom",
            "in": "query",
            "description": "Filter recommendations created on or after this date (YYYY-MM-DD)",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dateTo",
            "in": "query",
            "description": "Filter recommendations created on or before this date (YYYY-MM-DD)",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preview data retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "description": "Up to 100 deduplicated recommendation rows",
                      "items": {
                        "type": "object",
                        "properties": {
                          "account": {
                            "type": "string"
                          },
                          "accountName": {
                            "type": "string"
                          },
                          "region": {
                            "type": "string"
                          },
                          "resourceId": {
                            "type": "string"
                          },
                          "finderName": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "tags": {
                            "type": "string",
                            "description": "Every tag stored with the recommendation, as `key=value` pairs joined by `; `, for display. A value may itself contain `; ` or `=`, so read `resourceTags` when the tags must be parsed.",
                            "example": "Owner=Example owner; CostCenter=CC-001; cloudfix_L4=Example division"
                          },
                          "resourceTags": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "Every tag stored with the recommendation: keys exactly as stored, values with their original JSON types. `{}` when the recommendation has no stored tags. These are the tags recorded with the recommendation, not live AWS tags.",
                            "example": {
                              "Owner": "Example owner",
                              "CostCenter": "CC-001",
                              "cloudfix_L4": "Example division"
                            }
                          },
                          "annualCost": {
                            "type": "number"
                          },
                          "annualSavings": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "completedAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "fixUnavailableReason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "totalCount": {
                      "type": "integer",
                      "description": "Total number of matching recommendations (before the 100-row limit)"
                    },
                    "availableFinders": {
                      "type": "array",
                      "description": "Distinct finders present in the tenant's recommendations",
                      "items": {
                        "type": "object",
                        "properties": {
                          "finderType": {
                            "type": "string"
                          },
                          "finderName": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Tenant not found."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/recommendations/summary": {
      "get": {
        "summary": "Retrieve recommendations summary",
        "description": "Retrieves a summary of recommendations for the authorized tenant, including potential savings and status.",
        "operationId": "getRecommendationsSummary",
        "tags": [
          "Recommendations"
        ],
        "x-required-role": "Reader",
        "parameters": [
          {
            "name": "ou",
            "in": "query",
            "description": "Organizational unit filter.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "account",
            "in": "query",
            "description": "Account ID filter.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "tagKey",
            "in": "query",
            "description": "Tag key filter.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "tagValue",
            "in": "query",
            "description": "Tag value filter.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "region",
            "in": "query",
            "description": "Region filter.",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recommendations summary retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "subCategoryTypeDescription": {
                        "type": "string",
                        "description": "Description of the sub-category type.",
                        "example": "EC2 Optimize Instances"
                      },
                      "subCategoryTypeName": {
                        "type": "string",
                        "description": "Name of the sub-category type.",
                        "example": "Ec2Retype"
                      },
                      "completedSavings": {
                        "type": "number",
                        "description": "Completed savings amount.",
                        "example": 1000
                      },
                      "realizedSavings": {
                        "type": "number",
                        "description": "Realized savings amount.",
                        "example": 500
                      },
                      "potentialSavings": {
                        "type": "number",
                        "description": "Potential savings amount.",
                        "example": 1500
                      },
                      "resourcesApproved": {
                        "type": "integer",
                        "description": "Number of resources approved.",
                        "example": 10
                      },
                      "resourcesTotal": {
                        "type": "integer",
                        "description": "Total number of resources.",
                        "example": 20
                      },
                      "status": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Status of the recommendation.",
                        "example": "Functional"
                      },
                      "supportArticle": {
                        "type": "string",
                        "description": "URL to the support article.",
                        "example": "https://example.com/support"
                      },
                      "categoryTypeName": {
                        "type": "string",
                        "description": "Name of the category type.",
                        "example": "Compute"
                      },
                      "categoryTypeDescription": {
                        "type": "string",
                        "description": "Description of the category type.",
                        "example": "Compute resources optimization"
                      },
                      "isManualFix": {
                        "type": "boolean",
                        "description": "Indicates if the fix is manual.",
                        "example": false
                      },
                      "isPreview": {
                        "type": "boolean",
                        "description": "Indicates if the recommendation is in preview.",
                        "example": false
                      },
                      "isMetaFinder": {
                        "type": "boolean",
                        "description": "Indicates if it is a meta finder.",
                        "example": true
                      },
                      "supportsAutoFix": {
                        "type": "boolean",
                        "description": "Indicates if auto-fix is supported.",
                        "example": true
                      },
                      "isPSSupported": {
                        "type": "boolean",
                        "description": "Indicates if PS is supported.",
                        "example": true
                      },
                      "executeFixerInMW": {
                        "type": "boolean",
                        "description": "Indicates if the fixer is executed in MW.",
                        "example": false
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Unauthorized access"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "User not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "User not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/recommendations/summary-filters": {
      "get": {
        "summary": "Retrieve summary filters",
        "description": "Retrieves summary filters for organizational units, accounts, and regions, including tags.",
        "operationId": "getSummaryFilters",
        "tags": [
          "Recommendations"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Summary filters retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "string",
                      "description": "Base64 encoded JSON string containing the summary filters.",
                      "example": "eJyrVkrLz1eyUkpKLFKqBQA9JgQJ"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Tenant does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Tenant does not exist"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/recommendations/report": {
      "get": {
        "summary": "Get recommendation report",
        "description": "Retrieves the detailed report for a specific recommendation by ID",
        "operationId": "getRecommendationReport",
        "tags": [
          "Recommendations"
        ],
        "x-required-role": "Reader",
        "parameters": [
          {
            "name": "recommendationId",
            "in": "query",
            "required": true,
            "description": "The ID of the recommendation to get the report for",
            "schema": {
              "type": "string",
              "example": "rec-123456"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recommendation report retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The recommendation ID",
                      "example": "rec-123456"
                    },
                    "finderReport": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The detailed finder report data",
                      "example": "Report data content..."
                    }
                  },
                  "required": [
                    "id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing recommendationId parameter",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "recommendationId query parameter is required"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Recommendation not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Recommendation not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/recommendations/export/download": {
      "post": {
        "summary": "Post all recommendations export",
        "description": "Creates a CSV of all recommendations matching the given filters and returns a download URL valid for 15 minutes. The CSV includes a \"Fix Unavailable Reason\" column, filled in only for recommendations for which CloudFix has no automated fix. The \"Tags\" column lists every stored tag as `key=value` pairs joined by `; `, for reading. The 15th and last column, \"Resource Tags JSON\", holds the same tags as a JSON object (`{}` when untagged). The first 14 columns keep their names and positions; an importer that requires exactly 14 columns must accept the new one.",
        "operationId": "postAllRecommendationsExport",
        "tags": [
          "Recommendations"
        ],
        "x-required-role": "Reader",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "statuses": {
                    "type": "array",
                    "description": "Filter by recommendation status",
                    "items": {
                      "type": "string"
                    }
                  },
                  "accountIds": {
                    "type": "array",
                    "description": "Filter by AWS account ID",
                    "items": {
                      "type": "string"
                    }
                  },
                  "regions": {
                    "type": "array",
                    "description": "Filter by AWS region",
                    "items": {
                      "type": "string"
                    }
                  },
                  "finderTypes": {
                    "type": "array",
                    "description": "Filter by finder type",
                    "items": {
                      "type": "string"
                    }
                  },
                  "categories": {
                    "type": "array",
                    "description": "Filter by category",
                    "items": {
                      "type": "string"
                    }
                  },
                  "dateFrom": {
                    "type": "string",
                    "format": "date",
                    "description": "Filter recommendations created on or after this date (YYYY-MM-DD)"
                  },
                  "dateTo": {
                    "type": "string",
                    "format": "date",
                    "description": "Filter recommendations created on or before this date (YYYY-MM-DD)"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The export was created and a download URL is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "downloadUrl": {
                      "type": "string",
                      "description": "Download URL, valid for 15 minutes."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized."
          },
          "404": {
            "description": "Tenant not found."
          },
          "500": {
            "description": "The export could not be created."
          }
        }
      }
    },
    "/report/savings": {
      "get": {
        "summary": "Retrieve tenant savings",
        "description": "Retrieves savings data for the authorized tenant, encoded in a compressed format.",
        "operationId": "getTenantSavings",
        "tags": [
          "Savings and reports"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Tenant savings data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "string",
                      "description": "Base64 encoded JSON string containing the savings data.",
                      "example": "eJyrVkrLz1eyUkpKLFKqBQA9JgQJ"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/report/realized-savings": {
      "get": {
        "summary": "Retrieve tenant realized savings",
        "description": "Retrieves realized savings data for the authorized tenant, including completed and actual savings amounts, encoded in a compressed format.",
        "operationId": "getRealizedSavings",
        "tags": [
          "Savings and reports"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Tenant realized savings data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "string",
                      "description": "Base64 encoded and compressed JSON string containing the realized savings data, including resource IDs, completed savings, and realized savings amounts.",
                      "example": "eJyrVkrLz1eyUkpKLFKqBQA9JgQJ"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/savings/history": {
      "get": {
        "summary": "Retrieve savings history",
        "description": "Retrieves the savings history for the authorized tenant over the past few months.",
        "operationId": "getSavingsHistory",
        "tags": [
          "Savings and reports"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Savings history retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "category": {
                        "type": "string",
                        "description": "The category of savings.",
                        "example": "Cost Optimization"
                      },
                      "month": {
                        "type": "string",
                        "description": "The month for which the savings are recorded.",
                        "example": "2023-09"
                      },
                      "savings": {
                        "type": "number",
                        "description": "The total savings for the month.",
                        "example": 1000
                      },
                      "realizedSavings": {
                        "type": "number",
                        "description": "The realized savings for the month.",
                        "example": 800
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/budget/alignment-data": {
      "get": {
        "summary": "Retrieve budget alignment data",
        "description": "Retrieves budget alignment data for all business units, including budget limits, forecasted costs, and variance information.",
        "operationId": "getBudgetAlignmentData",
        "tags": [
          "Savings and reports"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Budget alignment data retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "businessUnits": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "businessUnitId": {
                            "type": "string",
                            "description": "The unique identifier of the business unit.",
                            "example": "bu-123"
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the business unit.",
                            "example": "Engineering"
                          },
                          "budgetLimit": {
                            "type": "number",
                            "description": "The budget limit for the business unit.",
                            "example": 100000
                          },
                          "forecastedEoQCost": {
                            "type": "number",
                            "description": "The forecasted end-of-quarter cost.",
                            "example": 95000
                          },
                          "severity": {
                            "type": "string",
                            "enum": [
                              "OK",
                              "INFO",
                              "WARNING",
                              "CRITICAL"
                            ],
                            "description": "The severity level of the budget variance.",
                            "example": "INFO"
                          },
                          "variancePercent": {
                            "type": "number",
                            "description": "The variance percentage from the budget limit.",
                            "example": -5
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/settings/excluded-accounts": {
      "get": {
        "summary": "Retrieve excluded accounts",
        "description": "Retrieves a list of accounts that are excluded from onboarding, finder, or fixer processes.",
        "operationId": "getExcludedAccounts",
        "tags": [
          "Account"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Excluded accounts retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string",
                        "description": "The ID of the excluded account.",
                        "example": "123456789012"
                      },
                      "onboarding": {
                        "type": "boolean",
                        "description": "Indicates if the account is excluded from onboarding.",
                        "example": true
                      },
                      "finder": {
                        "type": "boolean",
                        "description": "Indicates if the account is excluded from finder processes.",
                        "example": false
                      },
                      "fixer": {
                        "type": "boolean",
                        "description": "Indicates if the account is excluded from fixer processes.",
                        "example": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/settings/maintenance-windows/summary": {
      "get": {
        "summary": "Count maintenance windows",
        "description": "Counts the tenant's maintenance windows, for users who may not read the windows themselves. A count of zero means no window is configured.",
        "operationId": "getMaintenanceWindowsSummary",
        "tags": [
          "Account"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "The number of maintenance windows the tenant has configured",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "windowCount"
                  ],
                  "properties": {
                    "windowCount": {
                      "type": "integer",
                      "minimum": 0,
                      "example": 2
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required"
          },
          "403": {
            "description": "Forbidden, the caller has neither MaintenanceWindow:read nor Recommendations:read"
          },
          "500": {
            "description": "Internal server error. The count could not be read.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/tenant/details": {
      "get": {
        "summary": "Retrieve tenant details",
        "description": "Retrieves details about the tenant, including company name, registration status, and ticket creation capability.",
        "operationId": "getTenantDetails",
        "tags": [
          "Account"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Tenant details retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "companyName": {
                      "type": "string",
                      "description": "The name of the company associated with the tenant.",
                      "example": "Acme Corp"
                    },
                    "tenantCompletedRegistration": {
                      "type": "boolean",
                      "description": "Indicates if the tenant has completed registration.",
                      "example": true
                    },
                    "createTicketEnabled": {
                      "type": "boolean",
                      "description": "Indicates if ticket creation is enabled for the tenant.",
                      "example": true
                    },
                    "rightspendDashboardEnabled": {
                      "type": "boolean",
                      "description": "Indicates if the RightSpend qualification dashboard is enabled for the tenant.",
                      "example": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required"
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/organization/onboarding/stats": {
      "get": {
        "summary": "Retrieve organization onboarding stats",
        "description": "Retrieves onboarding statistics for the authorized organization, including start date, completion status, and template approval.",
        "operationId": "getOrganizationOnboardingStats",
        "tags": [
          "Account"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Onboarding statistics retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "started": {
                      "type": "string",
                      "format": "date-time",
                      "description": "The date when onboarding started.",
                      "example": "2023-01-01T12:00:00Z"
                    },
                    "finished": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "Indicates if the onboarding process is finished.",
                      "example": true
                    },
                    "hasCentralTemplateApproval": {
                      "type": "boolean",
                      "description": "Indicates if the central template approval is granted.",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden, user does not have access to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Forbidden"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    },
    "/stack-versions/latest": {
      "get": {
        "summary": "Retrieve latest stack version",
        "description": "Retrieves the latest stack version information, including version, release date, description, and update status.",
        "operationId": "getLatestStackVersion",
        "tags": [
          "Account"
        ],
        "x-required-role": "Reader",
        "responses": {
          "200": {
            "description": "Latest stack version retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "string",
                      "description": "The latest stack version.",
                      "example": "1.2.3"
                    },
                    "releaseDate": {
                      "type": "string",
                      "format": "date-time",
                      "description": "The release date of the latest stack version.",
                      "example": "2023-10-01T12:00:00Z"
                    },
                    "description": {
                      "type": "string",
                      "description": "Description of the latest stack version.",
                      "example": "Added new permissions"
                    },
                    "isObsolete": {
                      "type": "boolean",
                      "description": "Indicates if the current stack version is obsolete.",
                      "example": false
                    },
                    "needsUpdate": {
                      "type": "boolean",
                      "description": "Indicates if the stack needs an update.",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized, authentication required"
          },
          "404": {
            "description": "Not found, latest stack version not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "Latest stack version not found."
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "cloudfixToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "CloudFix API token, starts with cft_, created in the CloudFix app under API Tokens. Token roles: Reader can read recommendations, savings reports and account information. ResourceManager can do everything Reader can, and can also execute, cancel and snooze recommendations and create Jira and Zendesk tickets. RunbookManager can do everything ResourceManager can, and can also create a fixer's runbooks in the tenant's accounts."
      }
    }
  }
}
