{
 "openapi": "3.1.0",
 "info": {
  "title": "Gyro Public API",
  "version": "2.44.0",
  "summary": "Manage Gyro cloud servers, SSH keys and billing programmatically.",
  "x-summary-tr": "Gyro bulut sunucularınızı, SSH anahtarlarınızı ve faturalarınızı programla yönetin.",
  "contact": {
   "name": "Gyro Hosting",
   "url": "https://www.gyrohosting.com"
  },
  "license": {
   "name": "Proprietary",
   "identifier": "LicenseRef-Gyro-API-Terms"
  }
 },
 "servers": [
  {
   "url": "https://www.gyrohosting.com/api/v1/client",
   "description": "Production"
  }
 ],
 "paths": {
  "/cloud/backup-spaces": {
   "post": {
    "tags": [
     "Backup space"
    ],
    "operationId": "createBackupSpace",
    "summary": "Order a backup space",
    "x-summary-tr": "Yedekleme alanı sipariş et",
    "x-scope": "cloud_order",
    "x-cli": {
     "command": "backup-space create",
     "money": true,
     "confirm": true
    },
    "description": "Orders ONE backup space and pays from the account balance (never a stored card). The space is bound to `server_id`, one of your active servers (Gyro Cloud tr-ist-1, TR VDS, managed or dedicated); it may be omitted when the account has exactly one. Only that server's IPv4 addresses can connect (SFTP, port 2201). Billed per `cycle` (fixed EUR prices charged in the account currency, VAT excluded) and renewed from the balance like other services. Send `\"dry_run\": true` for a quote; a real order needs `\"confirm\": true` and an `Idempotency-Key` header. The space is set up within about a minute (`backup_space.state` `pending` -> `active`); then read the password with `GET /cloud/backup-spaces/{id}/credentials`. Errors: 402 `insufficient_balance`; 403 `not_available` (not on sale for this account), `orders_disabled`; 409 `server_required` (no active server), `capacity_unavailable`; 422 `confirm_required` (with `quote`), `product_not_orderable`, `cycle_invalid`, `server_id_required`, `invalid_server`, `invalid_quantity`; 429 `daily_limit`.",
    "x-description-tr": "TEK bir yedekleme alanı sipariş eder ve hesap bakiyesinden öder (kayıtlı kart asla). Alan `server_id` ile hesabınızdaki etkin bir sunucuya bağlanır (Gyro Bulut tr-ist-1, TR VDS, yönetilen ya da fiziksel); hesapta tek sunucu varsa gönderilmeyebilir. Yalnız o sunucunun IPv4 adresleri bağlanabilir (SFTP, port 2201). `cycle` dönemine göre ücretlendirilir (sabit EUR fiyat hesap para biriminde, KDV hariç) ve diğer hizmetler gibi bakiyeden yenilenir. Teklif için `\"dry_run\": true`; gerçek sipariş `\"confirm\": true` ve `Idempotency-Key` başlığı ister. Alan yaklaşık bir dakikada kurulur (`backup_space.state` `pending` -> `active`); parola `GET /cloud/backup-spaces/{id}/credentials` ile alınır. Hatalar: 402 `insufficient_balance`; 403 `not_available` (bu hesap için satışta değil), `orders_disabled`; 409 `server_required` (etkin sunucu yok), `capacity_unavailable`; 422 `confirm_required` (`quote` ile), `product_not_orderable`, `cycle_invalid`, `server_id_required`, `invalid_server`, `invalid_quantity`; 429 `daily_limit`.",
    "parameters": [
     {
      "$ref": "#/components/parameters/IdempotencyKey"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "plan": {
          "type": "string",
          "example": "100gb",
          "description": "plan from GET /cloud/backup-spaces/plans (50gb, 100gb, 250gb, 500gb, 1tb)",
          "x-description-tr": "GET /cloud/backup-spaces/plans paketi"
         },
         "product_id": {
          "type": "integer",
          "description": "product id instead of plan",
          "x-description-tr": "plan yerine ürün kimliği"
         },
         "cycle": {
          "type": "string",
          "enum": [
           "monthly",
           "quarterly",
           "semiannually",
           "annually"
          ],
          "default": "monthly",
          "description": "billing cycle",
          "x-description-tr": "fatura dönemi"
         },
         "server_id": {
          "type": "integer",
          "description": "server to bind the space to (optional when the account has one active server)",
          "x-description-tr": "alanın bağlanacağı sunucu (hesapta tek etkin sunucu varsa isteğe bağlı)"
         },
         "name": {
          "type": "string",
          "maxLength": 60,
          "example": "gyro-proje-yedek",
          "description": "name (nickname)",
          "x-description-tr": "ad (takma ad)"
         },
         "tags": {
          "type": "array",
          "items": {
           "type": "string"
          },
          "maxItems": 10
         },
         "project_id": {
          "type": [
           "integer",
           "null"
          ],
          "description": "project (0 = default project)",
          "x-description-tr": "proje (0 = Genel)"
         },
         "end_customer_id": {
          "type": "integer",
          "description": "reseller main key: assign to this end-customer"
         },
         "confirm": {
          "type": "boolean"
         },
         "dry_run": {
          "type": "boolean"
         }
        }
       },
       "example": {
        "plan": "100gb",
        "cycle": "monthly",
        "server_id": 12345,
        "name": "gyro-proje-yedek",
        "confirm": true
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "backup_space": {
             "type": [
              "object",
              "null"
             ],
             "description": "the new service"
            },
            "plan": {
             "type": "string"
            },
            "size_gb": {
             "type": "integer"
            },
            "cycle": {
             "type": "string"
            },
            "server_id": {
             "type": "integer"
            },
            "next": {
             "type": "string"
            },
            "order": {
             "type": "object"
            },
            "payment": {
             "type": [
              "object",
              "null"
             ]
            },
            "invoice": {
             "type": [
              "object",
              "null"
             ]
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "200": {
      "description": "Dry-run quote (`dry_run`, `quote`)"
     },
     "402": {
      "$ref": "#/components/responses/PaymentRequired"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    }
   }
  }
 },
 "components": {
  "responses": {
   "RateLimited": {
    "description": "Too many requests (`rate_limited`); see the `Retry-After` and `X-RateLimit-*` headers",
    "headers": {
     "Retry-After": {
      "description": "Seconds to wait",
      "schema": {
       "type": "integer"
      }
     }
    },
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Validation": {
    "description": "Validation or business rule failure (`confirm_required`, `invalid_image`, `tool_action_failed` ...)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Conflict": {
    "description": "State conflict (`server_locked`, `not_actionable`, `ssh_key_exists`, `server_limit`, `idempotency_in_flight`)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "PaymentRequired": {
    "description": "Account balance does not cover the order (`insufficient_balance`)",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "NotFound": {
    "description": "Not found — also returned for objects owned by someone else",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Forbidden": {
    "description": "Key lacks the scope, IP not allowed, or feature disabled",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "required": [
     "error"
    ],
    "properties": {
     "error": {
      "type": "object",
      "required": [
       "code",
       "message"
      ],
      "properties": {
       "code": {
        "type": "string",
        "example": "server_not_found"
       },
       "message": {
        "type": "string"
       },
       "details": {
        "type": "object",
        "additionalProperties": true,
        "description": "Extra data. Limit refusals add the LimitHint fields (`limit_exceeded: true`, `limit_key`, `limit`, `current`, `how_to_increase`, `support_ticket`, `hint`): account limits are raised with a support ticket. Validation errors (length, format) never carry the limit hint.",
        "x-description-tr": "Ek veri. Sınır retlerinde LimitHint alanları gelir: hesap sınırları destek talebiyle artırılır. Doğrulama hataları (uzunluk, biçim) sınır ipucu taşımaz."
       }
      }
     }
    }
   }
  },
  "parameters": {
   "IdempotencyKey": {
    "name": "Idempotency-Key",
    "in": "header",
    "required": true,
    "schema": {
     "type": "string",
     "minLength": 8,
     "maxLength": 191
    },
    "description": "Unique per logical request (e.g. a UUID). Replays within 24 hours return the stored answer."
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}