{
 "openapi": "3.1.0",
 "info": {
  "title": "Gyro Public API",
  "version": "2.30.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/servers/{id}": {
   "delete": {
    "tags": [
     "Servers"
    ],
    "operationId": "deleteServer",
    "summary": "Delete (cancel) a server",
    "x-summary-tr": "Sunucuyu sil (iptal)",
    "description": "Requires `confirm=true` (query or body). Two modes:\n* default: files a **cancellation request** (`status: cancellation_requested`). The server keeps running and billing\n  continues until the request is processed by the panel's automation (daily, business hours);\n* `immediate=true`: cancels **now** (`status: cancelling`, becomes `cancelled` within about a minute) - billing stops, the server is powered off at once and destroyed with\n  its data after the grace period (3 days). Same effect as an approved \"cancel now\" request in the panel. The operator can disable this.\nCalling it again is safe.\n",
    "x-description-tr": "`confirm=true` (sorgu veya gövde) zorunludur. İki biçim:\n* varsayılan: **iptal talebi** açar (`status: cancellation_requested`); talep panel otomasyonuyla işlenene kadar (günlük,\n  mesai saatleri) sunucu çalışır ve faturalama sürer;\n* `immediate=true`: **hemen** iptal eder (`status: cancelling`, yaklaşık bir dakikada `cancelled`) - faturalama durur, sunucu hemen kapanır, bekleme süresi (3 gün) sonunda\n  verisiyle silinir. Paneldeki onaylanmış \"hemen iptal\" ile aynı etki. Yönetici kapatabilir.\nTekrar çağırmak güvenlidir.\n",
    "x-scope": "cloud_delete",
    "parameters": [
     {
      "name": "confirm",
      "in": "query",
      "required": true,
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "immediate",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "default": false
      },
      "description": "true = cancel now instead of filing a request"
     }
    ],
    "responses": {
     "202": {
      "description": "Cancellation requested (default) or cancelled (immediate)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "status": {
             "type": "string",
             "enum": [
              "cancellation_requested",
              "cancelling",
              "cancelled"
             ]
            },
            "server_id": {
             "type": "integer"
            },
            "destroy_after_days": {
             "type": "integer"
            },
            "note": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "409": {
      "$ref": "#/components/responses/Conflict"
     },
     "422": {
      "$ref": "#/components/responses/Validation"
     }
    }
   },
   "parameters": [
    {
     "$ref": "#/components/parameters/ServerId"
    }
   ]
  }
 },
 "components": {
  "parameters": {
   "ServerId": {
    "name": "id",
    "in": "path",
    "required": true,
    "schema": {
     "type": "integer"
    },
    "description": "Server id (= service id in the client area)"
   }
  },
  "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"
      }
     }
    }
   }
  },
  "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."
       }
      }
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}