{
  "openapi": "3.1.0",
  "info": {
    "title": "Cloudidr FlexCompute API",
    "description": "API for managing compute schedule policies and capacity reservations.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://public-api.cloudidr.com",
      "description": "Production server"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/external/api/v1/flexcompute/search": {
      "get": {
        "summary": "Search Capacity",
        "description": "Search for available EC2 instance type offerings within a specific availability zone and time window.",
        "parameters": [
          {
            "name": "instanceType",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "EC2 instance type to check (e.g., c5.large)."
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "Linux/UNIX"
            },
            "description": "OS/platform for the offering (e.g., Linux/UNIX, Windows Server)."
          },
          {
            "name": "zoneId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Availability Zone identifier to search within (e.g., usw2-az1, aps1-az1)."
          },
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{2}/\\d{2}/\\d{4}$"
            },
            "description": "Start date of the desired reservation window, format MM/dd/yyyy (e.g., 12/20/2024)."
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\\d{2}/\\d{2}/\\d{4}$"
            },
            "description": "End date of the desired reservation window, format MM/dd/yyyy (e.g., 12/25/2024)."
          },
          {
            "name": "utcOffsetHours",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": -18,
              "maximum": 18
            },
            "description": "Client UTC offset in hours (range -18 to 18), used to interpret local dates."
          }
        ],
        "responses": {
          "200": {
            "description": "Success - Returns available instance type offerings",
            "content": {
              "application/json": {
                "example": [
                  {
                    "title": "Available (All)",
                    "status": "AVAILABLE_ALL",
                    "startDateTime": "2026-09-08T00:00:00-08:00",
                    "endDateTime": "2026-10-08T23:59:59-08:00"
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid date format or parameters",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "400",
                    "message": "Bad Request",
                    "details": {
                      "timestamp": "2026-01-08T14:44:01",
                      "description": "endDate: Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate'"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified instanceType does not exist",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2026-01-08T14:43:14",
                      "description": "Supported instance type c5.large1 and platform Linux/UNIX not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/flexcompute/reserve": {
      "post": {
        "summary": "Reserve Capacity",
        "description": "Create a reservation policy. Times must be in 15-minute increments.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "accountId",
                  "policyName",
                  "instanceType",
                  "platform",
                  "zoneId",
                  "quantity",
                  "startDate",
                  "endDate",
                  "startTime",
                  "endTime",
                  "utcOffsetHours"
                ],
                "properties": {
                  "accountId": {
                    "type": "string",
                    "description": "AWS account ID"
                  },
                  "policyName": {
                    "type": "string",
                    "description": "Name to assign to the reservation policy"
                  },
                  "instanceType": {
                    "type": "string",
                    "description": "EC2 instance type to check (e.g., c5.large)"
                  },
                  "platform": {
                    "type": "string",
                    "default": "Linux/UNIX",
                    "description": "OS/platform for the offering (e.g., Linux/UNIX, Windows Server)"
                  },
                  "zoneId": {
                    "type": "string",
                    "description": "Availability Zone identifier to search within (e.g., usw2-az1, aps1-az1)"
                  },
                  "quantity": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Number of instances to reserve (must be positive)"
                  },
                  "startDate": {
                    "type": "string",
                    "pattern": "^\\d{2}/\\d{2}/\\d{4}$",
                    "description": "Reservation start date, format MM/dd/yyyy (e.g., 12/20/2024)"
                  },
                  "endDate": {
                    "type": "string",
                    "pattern": "^\\d{2}/\\d{2}/\\d{4}$",
                    "description": "Reservation end date, format MM/dd/yyyy (e.g., 12/25/2024)"
                  },
                  "startTime": {
                    "type": "string",
                    "pattern": "^\\d{2}:\\d{2}$",
                    "description": "Reservation start time, format HH:mm (24-hour, e.g., 09:30)"
                  },
                  "endTime": {
                    "type": "string",
                    "pattern": "^\\d{2}:\\d{2}$",
                    "description": "Reservation end time, format HH:mm (24-hour, e.g., 23:15)"
                  },
                  "utcOffsetHours": {
                    "type": "string",
                    "description": "Client UTC offset in hours (range -18 to 18)"
                  },
                  "autoRenewalEnabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Enables auto-renewal for the policy"
                  },
                  "autoRenewalFrequency": {
                    "type": "string",
                    "enum": [
                      "one-day",
                      "one-week",
                      "one-month"
                    ],
                    "description": "Auto-renewal frequency (required when autoRenewalEnabled is true)"
                  }
                }
              },
              "example": {
                "accountId": "014876987943",
                "zoneId": "usw2-az1",
                "policyName": "Volod test policy",
                "instanceType": "c5.large",
                "platform": "Linux/UNIX",
                "startDate": "01/10/2026",
                "endDate": "01/12/2026",
                "startTime": "00:00",
                "endTime": "23:15",
                "utcOffsetHours": "-8",
                "quantity": 2
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success - Reservation was successful",
            "content": {
              "application/json": {
                "example": {
                  "myPolicy": {
                    "cidrId": "sc_830349911839",
                    "policyName": "Volod test policy",
                    "cspAccountName": "personal AWS",
                    "policyStatus": "READY_FOR_PURCHASE",
                    "policyOperatingState": "IDLE",
                    "policyInstance": {
                      "id": 1688,
                      "instanceType": "c5.large",
                      "platformCode": "Linux/UNIX",
                      "tenancyCode": "DEDICATED",
                      "vcpu": 2,
                      "memory": 4,
                      "gpu": 0,
                      "gpuMemory": 0,
                      "qty": 2
                    },
                    "cspRegion": {
                      "regionCode": "us-west-2",
                      "regionType": "PRIMARY",
                      "availabilityZoneId": "usw2-az1"
                    },
                    "createdDate": "2026-01-08T15:20:15.64868Z",
                    "capacityConfiguration": {
                      "launchDateTime": "2026-01-10T00:00:00-08:00",
                      "endDateTime": "2026-01-12T23:15:00-08:00",
                      "autoRenewalEnabled": false,
                      "frequency": null,
                      "vpc": "default",
                      "securityGroups": "none",
                      "amiImage": "default",
                      "sshPairKey": "none",
                      "ebsVolumeSize": 10
                    },
                    "pricing": {
                      "ourPrice": 8.48,
                      "cspProviderPrice": 12.11,
                      "savings": 3.63,
                      "savingsPercentage": 0.3,
                      "creditCardProcessingFee": 0.55,
                      "bankAccountProcessingFee": 0.07
                    }
                  },
                  "capacityAvailable": true,
                  "alternativeQtyRecommendations": [],
                  "alternativeTimeRecommendations": [],
                  "alternativeTypeRecommendations": []
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid time format or parameters",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "400",
                    "message": "Bad Request",
                    "details": {
                      "timestamp": "2026-01-08T15:23:53",
                      "description": "End time minute must be 0, 15, 30, or 45"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified instance type does not exist",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2026-01-08T14:43:14",
                      "description": "Supported instance type c5.large1 and platform Linux/UNIX not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/flexcompute/capacities": {
      "get": {
        "summary": "List of Capacities",
        "description": "Retrieve a paginated list of FlexCompute capacity policies with optional filtering and sorting.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "The page number for paginated results."
          },
          {
            "name": "pageSize",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "The number of records per page."
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            },
            "description": "Sort direction by creation date (asc or desc)."
          },
          {
            "name": "statuses",
            "in": "query",
            "required": false,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "ACTIVE",
                  "READY_FOR_PURCHASE",
                  "EXPIRED",
                  "CANCELED",
                  "FAILED",
                  "COMPLETED"
                ]
              }
            },
            "description": "Filter by policy status. Allowed values: ACTIVE, READY_FOR_PURCHASE, EXPIRED, CANCELED, FAILED, COMPLETED."
          }
        ],
        "responses": {
          "200": {
            "description": "Success Response - Returns a paginated list of capacity policies",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "page": {
                      "type": "integer"
                    },
                    "pageSize": {
                      "type": "integer"
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The resource or parameter value (e.g., incorrect policy status) was not found",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2025-03-04T16:59:58",
                      "description": "Provided policy status CANCELED1 not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/flexcompute/describe/{cidr_id}": {
      "get": {
        "summary": "Describe Capacity",
        "description": "This response provides detailed view information for a schedule policy, including policy details, region settings, instances, dates, disaster recovery events, and pricing.",
        "parameters": [
          {
            "name": "cidr_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "A unique identifier representing the schedule policy or customer view. This ID is used to retrieve detailed view information."
          }
        ],
        "responses": {
          "200": {
            "description": "Success - Returns detailed view information for a schedule policy"
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified cidr_id does not correspond to any existing schedule policy view",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2025-03-04T17:15:55",
                      "description": "Cidr 123 not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/flexcompute/purchase": {
      "post": {
        "summary": "Purchase Capacity",
        "description": "Purchase a reserved capacity policy.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "cidrId"
                ],
                "properties": {
                  "cidrId": {
                    "type": "string",
                    "description": "Policy/Capacity ID to purchase"
                  }
                }
              },
              "example": {
                "cidrId": "sc_1235674554"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success - Policy purchased successfully",
            "content": {
              "application/json": {
                "example": {
                  "cidrId": "sc_830349911839",
                  "policyName": "Volod test policy",
                  "cspAccountName": "personal AWS",
                  "policyStatus": "ACTIVE",
                  "policyOperatingState": "QUEUED_FOR_START",
                  "policyInstance": {
                    "id": 1688,
                    "instanceType": "c5.large",
                    "platformCode": "Linux/UNIX",
                    "tenancyCode": "DEDICATED",
                    "vcpu": 2,
                    "memory": 4,
                    "gpu": 0,
                    "gpuMemory": 0,
                    "qty": 2
                  },
                  "cspRegion": {
                    "regionCode": "us-west-2",
                    "regionType": "PRIMARY",
                    "availabilityZoneId": "usw2-az1"
                  },
                  "createdDate": "2026-01-08T15:20:15.64868Z",
                  "capacityConfiguration": {
                    "launchDateTime": "2026-01-10T00:00:00-08:00",
                    "endDateTime": "2026-01-12T23:15:00-08:00",
                    "autoRenewalEnabled": false,
                    "frequency": null,
                    "vpc": "default",
                    "securityGroups": "none",
                    "amiImage": "default",
                    "sshPairKey": "none",
                    "ebsVolumeSize": 10
                  },
                  "pricing": {
                    "ourPrice": 8.48,
                    "cspProviderPrice": 12.11,
                    "savings": 3.63,
                    "savingsPercentage": 0.3,
                    "creditCardProcessingFee": null,
                    "bankAccountProcessingFee": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified cidr_id does not correspond to any existing schedule policy",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2025-03-04T17:15:55",
                      "description": "Cidr rFVrfliRmYgD1 not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/flexcompute/capacity-configuration": {
      "put": {
        "summary": "Configure Capacity",
        "description": "Update capacity configuration settings for a policy.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "cidrId"
                ],
                "properties": {
                  "cidrId": {
                    "type": "string",
                    "description": "Policy/Capacity ID (e.g., sc_830349911839)"
                  },
                  "vpc": {
                    "type": "string",
                    "pattern": "^vpc-.*",
                    "description": "VPC ID, must start with vpc- (e.g., vpc-0a1b2c3d)"
                  },
                  "securityGroup": {
                    "type": "string",
                    "pattern": "^sg-.*",
                    "description": "Security group ID, must start with sg- (e.g., sg-0a1b2c3d)"
                  },
                  "amiImage": {
                    "type": "string",
                    "pattern": "^ami-.*",
                    "description": "AMI ID, must start with ami- (e.g., ami-0a1b2c3d)"
                  },
                  "sshPairKey": {
                    "type": "string",
                    "description": "SSH key pair name (free-form string)"
                  },
                  "ebsVolumeSize": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "EBS volume size in GB (must be positive)"
                  }
                }
              },
              "example": {
                "cidrId": "sc_830349911839",
                "vpc": "vpc-12345678",
                "securityGroup": "sg-12345678",
                "amiImage": "ami-12345678",
                "sshPairKey": "keypair-name",
                "ebsVolumeSize": 30
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success - Capacity configuration updated",
            "content": {
              "application/json": {
                "example": {
                  "cidrId": "sc_830349911839",
                  "policyName": "Volod test policy",
                  "cspAccountName": "personal AWS",
                  "policyStatus": "ACTIVE",
                  "policyOperatingState": "QUEUED_FOR_START",
                  "policyInstance": {
                    "id": 1688,
                    "instanceType": "c5.large",
                    "platformCode": "Linux/UNIX",
                    "tenancyCode": "DEDICATED",
                    "vcpu": 2,
                    "memory": 4,
                    "gpu": 0,
                    "gpuMemory": 0,
                    "qty": 2
                  },
                  "cspRegion": {
                    "regionCode": "us-west-2",
                    "regionType": "PRIMARY",
                    "availabilityZoneId": "usw2-az1"
                  },
                  "createdDate": "2026-01-08T15:20:15.64868Z",
                  "capacityConfiguration": {
                    "launchDateTime": "2026-01-10T00:00:00-08:00",
                    "endDateTime": "2026-01-12T23:15:00-08:00",
                    "autoRenewalEnabled": false,
                    "frequency": null,
                    "vpc": "vpc-12345678",
                    "securityGroups": "sg-12345678",
                    "amiImage": "ami-12345678",
                    "sshPairKey": "keypair-name",
                    "ebsVolumeSize": 30
                  },
                  "pricing": {
                    "ourPrice": 8.48,
                    "cspProviderPrice": 12.11,
                    "savings": 3.63,
                    "savingsPercentage": 0.3,
                    "creditCardProcessingFee": null,
                    "bankAccountProcessingFee": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid configuration parameters",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "400",
                    "message": "Bad Request",
                    "details": {
                      "timestamp": "2026-01-08T16:17:54",
                      "description": "securityGroups: securityGroups must be sg- followed by at least 8 hex characters"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified cidr_id does not correspond to any existing schedule policy",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2026-01-08T14:43:14",
                      "description": "Supported instance type c5.large1 and platform Linux/UNIX not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/flexcompute/capacity/auto-renewal": {
      "put": {
        "summary": "Renew Capacity",
        "description": "Update auto-renewal configuration for a capacity policy.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "cidrId"
                ],
                "properties": {
                  "cidrId": {
                    "type": "string",
                    "description": "Policy/Capacity ID (e.g., sc_830349911839)"
                  },
                  "autoRenewalEnabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Enables auto-renewal for the policy"
                  },
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "one-day",
                      "one-week",
                      "one-month"
                    ],
                    "description": "Auto-renewal frequency (required when autoRenewalEnabled is true)"
                  }
                }
              },
              "example": {
                "cidrId": "sc_238017929606",
                "autoRenewalEnabled": true,
                "frequency": "one-week"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success - Auto-renewal configuration updated",
            "content": {
              "application/json": {
                "example": {
                  "message": "Successfully update auto renewal information for policy sc_238017929606"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid parameters",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "400",
                    "message": "Bad Request",
                    "details": {
                      "timestamp": "2026-01-11T01:28:16",
                      "description": "JSON parse error: Cannot deserialize value of type java.lang.Boolean from String \"true123\": only \"true\" or \"false\" recognized"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified cidr_id does not correspond to any existing schedule policy",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2026-01-08T14:43:14",
                      "description": "Supported instance type c5.large1 and platform Linux/UNIX not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/external/api/v1/flexcompute/cancel": {
      "post": {
        "summary": "Cancel Capacity",
        "description": "Cancel a capacity reservation policy with applicable refunds based on cancellation timing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "cidrId"
                ],
                "properties": {
                  "cidrId": {
                    "type": "string",
                    "description": "Policy/Capacity ID to cancel"
                  }
                }
              },
              "example": {
                "cidrId": "sc_1235674554"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success - Policy canceled successfully with refund details",
            "content": {
              "application/json": {
                "examples": {
                  "scenario1": {
                    "summary": "Policy Cancelled Successfully",
                    "description": "This response indicates that the policy was canceled successfully, with a refund applied based on the cancellation conditions.",
                    "value": {
                      "message": "Policy canceled successfully. Early-cancellation fee = 50"
                    }
                  },
                  "scenario2": {
                    "summary": "Cancellation within 15 minutes",
                    "description": "This response indicates scenario when the policy is cancelled within 15 minutes after creation."
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Cancellation not allowed",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "400",
                    "message": "Bad Request",
                    "details": {
                      "timestamp": "2025-03-04T17:20:30",
                      "description": "Cancellation not allowed, reason: Policy is already canceled."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Unable to process access token",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "401",
                    "message": "Unauthorized",
                    "details": {
                      "timestamp": "2025-03-04T17:01:01",
                      "description": "Unable to process access token"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - The specified cidr_id does not correspond to any existing schedule policy",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "404",
                    "message": "Not Found",
                    "details": {
                      "timestamp": "2025-03-04T17:15:55",
                      "description": "Cidr rFVrfliRmYgD1 not found"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error - Unexpected error occurred",
            "content": {
              "application/json": {
                "example": {
                  "error": {
                    "code": "500",
                    "message": "Internal Server Error",
                    "details": {
                      "timestamp": "2025-03-04T17:17:08",
                      "description": "Unexpected error. Our team is working on it"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}