{
 "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/{id}/server": {
   "put": {
    "tags": [
     "Backup space"
    ],
    "operationId": "attachBackupSpaceServer",
    "summary": "Bind the space to another server",
    "x-summary-tr": "Alanı başka sunucuya bağla",
    "x-scope": "services_write",
    "x-cli": {
     "command": "backup-space attach-server",
     "confirm": false
    },
    "description": "Binds the space to `server_id` (one of your active servers; optional when the account has one). From then on only that server's IPv4 addresses can connect; the previous server loses access at once. Files are not touched. When the bound server's IP changes or the server is cancelled, access follows automatically.",
    "x-description-tr": "Alanı `server_id` sunucusuna bağlar (hesabınızdaki etkin sunuculardan biri; tek sunucu varsa isteğe bağlı). Bundan sonra yalnız o sunucunun IPv4 adresleri bağlanabilir; önceki sunucunun erişimi hemen kapanır. Dosyalara dokunulmaz. Bağlı sunucunun IP'si değişir ya da sunucu iptal edilirse erişim kendiliğinden eşitlenir.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Backup space (service) id",
      "x-description-tr": "Yedekleme alanı (hizmet) kimliği"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "server_id": {
          "type": "integer",
          "description": "server id",
          "x-description-tr": "sunucu kimliği"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "backup_space_id": {
             "type": "integer"
            },
            "backup_space": {
             "$ref": "#/components/schemas/BackupSpaceConnection"
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "$ref": "#/components/responses/Forbidden"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     }
    }
   }
  }
 },
 "components": {
  "responses": {
   "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"
      }
     }
    }
   },
   "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."
       }
      }
     }
    }
   },
   "BackupSpaceConnection": {
    "type": "object",
    "description": "Connection and state of the space (no password: use /credentials).",
    "x-description-tr": "Alanın bağlantısı ve durumu (parola yok: /credentials).",
    "properties": {
     "host": {
      "type": "string",
      "example": "45.87.174.12",
      "description": "SFTP host (empty until the space is set up)"
     },
     "port": {
      "type": "integer",
      "example": 2201
     },
     "user": {
      "type": "string",
      "example": "y-m12345"
     },
     "path": {
      "type": "string",
      "example": "/veri",
      "description": "writable directory (the root is read-only)"
     },
     "protocol": {
      "type": "string",
      "const": "sftp"
     },
     "size_gb": {
      "type": "integer"
     },
     "size_plan": {
      "type": "string",
      "example": "100gb"
     },
     "used_bytes": {
      "type": [
       "integer",
       "null"
      ]
     },
     "used_percent": {
      "type": [
       "number",
       "null"
      ]
     },
     "server_id": {
      "type": [
       "integer",
       "null"
      ],
      "description": "bound server"
     },
     "allowed_ips": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "IPv4 addresses of the bound server allowed to connect"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "active",
       "noserver",
       "suspended",
       "cancelled",
       "purged"
      ],
      "description": "pending = being set up; noserver = no bound server (no one can connect); suspended = access locked, data kept; cancelled/purged = deleted"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}