{
  "openapi": "3.1.0",
  "info": {
    "title": "Kivilio Drive API",
    "version": "1.0.0",
    "description": "Kivilio Drive'a kendi sunucundan bağlan: dosya yükle, indir, listele, paylaş, herkese açık yap. Kimlik: `Authorization: Bearer kvd_…` (Drive → Geliştirici). Belgeler: https://docs.kivilio.com"
  },
  "servers": [
    {
      "url": "https://drive.kivilio.com/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Dosyalar ve klasörler"
    },
    {
      "name": "Yükleme"
    },
    {
      "name": "Paylaşım ve gizlilik"
    },
    {
      "name": "API anahtarları"
    }
  ],
  "paths": {
    "/nodes": {
      "get": {
        "operationId": "listNodes",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Listele ya da ara",
        "parameters": [
          {
            "name": "parentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "default": "mine",
              "type": "string",
              "enum": [
                "mine",
                "shared",
                "recent",
                "pinned",
                "trash"
              ]
            },
            "description": "mine | shared | recent | pinned | trash"
          },
          {
            "name": "sourceApp",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "drive",
                "voice",
                "katalog",
                "api"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "default": "name",
              "type": "string",
              "enum": [
                "name",
                "updated",
                "size"
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "description": "Önceki yanıtın nextCursor değeri"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Liste",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "`parentId` verilmezse Drive'ım kökü (klasörle sınırlı anahtarda anahtarın klasörü). `q` ile ad araması (ilk `limit` sonuç, sayfalama yok). Sayfalama imleçle: yanıttaki `nextCursor`'ı `cursor` olarak gönder.\n\nGereken yetki: `drive:read`.",
        "x-scope": "drive:read"
      }
    },
    "/nodes/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Öğenin kimliği (uuid)"
        }
      ],
      "get": {
        "operationId": "getNode",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Tek öğe",
        "responses": {
          "200": {
            "description": "Öğe ve yolu",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeDetail"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:read`.",
        "x-scope": "drive:read"
      },
      "patch": {
        "operationId": "updateNode",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Yeniden adlandır, taşı, sabitle, gizlilik",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNodeInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Güncel öğe",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriveNode"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "`visibility` ayrıca `drive:share` ister ve yalnızca dosyanın sahibi değiştirebilir. Uygulama klasörlerindeki öğeler yeniden adlandırılamaz ve taşınamaz.\n\nGereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      },
      "delete": {
        "operationId": "deleteNode",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Çöpe at ya da kalıcı sil",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "permanent",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Silindi"
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Varsayılan: çöp kutusuna (30 gün). `?permanent=1`: kalıcı siler; öğe önce çöpte olmalı, yalnızca sahibi.\n\nGereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/nodes/{id}/restore": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Öğenin kimliği (uuid)"
        }
      ],
      "post": {
        "operationId": "restoreNode",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Çöpten geri al",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Geri alınan öğe",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriveNode"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/folders": {
      "post": {
        "operationId": "createFolder",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Klasör oluştur",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFolderInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Klasör",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriveNode"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/files": {
      "post": {
        "operationId": "uploadFile",
        "tags": [
          "Yükleme"
        ],
        "summary": "Basit yükleme (tek istek)",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024
            }
          },
          {
            "name": "parentId",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          {
            "name": "checksum",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "contentMediaType": "application/octet-stream"
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "contentMediaType": "application/octet-stream"
                  },
                  "name": {
                    "type": "string"
                  },
                  "parentId": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Yüklenen dosya",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriveNode"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Küçük dosyalar için (varsayılan en fazla 50 MB). Ham gövde: `Content-Type` dosyanın türü, `Content-Length` zorunlu, ad sorgu dizesinde. Ya da `multipart/form-data` (`file`, `name`, `parentId`). Büyük dosyalar: `POST /uploads`.\n\nGereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/uploads": {
      "post": {
        "operationId": "startUpload",
        "tags": [
          "Yükleme"
        ],
        "summary": "Parçalı yüklemeyi başlat",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartUploadInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Yükleme bileti",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadTicket"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Küçük dosyada tek imzalı PUT adresi (`mode: single`), büyükte parça adresleri (`mode: multipart`). Dosya doğrudan depolamaya (`storage.kivilio.com`) gönderilir, sonra `POST /uploads/{id}/complete`.\n\nGereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/uploads/{id}/parts": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "uploadId"
        }
      ],
      "post": {
        "operationId": "refreshUploadParts",
        "tags": [
          "Yükleme"
        ],
        "summary": "Parça adreslerini yenile",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefreshPartsInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Yeni adresler",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadParts"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/uploads/{id}/complete": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "uploadId"
        }
      ],
      "post": {
        "operationId": "completeUpload",
        "tags": [
          "Yükleme"
        ],
        "summary": "Yüklemeyi tamamla",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Hazır dosya",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DriveNode"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "422": {
            "$ref": "#/components/responses/E422"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/uploads/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "uploadId"
        }
      ],
      "delete": {
        "operationId": "abortUpload",
        "tags": [
          "Yükleme"
        ],
        "summary": "Yüklemeyi iptal et",
        "responses": {
          "204": {
            "description": "İptal edildi"
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/files/{id}/download": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Öğenin kimliği (uuid)"
        }
      ],
      "get": {
        "operationId": "downloadFile",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "İndir",
        "responses": {
          "302": {
            "description": "İmzalı adres (`Location`)"
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "5 dakikalık imzalı depolama adresine `302`. `Range` başlığını yönlendirilen adrese gönder.\n\nGereken yetki: `drive:read`.",
        "x-scope": "drive:read"
      }
    },
    "/files/{id}/preview": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Öğenin kimliği (uuid)"
        }
      ],
      "get": {
        "operationId": "previewFile",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Tarayıcıda aç (görsel, ses, video, PDF)",
        "responses": {
          "302": {
            "description": "İmzalı adres (`Location`)"
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "415": {
            "$ref": "#/components/responses/E415"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:read`.",
        "x-scope": "drive:read"
      }
    },
    "/nodes/{id}/shares": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Öğenin kimliği (uuid)"
        }
      ],
      "get": {
        "operationId": "listShares",
        "tags": [
          "Paylaşım ve gizlilik"
        ],
        "summary": "Kişiye paylaşımlar",
        "responses": {
          "200": {
            "description": "Paylaşımlar",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ShareEntry"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:share`.",
        "x-scope": "drive:share"
      },
      "post": {
        "operationId": "addShare",
        "tags": [
          "Paylaşım ve gizlilik"
        ],
        "summary": "Kişiye paylaş",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddShareInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Paylaşım",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareEntry"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:share`.",
        "x-scope": "drive:share"
      },
      "patch": {
        "operationId": "updateShare",
        "tags": [
          "Paylaşım ve gizlilik"
        ],
        "summary": "Paylaşımın yetkisini değiştir",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "shareId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateShareInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Paylaşım",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareEntry"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:share`.",
        "x-scope": "drive:share"
      },
      "delete": {
        "operationId": "removeShare",
        "tags": [
          "Paylaşım ve gizlilik"
        ],
        "summary": "Paylaşımı kaldır",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "name": "shareId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Kaldırıldı"
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:share`.",
        "x-scope": "drive:share"
      }
    },
    "/nodes/{id}/link": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Öğenin kimliği (uuid)"
        }
      ],
      "get": {
        "operationId": "getLink",
        "tags": [
          "Paylaşım ve gizlilik"
        ],
        "summary": "Etkin süreli bağlantı",
        "responses": {
          "200": {
            "description": "Bağlantı (token'sız) ya da null",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "link": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/LinkInfo"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:share`.",
        "x-scope": "drive:share"
      },
      "post": {
        "operationId": "createLink",
        "tags": [
          "Paylaşım ve gizlilik"
        ],
        "summary": "Süreli bağlantı oluştur",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLinkInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bağlantı",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkInfo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Önceki bağlantı iptal olur. Düz token yalnızca bu yanıtta döner. Idempotency-Key desteklenmez.\n\nGereken yetki: `drive:share`.",
        "x-scope": "drive:share"
      },
      "delete": {
        "operationId": "revokeLink",
        "tags": [
          "Paylaşım ve gizlilik"
        ],
        "summary": "Bağlantıyı iptal et",
        "responses": {
          "204": {
            "description": "İptal edildi"
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:share`.",
        "x-scope": "drive:share"
      }
    },
    "/trash": {
      "delete": {
        "operationId": "emptyTrash",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Çöp kutusunu boşalt (kalıcı)",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Silinen öğe sayısı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/usage": {
      "get": {
        "operationId": "getUsage",
        "tags": [
          "Dosyalar ve klasörler"
        ],
        "summary": "Kullanılan alan ve kota",
        "responses": {
          "200": {
            "description": "Kullanım",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:read`.",
        "x-scope": "drive:read"
      }
    },
    "/keys": {
      "get": {
        "operationId": "listApiKeys",
        "tags": [
          "API anahtarları"
        ],
        "summary": "API anahtarlarım",
        "responses": {
          "200": {
            "description": "Anahtarlar",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApiKey"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Yalnızca Drive arayüzünden ya da kendi Logto token'ınla; bir API anahtarıyla çağrılamaz.\n\nGereken yetki: `drive:read`.",
        "x-scope": "drive:read"
      },
      "post": {
        "operationId": "createApiKey",
        "tags": [
          "API anahtarları"
        ],
        "summary": "API anahtarı oluştur",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Anahtar",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedApiKey"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Düz anahtar yalnızca bu yanıtta, bir kez döner. En fazla 20 etkin anahtar.\n\nGereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    },
    "/keys/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string"
          },
          "description": "Anahtarın kimliği (key_…)"
        }
      ],
      "delete": {
        "operationId": "revokeApiKey",
        "tags": [
          "API anahtarları"
        ],
        "summary": "API anahtarını iptal et",
        "responses": {
          "204": {
            "description": "İptal edildi"
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "description": "Gereken yetki: `drive:write`.",
        "x-scope": "drive:write"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Kişisel API anahtarı (`kvd_…`). Kivilio uygulamaları Logto erişim token'ı kullanır."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "1–200 karakter. Aynı anahtarla 24 saat içinde tekrarlanan istek ilk başarılı yanıtı döner (`Idempotent-Replayed: true`).",
        "schema": {
          "type": "string",
          "maxLength": 200
        }
      }
    },
    "headers": {
      "RequestId": {
        "description": "İsteğin kimliği; hata gövdesindeki requestId ile aynı",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "E400": {
        "description": "İstek geçersiz (`bad_request`)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E401": {
        "description": "Kimlik yok ya da geçersiz (`unauthorized`)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E403": {
        "description": "Yetki yetmiyor (`forbidden`)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E404": {
        "description": "Bulunamadı ya da erişimin yok (`not_found`)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E409": {
        "description": "Çakışma (`conflict`, `name_conflict`)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E413": {
        "description": "Çok büyük ya da kota dolu (`too_large`, `quota_exceeded`)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E415": {
        "description": "Önizlenemeyen tür (`unsupported_media`)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E422": {
        "description": "Boyut uyuşmuyor ya da Idempotency-Key başka istekte kullanılmış (`size_mismatch`, `idempotency_mismatch`)",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E429": {
        "description": "Hız sınırı (`rate_limited`); `Retry-After` başlığına bak",
        "headers": {
          "X-Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "schema": {
              "type": "integer"
            },
            "description": "Saniye"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "DriveNode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "FOLDER",
              "FILE"
            ]
          },
          "name": {
            "type": "string"
          },
          "parentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "sizeBytes": {
            "type": "string",
            "pattern": "^\\d+$",
            "description": "Bayt; büyük sayılar kaybolmasın diye metin olarak"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "READY"
            ]
          },
          "sourceApp": {
            "type": "string",
            "enum": [
              "drive",
              "voice",
              "katalog",
              "api"
            ],
            "description": "Öğeyi kim yükledi: arayüz, uygulama ya da API"
          },
          "sourceRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "pinned": {
            "type": "boolean"
          },
          "trashedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "ISO 8601 zaman, UTC"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601 zaman, UTC"
          },
          "updatedAt": {
            "type": "string",
            "description": "ISO 8601 zaman, UTC"
          },
          "role": {
            "type": "string",
            "enum": [
              "OWNER",
              "EDITOR",
              "VIEWER"
            ],
            "description": "İsteği yapanın bu öğedeki yetkisi"
          },
          "shared": {
            "type": "boolean",
            "description": "Öğe başkasına ait (seninle paylaşılmış)"
          },
          "system": {
            "description": "Uygulama klasörü (ör. Voice kayıtları)",
            "type": "boolean"
          },
          "managedBy": {
            "description": "Uygulama alanında: salt okunur (yükleme, klasör açma, taşıma yok; silme var)",
            "type": "string",
            "enum": [
              "voice",
              "katalog"
            ]
          },
          "childCount": {
            "description": "Sadece listede, klasörler için",
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "link",
              "public"
            ]
          },
          "publicUrl": {
            "description": "Yalnızca visibility = public iken",
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "parentId",
          "mimeType",
          "sizeBytes",
          "status",
          "sourceApp",
          "sourceRef",
          "pinned",
          "trashedAt",
          "createdAt",
          "updatedAt",
          "role",
          "shared",
          "visibility"
        ],
        "additionalProperties": false
      },
      "NodeList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DriveNode"
            }
          },
          "nextCursor": {
            "description": "Sonraki sayfa için ?cursor=; son sayfada null",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "NodeDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "FOLDER",
              "FILE"
            ]
          },
          "name": {
            "type": "string"
          },
          "parentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "sizeBytes": {
            "type": "string",
            "pattern": "^\\d+$",
            "description": "Bayt; büyük sayılar kaybolmasın diye metin olarak"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "READY"
            ]
          },
          "sourceApp": {
            "type": "string",
            "enum": [
              "drive",
              "voice",
              "katalog",
              "api"
            ],
            "description": "Öğeyi kim yükledi: arayüz, uygulama ya da API"
          },
          "sourceRef": {
            "type": [
              "string",
              "null"
            ]
          },
          "pinned": {
            "type": "boolean"
          },
          "trashedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "ISO 8601 zaman, UTC"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601 zaman, UTC"
          },
          "updatedAt": {
            "type": "string",
            "description": "ISO 8601 zaman, UTC"
          },
          "role": {
            "type": "string",
            "enum": [
              "OWNER",
              "EDITOR",
              "VIEWER"
            ],
            "description": "İsteği yapanın bu öğedeki yetkisi"
          },
          "shared": {
            "type": "boolean",
            "description": "Öğe başkasına ait (seninle paylaşılmış)"
          },
          "system": {
            "description": "Uygulama klasörü (ör. Voice kayıtları)",
            "type": "boolean"
          },
          "managedBy": {
            "description": "Uygulama alanında: salt okunur (yükleme, klasör açma, taşıma yok; silme var)",
            "type": "string",
            "enum": [
              "voice",
              "katalog"
            ]
          },
          "childCount": {
            "description": "Sadece listede, klasörler için",
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "link",
              "public"
            ]
          },
          "publicUrl": {
            "description": "Yalnızca visibility = public iken",
            "type": "string",
            "format": "uri"
          },
          "path": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name"
              ],
              "additionalProperties": false
            },
            "description": "Kökten ebeveyne, erişilebilen atalar"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "parentId",
          "mimeType",
          "sizeBytes",
          "status",
          "sourceApp",
          "sourceRef",
          "pinned",
          "trashedAt",
          "createdAt",
          "updatedAt",
          "role",
          "shared",
          "visibility",
          "path"
        ],
        "additionalProperties": false
      },
      "UploadTicket": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "uploadId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "nodeId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "mode": {
                "type": "string",
                "const": "single"
              },
              "url": {
                "type": "string",
                "format": "uri",
                "description": "İmzalı PUT adresi (15 dk)"
              },
              "headers": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "string"
                },
                "description": "PUT isteğinde aynen gönderilecek"
              },
              "expiresAt": {
                "type": "string",
                "description": "ISO 8601 zaman, UTC"
              }
            },
            "required": [
              "uploadId",
              "nodeId",
              "mode",
              "url",
              "headers",
              "expiresAt"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "uploadId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "nodeId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "mode": {
                "type": "string",
                "const": "multipart"
              },
              "partSize": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "partCount": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "parts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "partNumber": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "required": [
                    "partNumber",
                    "url"
                  ],
                  "additionalProperties": false
                }
              },
              "expiresAt": {
                "type": "string",
                "description": "ISO 8601 zaman, UTC"
              }
            },
            "required": [
              "uploadId",
              "nodeId",
              "mode",
              "partSize",
              "partCount",
              "parts",
              "expiresAt"
            ],
            "additionalProperties": false
          }
        ]
      },
      "UploadParts": {
        "type": "object",
        "properties": {
          "parts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "partNumber": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "partNumber",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "expiresAt": {
            "type": "string",
            "description": "ISO 8601 zaman, UTC"
          }
        },
        "required": [
          "parts",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "Usage": {
        "type": "object",
        "properties": {
          "usedBytes": {
            "type": "string",
            "pattern": "^\\d+$",
            "description": "Bayt; büyük sayılar kaybolmasın diye metin olarak"
          },
          "reservedBytes": {
            "type": "string",
            "pattern": "^\\d+$",
            "description": "Bayt; büyük sayılar kaybolmasın diye metin olarak"
          },
          "limitBytes": {
            "type": "string",
            "pattern": "^\\d+$",
            "description": "Bayt; büyük sayılar kaybolmasın diye metin olarak"
          },
          "byApp": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "enum": [
                "drive",
                "voice",
                "katalog",
                "api"
              ]
            },
            "additionalProperties": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Bayt; büyük sayılar kaybolmasın diye metin olarak"
            },
            "required": [
              "drive",
              "voice",
              "katalog",
              "api"
            ]
          }
        },
        "required": [
          "usedBytes",
          "reservedBytes",
          "limitBytes",
          "byApp"
        ],
        "additionalProperties": false
      },
      "ShareEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "granteeUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "granteeEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "VIEWER",
              "EDITOR"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601 zaman, UTC"
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ]
          },
          "displayEmail": {
            "type": [
              "string",
              "null"
            ]
          },
          "pending": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "granteeUserId",
          "granteeEmail",
          "role",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "LinkInfo": {
        "type": "object",
        "properties": {
          "token": {
            "description": "Yalnızca oluşturma yanıtında, bir kez",
            "type": "string"
          },
          "url": {
            "description": "Yalnızca oluşturma yanıtında, bir kez",
            "type": "string",
            "format": "uri"
          },
          "expiresAt": {
            "type": "string",
            "description": "ISO 8601 zaman, UTC"
          }
        },
        "required": [
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^key_[0-9a-f]{32}$"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string",
            "description": "\"kvd_\" + ilk 8 karakter"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "drive:read",
                "drive:write",
                "drive:share"
              ]
            }
          },
          "folderId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "folderName": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "ISO 8601 zaman, UTC"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "ISO 8601 zaman, UTC"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601 zaman, UTC"
          },
          "expired": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "scopes",
          "folderId",
          "expiresAt",
          "lastUsedAt",
          "createdAt",
          "expired"
        ],
        "additionalProperties": false
      },
      "CreatedApiKey": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/ApiKey"
          },
          "token": {
            "type": "string",
            "description": "Düz anahtar (kvd_…). YALNIZCA bu yanıtta, bir kez"
          }
        },
        "required": [
          "key",
          "token"
        ],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "bad_request",
                  "unauthorized",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "name_conflict",
                  "quota_exceeded",
                  "too_large",
                  "unsupported_media",
                  "size_mismatch",
                  "rate_limited",
                  "idempotency_mismatch",
                  "internal"
                ]
              },
              "message": {
                "type": "string",
                "description": "İnsan için, Türkçe; değişebilir"
              },
              "requestId": {
                "description": "X-Request-Id ile aynı",
                "type": "string"
              },
              "suggestion": {
                "description": "name_conflict: önerilen boş ad",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "CreateFolderInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "parentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateNodeInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "parentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "pinned": {
            "type": "boolean"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "link",
              "public"
            ]
          }
        }
      },
      "StartUploadInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "sizeBytes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "pattern": "^\\d{1,19}$"
              }
            ]
          },
          "mimeType": {
            "type": "string",
            "maxLength": 255
          },
          "parentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "sourceApp": {
            "type": "string",
            "enum": [
              "drive",
              "voice",
              "katalog",
              "api"
            ]
          },
          "sourceRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "checksum": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          }
        },
        "required": [
          "name",
          "sizeBytes"
        ]
      },
      "RefreshPartsInput": {
        "type": "object",
        "properties": {
          "partNumbers": {
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000
            }
          }
        },
        "required": [
          "partNumbers"
        ]
      },
      "AddShareInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "role": {
            "type": "string",
            "enum": [
              "VIEWER",
              "EDITOR"
            ]
          }
        },
        "required": [
          "email",
          "role"
        ]
      },
      "UpdateShareInput": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "VIEWER",
              "EDITOR"
            ]
          }
        },
        "required": [
          "role"
        ]
      },
      "CreateLinkInput": {
        "type": "object",
        "properties": {
          "days": {
            "anyOf": [
              {
                "type": "number",
                "const": 1
              },
              {
                "type": "number",
                "const": 7
              },
              {
                "type": "number",
                "const": 30
              }
            ]
          }
        },
        "required": [
          "days"
        ]
      },
      "CreateApiKeyInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60
          },
          "scopes": {
            "minItems": 1,
            "maxItems": 3,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "drive:read",
                "drive:write",
                "drive:share"
              ]
            }
          },
          "folderId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresInDays": {
            "default": 365,
            "anyOf": [
              {
                "type": "number",
                "const": 30
              },
              {
                "type": "number",
                "const": 90
              },
              {
                "type": "number",
                "const": 365
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "scopes"
        ]
      }
    }
  }
}
