{
 "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}": {
   "patch": {
    "tags": [
     "Servers"
    ],
    "operationId": "updateServer",
    "summary": "Rename a server or switch auto-renew",
    "x-summary-tr": "Sunucu adını değiştir veya otomatik yenilemeyi aç/kapat",
    "x-scope": "cloud_write",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "hostname": {
          "type": "string",
          "description": "Fully qualified host name (max 63 characters)",
          "example": "web-1.example.com"
         },
         "auto_renew": {
          "type": "boolean"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Updated server",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServerDetail"
          }
         }
        }
       }
      }
     },
     "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."
       }
      }
     }
    }
   },
   "ServerDetail": {
    "allOf": [
     {
      "$ref": "#/components/schemas/Server"
     },
     {
      "type": "object",
      "properties": {
       "live": {
        "$ref": "#/components/schemas/ServerLive"
       },
       "ssh_keys": {
        "$ref": "#/components/schemas/ServerSshKeys"
       }
      }
     }
    ]
   },
   "ServerSshKeys": {
    "type": [
     "object",
     "null"
    ],
    "description": "tr-ist-1: SSH keys given at creation. Gyro Compute servers (installed with cloud-init at creation): `state` installed | none, `method: cloud-init`, `fingerprints`, `key_ids` (matching keys of your account). Older tr-ist-1 servers: install state of the guest job.",
    "properties": {
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "sent",
       "installed",
       "failed",
       "cancelled",
       "none"
      ]
     },
     "fingerprints": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "attempts": {
      "type": "integer"
     },
     "message": {
      "type": [
       "string",
       "null"
      ]
     },
     "updated_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "method": {
      "type": "string",
      "description": "cloud-init (installed at creation) or guest-job"
     },
     "key_ids": {
      "type": "array",
      "items": {
       "type": "integer"
      },
      "description": "Ids of your account keys (/cloud/ssh-keys) with these fingerprints"
     }
    }
   },
   "ServerLive": {
    "type": [
     "object",
     "null"
    ],
    "properties": {
     "power_state": {
      "type": "string",
      "enum": [
       "running",
       "stopped",
       "starting",
       "stopping",
       "suspended",
       "deleting",
       "unknown"
      ]
     },
     "locked": {
      "type": "boolean",
      "description": "An action is running; writes return 409 server_locked"
     },
     "rescue_enabled": {
      "type": "boolean"
     },
     "backups_enabled": {
      "type": "boolean"
     },
     "ipv4": {
      "type": [
       "string",
       "null"
      ]
     },
     "ipv6_network": {
      "type": [
       "string",
       "null"
      ]
     },
     "cores": {
      "type": "integer"
     },
     "memory_gb": {
      "type": "number"
     },
     "disk_gb": {
      "type": "integer"
     },
     "image": {
      "type": [
       "string",
       "null"
      ],
      "description": "System image slug (null after a snapshot restore)"
     },
     "image_name": {
      "type": [
       "string",
       "null"
      ]
     },
     "region": {
      "type": [
       "string",
       "null"
      ],
      "example": "eu-de-1"
     },
     "location": {
      "type": [
       "string",
       "null"
      ],
      "deprecated": true,
      "description": "Legacy location code (use region)"
     },
     "traffic": {
      "type": "object",
      "properties": {
       "outgoing_bytes": {
        "type": "integer"
       },
       "included_bytes": {
        "type": "integer"
       }
      }
     },
     "checked_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "Server": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer",
      "example": 47466
     },
     "name": {
      "type": "string",
      "description": "Product name"
     },
     "hostname": {
      "type": [
       "string",
       "null"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "waiting",
       "inprocess",
       "active",
       "suspended",
       "cancelled"
      ],
      "description": "Billing / service status"
     },
     "product_id": {
      "type": "integer"
     },
     "plan": {
      "type": [
       "string",
       "null"
      ],
      "example": "standart-2-4"
     },
     "region": {
      "type": [
       "string",
       "null"
      ],
      "example": "eu-de-1"
     },
     "server_type": {
      "type": [
       "string",
       "null"
      ],
      "deprecated": true,
      "description": "Legacy type code (use plan)"
     },
     "location": {
      "type": [
       "string",
       "null"
      ],
      "deprecated": true,
      "description": "Legacy location code (use region)"
     },
     "ipv4": {
      "type": [
       "string",
       "null"
      ]
     },
     "ipv6": {
      "type": [
       "string",
       "null"
      ],
      "description": "IPv6 network (/64)"
     },
     "provisioned": {
      "type": "boolean",
      "description": "true once the machine exists"
     },
     "cycle": {
      "type": "string",
      "example": "monthly"
     },
     "price": {
      "$ref": "#/components/schemas/Money"
     },
     "auto_renew": {
      "type": "boolean"
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     },
     "due_date": {
      "type": [
       "string",
       "null"
      ],
      "format": "date"
     },
     "cancellation": {
      "type": [
       "string",
       "null"
      ],
      "enum": [
       "pending",
       "approved",
       null
      ]
     },
     "customer_id": {
      "type": [
       "integer",
       "null"
      ],
      "description": "Reseller end-customer (main key only)"
     },
     "product_line": {
      "type": "string",
      "enum": [
       "cloud_server",
       "vds"
      ]
     },
     "billing": {
      "type": "string",
      "enum": [
       "invoice",
       "prepaid"
      ],
      "description": "prepaid: `cycle` is `hourly`, `price.amount` is the hourly EUR price, `due_date` is null."
     }
    }
   },
   "Money": {
    "type": "object",
    "properties": {
     "amount": {
      "type": "number"
     },
     "currency": {
      "type": [
       "string",
       "null"
      ],
      "example": "TRY"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}