{
 "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/webhooks": {
   "post": {
    "tags": [
     "Webhooks"
    ],
    "operationId": "createWebhook",
    "summary": "Create a webhook (secret returned once)",
    "x-summary-tr": "Webhook oluştur (gizli anahtar bir kez döner)",
    "description": "Deliveries are `POST` JSON with headers `X-Gyro-Event`, `X-Gyro-Delivery`, `X-Gyro-Timestamp` and\n`X-Gyro-Signature: sha256=HMAC_SHA256(secret, timestamp + \".\" + body)` (white-label resellers: `X-Webhook-*`).\nReject requests whose timestamp is older than 5 minutes. Retries: exponential back-off, 8 attempts; 20 consecutive failures disable the webhook.\n",
    "x-description-tr": "Teslimler `POST` JSON'dur; başlıklar `X-Gyro-Event`, `X-Gyro-Delivery`, `X-Gyro-Timestamp` ve\n`X-Gyro-Signature: sha256=HMAC_SHA256(secret, timestamp + \".\" + body)` (beyaz etiketli bayi: `X-Webhook-*`).\nZaman damgası 5 dakikadan eskiyse reddedin. Tekrar: üstel geri çekilme, 8 deneme; 20 ardışık hata webhook'u kapatır.\n",
    "x-scope": "webhooks",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "url"
        ],
        "properties": {
         "url": {
          "type": "string",
          "format": "uri"
         },
         "events": {
          "type": "array",
          "items": {
           "$ref": "#/components/schemas/WebhookEvent"
          },
          "description": "empty = all"
         },
         "description": {
          "type": "string"
         },
         "customer_id": {
          "type": "integer",
          "description": "Reseller main key only"
         }
        }
       },
       "example": {
        "url": "https://hooks.example.com/gyro",
        "events": [
         "service.active",
         "invoice.paid"
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created (includes secret)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "allOf": [
            {
             "$ref": "#/components/schemas/Webhook"
            },
            {
             "type": "object",
             "properties": {
              "secret": {
               "type": "string"
              }
             }
            }
           ]
          }
         }
        }
       }
      }
     },
     "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"
      }
     }
    }
   }
  },
  "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."
       }
      }
     }
    }
   },
   "Webhook": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "url": {
      "type": "string"
     },
     "events": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/WebhookEvent"
      }
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "customer_id": {
      "type": [
       "integer",
       "null"
      ]
     },
     "status": {
      "type": "string",
      "enum": [
       "active",
       "disabled"
      ]
     },
     "consecutive_failures": {
      "type": "integer"
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   },
   "WebhookEvent": {
    "type": "string",
    "enum": [
     "service.created",
     "service.active",
     "service.suspended",
     "service.unsuspended",
     "service.cancelled",
     "service.status_changed",
     "invoice.created",
     "invoice.paid",
     "order.created",
     "ticket.replied",
     "ticket.status_changed",
     "api.test"
    ]
   }
  }
 },
 "security": [
  {
   "bearerAuth": []
  }
 ]
}