{
  "openapi": "3.0.3",
  "info": {
    "title": "Webhostric API",
    "version": "2.0.0",
    "description": "Tek anahtarlı sunucusuz web platformu. Aynı yetenekler MCP'de: https://webhostric.com.tr/mcp. Ayrıntılı ajan talimatı: https://webhostric.com.tr/v1/instructions.txt"
  },
  "servers": [
    {
      "url": "https://webhostric.com.tr"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "account"
    },
    {
      "name": "domains"
    },
    {
      "name": "orders"
    },
    {
      "name": "sites"
    },
    {
      "name": "projects"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "wk_user_… kişisel anahtar, OAuth erişim token'ı (wh_at_…) veya partner wk_live_…"
      },
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://webhostric.com.tr/oauth/authorize",
            "tokenUrl": "https://webhostric.com.tr/oauth/token",
            "refreshUrl": "https://webhostric.com.tr/oauth/token",
            "scopes": {
              "account": "Hesap",
              "domains": "Alan adı",
              "orders": "Siparişler",
              "sites": "Siteler",
              "projects": "Projeler"
            }
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Yapılandırılmış hata",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Kimlik gerekli veya geçersiz",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "code",
          "error"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "unauthorized",
              "invalid_token",
              "forbidden",
              "insufficient_scope",
              "validation_error",
              "invalid_domain",
              "invalid_json",
              "not_found",
              "conflict",
              "quota_exceeded",
              "rate_limited",
              "insufficient_balance",
              "kyc_required",
              "approval_required",
              "approval_expired",
              "price_changed",
              "unsupported_tld",
              "provider_error",
              "ai_unavailable",
              "ai_invalid_output",
              "payload_too_large",
              "storage_unavailable",
              "topup_unavailable",
              "internal_error"
            ]
          },
          "error": {
            "type": "string"
          },
          "retryAfter": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "InsufficientBalance": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Error"
          },
          {
            "type": "object",
            "required": [
              "balance",
              "required",
              "shortfall",
              "topUpUrl"
            ],
            "properties": {
              "balance": {
                "type": "number"
              },
              "required": {
                "type": "number"
              },
              "shortfall": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "topUpUrl": {
                "type": "string",
                "format": "uri"
              },
              "message": {
                "type": "string",
                "example": "Bakiyen yok/yetersiz. Bakiye yükledikten sonra işleme devam edebilirsin."
              }
            }
          }
        ]
      },
      "DomainCheck": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "domain": {
            "type": "string"
          },
          "tld": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "available",
              "available_requires_kyc",
              "unavailable",
              "premium",
              "manual",
              "unsupported",
              "restricted",
              "provider_error"
            ]
          },
          "code": {
            "type": "string"
          },
          "available": {
            "type": "boolean"
          },
          "purchasable": {
            "type": "boolean"
          },
          "priceUsd": {
            "type": "number",
            "nullable": true
          },
          "provider": {
            "type": "string"
          },
          "requirements": {
            "type": "object",
            "properties": {
              "kycRequired": {
                "type": "boolean"
              },
              "documentsRequired": {
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            }
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "TldList": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "total": {
            "type": "integer"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tld": {
                  "type": "string"
                },
                "provider": {
                  "type": "string"
                },
                "priceUsd": {
                  "type": "number",
                  "nullable": true
                },
                "kycRequired": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "additionalProperties": true
      },
      "AccountStatus": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "account": {
            "type": "object",
            "additionalProperties": true
          },
          "balance": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string"
              },
              "amount": {
                "type": "number"
              }
            }
          },
          "kyc": {
            "type": "object",
            "additionalProperties": true
          },
          "siteLaunch": {
            "type": "object",
            "properties": {
              "currentBalanceUsd": {
                "type": "number"
              },
              "fundingState": {
                "type": "string",
                "enum": [
                  "quote_required",
                  "top_up_required"
                ]
              },
              "freePreviewAvailable": {
                "type": "boolean"
              },
              "quoteRequired": {
                "type": "boolean"
              },
              "approvalRequired": {
                "type": "boolean"
              },
              "topUpUrl": {
                "type": "string",
                "format": "uri"
              },
              "rule": {
                "type": "string"
              }
            }
          },
          "pendingOrders": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "links": {
            "type": "object",
            "additionalProperties": true
          },
          "recommendedNextAction": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "Quote": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "order": {
            "type": "object",
            "additionalProperties": true
          },
          "approvalRequired": {
            "type": "boolean"
          },
          "approveUrl": {
            "type": "string"
          },
          "kycRequired": {
            "type": "boolean"
          },
          "sufficientBalance": {
            "type": "boolean"
          },
          "shortfall": {
            "type": "number"
          },
          "topUpUrl": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "appUrl": {
            "type": "string"
          },
          "dataApi": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "CollectionDef": {
        "type": "object",
        "properties": {
          "fields": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "string",
                    "number",
                    "integer",
                    "boolean",
                    "object",
                    "array",
                    "any"
                  ]
                },
                "required": {
                  "type": "boolean"
                }
              }
            }
          },
          "publicRead": {
            "type": "boolean"
          },
          "publicWrite": {
            "type": "boolean"
          }
        }
      },
      "Query": {
        "type": "object",
        "properties": {
          "filter": {
            "type": "object",
            "additionalProperties": true,
            "description": "{alan: değer} veya {alan: {eq|ne|gt|gte|lt|lte|contains|in: değer}}"
          },
          "sort": {
            "type": "string",
            "example": "-_createdAt"
          },
          "limit": {
            "type": "integer",
            "maximum": 100
          },
          "cursor": {
            "type": "string"
          }
        }
      }
    }
  },
  "paths": {
    "/v1": {
      "get": {
        "operationId": "overview",
        "summary": "Servis özeti, yetenekler ve bağlantılar",
        "security": [],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/openapi.json": {
      "get": {
        "operationId": "openapi",
        "summary": "Bu OpenAPI belgesi",
        "security": [],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/instructions.txt": {
      "get": {
        "operationId": "instructions",
        "summary": "Yapay zekâ ajan talimatı (düz metin)",
        "security": [],
        "responses": {
          "200": {
            "description": "Metin",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "me",
        "summary": "Hesap durumu: bakiye, KYC, izinler, bekleyen siparişler, önerilen adım",
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountStatus"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/balance": {
      "get": {
        "operationId": "balance",
        "summary": "Bakiye ve doğrudan bakiye yükleme bağlantısı",
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/tlds": {
      "get": {
        "operationId": "listTlds",
        "summary": "Desteklenen uzantılar ve USD fiyatlar (anahtarsız da çalışır)",
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 500
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TldList"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/domain/check": {
      "post": {
        "operationId": "checkDomain",
        "summary": "Alan adı müsaitlik/fiyat/KYC sorgusu",
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "ornek.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainCheck"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "Marka kısıtı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainCheck"
                }
              }
            }
          },
          "422": {
            "description": "Desteklenmeyen uzantı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainCheck"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "description": "Sağlayıcı hatası; müsaitlik bilinmiyor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainCheck"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "checkDomainGet",
        "summary": "Alan adı sorgusu (GET)",
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainCheck"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainCheck"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainCheck"
                }
              }
            }
          }
        }
      }
    },
    "/v1/themes": {
      "get": {
        "operationId": "listThemes",
        "summary": "Site temaları",
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/order/quote": {
      "post": {
        "operationId": "orderQuote",
        "summary": "Teklif oluştur (ücret alınmaz; approveUrl döner)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "theme": {
                    "type": "string"
                  },
                  "years": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "businessName": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "address": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "domain": "ornek.com",
                "theme": "tanitim"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/order/{orderId}": {
      "get": {
        "operationId": "orderStatus",
        "summary": "Sipariş durumu",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/orders": {
      "get": {
        "operationId": "listOrders",
        "summary": "Siparişlerim",
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/order/execute": {
      "post": {
        "operationId": "orderExecute",
        "summary": "Kullanıcının onayladığı siparişi bakiyeden tamamla",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "orderId"
                ],
                "properties": {
                  "orderId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "Yetersiz bakiye",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientBalance"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "410": {
            "$ref": "#/components/responses/Error"
          },
          "412": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/sites": {
      "get": {
        "operationId": "listSites",
        "summary": "Sitelerim",
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/v1/sites/{domain}": {
      "get": {
        "operationId": "getSite",
        "summary": "Site ayrıntısı ve kurulum durumu",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/sites/{domain}/page": {
      "get": {
        "operationId": "getSitePage",
        "summary": "Sayfa HTML'i oku",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "/"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "put": {
        "operationId": "putSitePage",
        "summary": "Sayfa yaz ('/' tam HTML belgesi ister)",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "path",
                  "html"
                ],
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "html": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/sites/{domain}/edit": {
      "post": {
        "operationId": "editSite",
        "summary": "Siteyi doğal dille düzenle (GPT-OSS 120B)",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "instruction"
                ],
                "properties": {
                  "instruction": {
                    "type": "string"
                  },
                  "conversationId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/chat": {
      "post": {
        "operationId": "chat",
        "summary": "Site ajanı sohbeti (eski uç)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "conversationId": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "listProjects",
        "summary": "Projelerim",
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "post": {
        "operationId": "createProject",
        "summary": "Proje oluştur",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "name": "Envanter"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}": {
      "get": {
        "operationId": "projectStatus",
        "summary": "Proje durumu, kullanım ve son loglar",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteProject",
        "summary": "Projeyi kalıcı sil (confirm=true)",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "confirm",
            "in": "query",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "412": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}/logs": {
      "get": {
        "operationId": "projectLogs",
        "summary": "Proje logları",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}/build": {
      "post": {
        "operationId": "buildApp",
        "summary": "Doğal dilden uygulama üret ve yayınla",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "requirements"
                ],
                "properties": {
                  "requirements": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}/collections": {
      "get": {
        "operationId": "listCollections",
        "summary": "Koleksiyonlar",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}/collections/{name}": {
      "put": {
        "operationId": "defineCollection",
        "summary": "Koleksiyon tanımla/güncelle",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CollectionDef"
              },
              "example": {
                "fields": {
                  "title": {
                    "type": "string",
                    "required": true
                  },
                  "qty": {
                    "type": "integer"
                  }
                },
                "publicRead": true,
                "publicWrite": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "dropCollection",
        "summary": "Koleksiyonu sil (confirm=true)",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "412": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}/collections/{name}/query": {
      "post": {
        "operationId": "queryRecords",
        "summary": "Sınırlı sorgu (ham SQL yok)",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Query"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}/collections/{name}/records": {
      "post": {
        "operationId": "upsertRecords",
        "summary": "Kayıt ekle/güncelle (≤50)",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "records"
                ],
                "properties": {
                  "records": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "maxItems": 50
                  },
                  "merge": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteRecords",
        "summary": "Kayıt sil (≤50)",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,39}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ids"
                ],
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 50
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}/files": {
      "get": {
        "operationId": "listFiles",
        "summary": "Dosyalar",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "prefix",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/projects/{projectId}/files/{path}": {
      "get": {
        "operationId": "readFile",
        "summary": "Dosya oku",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ör. public/index.html (URL'de / korunur)"
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "put": {
        "operationId": "writeFile",
        "summary": "Dosya yaz (≤2 MB)",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ör. public/index.html (URL'de / korunur)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "content"
                ],
                "properties": {
                  "content": {
                    "type": "string"
                  },
                  "encoding": {
                    "type": "string",
                    "enum": [
                      "utf8",
                      "base64"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "413": {
            "$ref": "#/components/responses/Error"
          },
          "415": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "operationId": "deleteFile",
        "summary": "Dosya sil",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "prj_… veya slug"
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ör. public/index.html (URL'de / korunur)"
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "MCP ile aynı araç tanımları",
        "security": [],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/v1/tools/{toolName}": {
      "post": {
        "operationId": "callTool",
        "summary": "Bir aracı REST üzerinden çağır (MCP tools/call eşdeğeri)",
        "parameters": [
          {
            "name": "toolName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "get_account_status",
                "get_topup_link",
                "search_supported_tlds",
                "check_domain",
                "list_themes",
                "create_domain_order_quote",
                "get_order_status",
                "list_orders",
                "execute_domain_order",
                "list_sites",
                "get_site",
                "get_site_page",
                "upsert_site_page",
                "edit_site",
                "create_project",
                "list_projects",
                "get_project_status",
                "get_project_logs",
                "delete_project",
                "build_app",
                "db_define_collection",
                "db_list_collections",
                "db_query",
                "db_upsert",
                "db_delete",
                "db_drop_collection",
                "files_list",
                "files_read",
                "files_write",
                "files_delete",
                "move_domain",
                "move_domain_status",
                "create_email",
                "list_email"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "Yetersiz bakiye",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsufficientBalance"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "412": {
            "$ref": "#/components/responses/Error"
          },
          "422": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "502": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/domain/buy": {
      "post": {
        "operationId": "partnerBuy",
        "summary": "Partner (wk_live_) doğrudan kayıt; kullanıcı anahtarlarında kapalıdır",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string"
                  },
                  "theme": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  }
}