{
  "openapi": "3.0.0",
  "info": {
    "x-katapult-version": "3.26.2",
    "version": "1.0.0",
    "title": "Krystal Cloud Public API",
    "description": "Welcome to the documentation for the Krystal Cloud Public API"
  },
  "externalDocs": {
    "description": "Katapult API Documentation",
    "url": "https://docs.katapult.io/docs/category/public-api"
  },
  "servers": [
    {
      "url": "https://api.katapult.io/public/v1"
    }
  ],
  "paths": {
    "/data_centers": {
      "get": {
        "operationId": "get:data_centers",
        "summary": "List data centers",
        "description": "Provides a full list of all data centers",
        "tags": [
          "Data centers"
        ],
        "parameters": [

        ],
        "responses": {
          "200": {
            "description": "Provides a full list of all data centers",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data_centers": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DataCenter"
                      }
                    }
                  },
                  "required": [
                    "data_centers"
                  ]
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/APIAuthenticator403Response"
          },
          "429": {
            "$ref": "#/components/responses/APIAuthenticator429Response"
          }
        }
      }
    },
    "/pricing/prices": {
      "get": {
        "operationId": "get:pricing_prices",
        "summary": "Available Prices",
        "description": "Return available prices for the system",
        "tags": [
          "Pricing"
        ],
        "parameters": [

        ],
        "responses": {
          "200": {
            "description": "Return available prices for the system",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "prices": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GetPricingPrices200ResponsePrices"
                      },
                      "description": "The prices in the default price plan"
                    }
                  },
                  "required": [
                    "prices"
                  ]
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/APIAuthenticator403Response"
          },
          "429": {
            "$ref": "#/components/responses/APIAuthenticator429Response"
          }
        }
      }
    },
    "/stats": {
      "get": {
        "operationId": "get:stats",
        "summary": "Global stats",
        "description": "Return some key statistics about the platform",
        "tags": [
          "Stats"
        ],
        "parameters": [

        ],
        "responses": {
          "200": {
            "description": "Return some key statistics about the platform",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "total_virtual_machines_launched": {
                      "type": "integer",
                      "description": "The number of virtual machines launched (all time)"
                    },
                    "total_virtual_machines_launched_today": {
                      "type": "integer",
                      "description": "The number of virtual machines launched today"
                    },
                    "total_memory": {
                      "type": "integer",
                      "description": "The total amount of memory (in GB)"
                    },
                    "total_cpu_cores": {
                      "type": "integer",
                      "description": "The total number of CPU cores"
                    },
                    "total_block_storage": {
                      "type": "integer",
                      "description": "The total amount of block storage (in GB)"
                    },
                    "total_organizations": {
                      "type": "integer",
                      "description": "The number of organizations"
                    }
                  },
                  "required": [
                    "total_virtual_machines_launched",
                    "total_virtual_machines_launched_today",
                    "total_memory",
                    "total_cpu_cores",
                    "total_block_storage",
                    "total_organizations"
                  ]
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/APIAuthenticator403Response"
          },
          "429": {
            "$ref": "#/components/responses/APIAuthenticator429Response"
          }
        }
      }
    },
    "/virtual_machine_packages": {
      "get": {
        "operationId": "get:virtual_machine_packages",
        "summary": "Virtual machine packages",
        "description": "Return the currently available virtual machine packages",
        "tags": [
          "Virtual machine packages"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1
            },
            "description": "The page number to request. If not provided, the first page will be returned."
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 30,
              "minimum": 1
            },
            "description": "The number of items to return per page. If not provided, the default value will be used."
          }
        ],
        "responses": {
          "200": {
            "description": "Return the currently available virtual machine packages",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "pagination": {
                      "$ref": "#/components/schemas/PaginationObject"
                    },
                    "packages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/VirtualMachinePackage"
                      },
                      "description": "All available virtual machine packages"
                    }
                  },
                  "required": [
                    "pagination",
                    "packages"
                  ]
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/APIAuthenticator403Response"
          },
          "429": {
            "$ref": "#/components/responses/APIAuthenticator429Response"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "InternalAuthError": {
        "type": "object",
        "properties": {
          "details": {
            "type": "string"
          }
        }
      },
      "InternalAuthErrorEnum": {
        "type": "string",
        "enum": [
          "internal_auth_error"
        ]
      },
      "RateLimitReached": {
        "type": "object",
        "properties": {
          "total_permitted": {
            "type": "integer",
            "description": "The total number of requests per minute that are permitted"
          }
        }
      },
      "RateLimitReachedEnum": {
        "type": "string",
        "enum": [
          "rate_limit_reached"
        ]
      },
      "GetPricingPrices200ResponsePrices": {
        "type": "object",
        "properties": {
          "resource": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceVariant"
            }
          }
        }
      },
      "PriceVariant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "default": {
            "type": "boolean"
          },
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Price"
            }
          }
        }
      },
      "Price": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "price": {
            "type": "number",
            "format": "float"
          },
          "currency": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Currency"
            }
          }
        }
      },
      "Currency": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "iso_code": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          }
        }
      },
      "PaginationObject": {
        "type": "object",
        "properties": {
          "current_page": {
            "type": "integer",
            "description": "The current page"
          },
          "total_pages": {
            "type": "integer",
            "description": "The total number of pages",
            "nullable": true
          },
          "total": {
            "type": "integer",
            "description": "The total number of items across all pages",
            "nullable": true
          },
          "per_page": {
            "type": "integer",
            "description": "The number of items per page"
          },
          "large_set": {
            "type": "boolean",
            "description": "Is this a large set and therefore the total number of records cannot be returned?"
          }
        }
      },
      "VirtualMachinePackage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "permalink": {
            "type": "string"
          },
          "cpu_cores": {
            "type": "integer"
          },
          "ipv4_addresses": {
            "type": "integer"
          },
          "memory_in_gb": {
            "type": "integer"
          },
          "storage_in_gb": {
            "type": "integer"
          },
          "monthly_bandwidth_allowance_in_gb": {
            "type": "integer",
            "nullable": true
          },
          "privacy": {
            "$ref": "#/components/schemas/PrivacyTypesEnum"
          },
          "icon": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Attachment"
              }
            ],
            "nullable": true
          },
          "use_dedicated_cpus": {
            "type": "boolean"
          },
          "group": {
            "$ref": "#/components/schemas/VirtualMachinePackageGroup"
          }
        }
      },
      "PrivacyTypesEnum": {
        "type": "string",
        "enum": [
          "public",
          "private"
        ]
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "file_type": {
            "type": "string"
          },
          "file_size": {
            "type": "integer"
          },
          "digest": {
            "type": "string"
          },
          "token": {
            "type": "string"
          }
        }
      },
      "VirtualMachinePackageGroup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "DataCenter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "permalink": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "APIAuthenticator403Response": {
        "description": "403 error response",
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "code": {
                  "$ref": "#/components/schemas/InternalAuthErrorEnum"
                },
                "description": {
                  "type": "string"
                },
                "detail": {
                  "$ref": "#/components/schemas/InternalAuthError"
                }
              }
            }
          }
        }
      },
      "APIAuthenticator429Response": {
        "description": "You have reached the rate limit for this type of request",
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "code": {
                  "$ref": "#/components/schemas/RateLimitReachedEnum"
                },
                "description": {
                  "type": "string"
                },
                "detail": {
                  "$ref": "#/components/schemas/RateLimitReached"
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [

  ],
  "tags": [
    {
      "name": "Stats"
    },
    {
      "name": "Pricing"
    },
    {
      "name": "Virtual machine packages"
    },
    {
      "name": "Data centers"
    }
  ],
  "x-tagGroups": [
    {
      "name": "Data centers",
      "tags": [
        "Data centers"
      ]
    },
    {
      "name": "Pricing",
      "tags": [
        "Pricing"
      ]
    },
    {
      "name": "Stats",
      "tags": [
        "Stats"
      ]
    },
    {
      "name": "Virtual machine packages",
      "tags": [
        "Virtual machine packages"
      ]
    }
  ]
}