{
  "openapi": "3.1.0",
  "info": {
    "title": "Fitbilet Entegrasyon API",
    "version": "1",
    "description": "Turnike/salon yazılımı (stüdyo anahtarı), İK sistemi (şirket anahtarı) ve ortak uygulama (ortak anahtarı) için sunucudan sunucuya API. v1 içinde yalnız ekleme yapılır: yanıtlara yeni alan, enum alanlarına yeni değer gelebilir. Ayrıntılı rehber: gelistirici.html."
  },
  "servers": [
    {
      "url": "{apiUrl}",
      "description": "API adresi",
      "variables": {
        "apiUrl": {
          "default": "http://localhost:4000",
          "description": "Canlı API adresi size ayrıca bildirilir."
        }
      }
    }
  ],
  "tags": [
    {
      "name": "studio",
      "description": "Turnike ve salon yazılımı (stüdyo anahtarı)"
    },
    {
      "name": "company",
      "description": "İK sistemi (şirket anahtarı)"
    },
    {
      "name": "partner",
      "description": "Ortak uygulama (ortak anahtarı)"
    },
    {
      "name": "webhook",
      "description": "Stüdyoya gönderilen olaylar"
    }
  ],
  "paths": {
    "/v1/integration/me": {
      "get": {
        "operationId": "getIntegrationMe",
        "tags": [
          "studio"
        ],
        "summary": "Anahtarın sahibi",
        "description": "Anahtarın türünü ve bağlı stüdyoyu döndürür. Kurulumda bağlantıyı denemek için kullanın.",
        "security": [
          {
            "studioKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IntegrationMe"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `studio_not_active`. `forbidden`: anahtar stüdyo anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/studio/checkins": {
      "post": {
        "operationId": "createStudioCheckin",
        "tags": [
          "studio"
        ],
        "summary": "QR ile giriş",
        "description": "Üyenin uygulamada gösterdiği QR kodunun içeriği (`token`) gönderilir. `result` `checked_in` (yeni giriş) ya da `already_checked_in` (bu rezervasyon daha önce okutuldu, hiçbir şey değişmedi) olur; ikisi de 200 döner.",
        "security": [
          {
            "studioKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationCheckinBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CheckinResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`, `malformed_request`, `checkin_token_invalid`, `checkin_token_expired`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `studio_not_active`. `forbidden`: anahtar stüdyo anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Bulunamadı: `not_found`. Rezervasyon bu stüdyoda yok (başka stüdyonun kodu).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Durum çakışması: `booking_not_reserved`, `checkin_window_closed`. `booking_not_reserved` için `details.status` rezervasyonun durumudur.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/studio/bookings/{bookingId}/checkin": {
      "post": {
        "operationId": "createStudioManualCheckin",
        "tags": [
          "studio"
        ],
        "summary": "Rezervasyon kimliğiyle elle giriş",
        "description": "QR okunamadığında katılımcı listesinden seçilen rezervasyon için giriş. Gövde isteğe bağlıdır. Giriş penceresi ders bitene kadar açık kalır.",
        "security": [
          {
            "studioKey": []
          }
        ],
        "parameters": [
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationManualCheckinBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CheckinResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`, `malformed_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `studio_not_active`. `forbidden`: anahtar stüdyo anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Bulunamadı: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Durum çakışması: `booking_not_reserved`, `checkin_window_closed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/studio/sessions": {
      "get": {
        "operationId": "listStudioSessions",
        "tags": [
          "studio"
        ],
        "summary": "Seanslar",
        "description": "`[from, to)` aralığında başlayan seanslar (en çok 14 gün), başlangıç sırasıyla. Sayfalı değildir.",
        "security": [
          {
            "studioKey": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/IntegrationSession"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`. `to_before_from` ya da `range_too_long` alanı `to` altında döner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `studio_not_active`. `forbidden`: anahtar stüdyo anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/studio/sessions/{sessionId}/roster": {
      "get": {
        "operationId": "getStudioSessionRoster",
        "tags": [
          "studio"
        ],
        "summary": "Seansın katılımcı listesi",
        "description": "Yalnız ad ve durum; iletişim bilgisi ve kullanıcı kimliği dönmez. İptal edilen rezervasyonlar listede yoktur.",
        "security": [
          {
            "studioKey": []
          }
        ],
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Roster"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `studio_not_active`. `forbidden`: anahtar stüdyo anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Bulunamadı: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/company/employees": {
      "get": {
        "operationId": "listCompanyEmployees",
        "tags": [
          "company"
        ],
        "summary": "Çalışan listesi",
        "description": "Canlı liste, imleçli sayfa. `page.nextCursor` null ise son sayfadır.",
        "security": [
          {
            "companyKey": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CompanyEmployee"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/PageInfo"
                    }
                  },
                  "required": [
                    "data",
                    "page"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `company_not_active`. `forbidden`: anahtar şirket anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "addCompanyEmployees",
        "tags": [
          "company"
        ],
        "summary": "Çalışan ekle",
        "description": "En çok 500 e-posta. `notAdded` yalnız koltuk sınırını aşan e-postaların sayısıdır.",
        "security": [
          {
            "companyKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddEmployeesBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IntegrationAddEmployeesResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`, `malformed_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `company_not_active`. `forbidden`: anahtar şirket anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/company/employees/sync": {
      "post": {
        "operationId": "syncCompanyEmployees",
        "tags": [
          "company"
        ],
        "summary": "Listeyi eşitle",
        "description": "Gönderilen liste canlı listenin yeni hâlidir: eksikler çıkarılır, yeniler eklenir. `dryRun: true` yalnız sayıları döndürür. Aynı liste ikinci kez gönderilirse hiçbir şey değişmez.",
        "security": [
          {
            "companyKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationSyncBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/IntegrationSyncResult"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`, `malformed_request`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `company_not_active`. `forbidden`: anahtar şirket anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Durum çakışması: `large_removal_requires_confirmation`, `invalid_lines_require_confirmation`. Büyük çıkarma (`details.toRemove`, `details.threshold`) için `allowLargeRemoval: true`; geçersiz satır varken çıkarma (`details.invalid`, `details.invalidLines`, `details.toRemove`) için `allowInvalidLines: true` gerekir.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Gövde çok büyük: `payload_too_large`. Gövde 1 MiB sınırını aşıyor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/company/employees/{employeeId}": {
      "delete": {
        "operationId": "removeCompanyEmployee",
        "tags": [
          "company"
        ],
        "summary": "Çalışanı çıkar",
        "description": "Listedeki kaydın `id` değeriyle.",
        "security": [
          {
            "companyKey": []
          }
        ],
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Ok"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `company_not_active`. `forbidden`: anahtar şirket anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Bulunamadı: `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/company/usage": {
      "get": {
        "operationId": "getCompanyUsage",
        "tags": [
          "company"
        ],
        "summary": "Aylık toplu kullanım",
        "description": "Kişi bazlı veri yoktur. Bağlı çalışan ya da o ay katılan kişi 5'ten azsa `activeMembers` ve `totalCheckins` null, `suppressed` true olur.",
        "security": [
          {
            "companyKey": []
          }
        ],
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(20\\d{2})-(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CompanyUsage"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `company_not_active`. `forbidden`: anahtar şirket anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/partner/studios": {
      "get": {
        "operationId": "listPartnerStudios",
        "tags": [
          "partner"
        ],
        "summary": "Stüdyo kataloğu",
        "description": "Onaylı stüdyoların herkese açık alanları, ad sırasıyla; `deepLink` uygulamada stüdyoyu açar.",
        "security": [
          {
            "partnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CatalogStudio"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/PageInfo"
                    }
                  },
                  "required": [
                    "data",
                    "page"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `partner_not_active`. `forbidden`: anahtar ortak uygulama anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/partner/sessions": {
      "get": {
        "operationId": "listPartnerSessions",
        "tags": [
          "partner"
        ],
        "summary": "Seans kataloğu",
        "description": "`[from, to)` aralığındaki (en çok 14 gün) gelecekteki planlı seanslar; `deepLink` uygulamada seansı açar.",
        "security": [
          {
            "partnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "studioId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CatalogSession"
                      }
                    },
                    "page": {
                      "$ref": "#/components/schemas/PageInfo"
                    }
                  },
                  "required": [
                    "data",
                    "page"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `partner_not_active`. `forbidden`: anahtar ortak uygulama anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/partner/report": {
      "get": {
        "operationId": "getPartnerReport",
        "tags": [
          "partner"
        ],
        "summary": "Aylık yönlendirme raporu",
        "description": "Ay içinde davet kodunuzla gelen doğrulanmış kayıtlar ve ilk ödemeler (Europe/Istanbul). 5'in altındaki sayılar null olur.",
        "security": [
          {
            "partnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(20\\d{2})-(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Başarılı",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PartnerReport"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Geçersiz istek: `validation_error`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Anahtar geçersiz: `invalid_api_key`. Eksik, bozuk, bilinmeyen ya da iptal edilmiş anahtar; hangisi olduğu söylenmez.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Yetki yok: `forbidden`, `partner_not_active`. `forbidden`: anahtar ortak uygulama anahtarı değil.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Hız sınırı: `rate_limited`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Yeniden denemeden önce beklenecek saniye.",
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "booking.created": {
      "post": {
        "operationId": "webhook_booking_created",
        "tags": [
          "webhook"
        ],
        "summary": "Yeni rezervasyon",
        "description": "Fitbilet, stüdyonun kaydettiği HTTPS adresine gönderir. 2xx dışındaki yanıt ya da 5 saniyeyi aşan bekleme başarısız sayılır; yönlendirme izlenmez.",
        "parameters": [
          {
            "name": "Fitbilet-Event",
            "in": "header",
            "required": true,
            "description": "Olay türü (gövdedeki `type` ile aynı).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Fitbilet-Delivery",
            "in": "header",
            "required": true,
            "description": "Teslim kimliği. Yeniden denemelerde aynıdır; tekilleştirme için gövdedeki `id` (olay kimliği) ya da bu değer kullanılır.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Fitbilet-Signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix saniye>,v1=<hex>`; v1 = HMAC-SHA256(imza sırrı, \"<t>.<ham gövde>\"). Sabit zamanlı karşılaştırın, 5 dakikadan eski `t` değerini reddedin.",
            "schema": {
              "type": "string",
              "pattern": "^t=\\d+,v1=[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookBookingCreatedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Alındı. Gövde okunmaz."
          }
        }
      }
    },
    "booking.cancelled": {
      "post": {
        "operationId": "webhook_booking_cancelled",
        "tags": [
          "webhook"
        ],
        "summary": "Rezervasyon iptali",
        "description": "Fitbilet, stüdyonun kaydettiği HTTPS adresine gönderir. 2xx dışındaki yanıt ya da 5 saniyeyi aşan bekleme başarısız sayılır; yönlendirme izlenmez.",
        "parameters": [
          {
            "name": "Fitbilet-Event",
            "in": "header",
            "required": true,
            "description": "Olay türü (gövdedeki `type` ile aynı).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Fitbilet-Delivery",
            "in": "header",
            "required": true,
            "description": "Teslim kimliği. Yeniden denemelerde aynıdır; tekilleştirme için gövdedeki `id` (olay kimliği) ya da bu değer kullanılır.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Fitbilet-Signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix saniye>,v1=<hex>`; v1 = HMAC-SHA256(imza sırrı, \"<t>.<ham gövde>\"). Sabit zamanlı karşılaştırın, 5 dakikadan eski `t` değerini reddedin.",
            "schema": {
              "type": "string",
              "pattern": "^t=\\d+,v1=[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookBookingCancelledEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Alındı. Gövde okunmaz."
          }
        }
      }
    },
    "checkin.created": {
      "post": {
        "operationId": "webhook_checkin_created",
        "tags": [
          "webhook"
        ],
        "summary": "Giriş (QR, elle ya da cihaz)",
        "description": "Fitbilet, stüdyonun kaydettiği HTTPS adresine gönderir. 2xx dışındaki yanıt ya da 5 saniyeyi aşan bekleme başarısız sayılır; yönlendirme izlenmez.",
        "parameters": [
          {
            "name": "Fitbilet-Event",
            "in": "header",
            "required": true,
            "description": "Olay türü (gövdedeki `type` ile aynı).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Fitbilet-Delivery",
            "in": "header",
            "required": true,
            "description": "Teslim kimliği. Yeniden denemelerde aynıdır; tekilleştirme için gövdedeki `id` (olay kimliği) ya da bu değer kullanılır.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Fitbilet-Signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix saniye>,v1=<hex>`; v1 = HMAC-SHA256(imza sırrı, \"<t>.<ham gövde>\"). Sabit zamanlı karşılaştırın, 5 dakikadan eski `t` değerini reddedin.",
            "schema": {
              "type": "string",
              "pattern": "^t=\\d+,v1=[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCheckinCreatedEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Alındı. Gövde okunmaz."
          }
        }
      }
    },
    "session.cancelled": {
      "post": {
        "operationId": "webhook_session_cancelled",
        "tags": [
          "webhook"
        ],
        "summary": "Seans iptali",
        "description": "Fitbilet, stüdyonun kaydettiği HTTPS adresine gönderir. 2xx dışındaki yanıt ya da 5 saniyeyi aşan bekleme başarısız sayılır; yönlendirme izlenmez.",
        "parameters": [
          {
            "name": "Fitbilet-Event",
            "in": "header",
            "required": true,
            "description": "Olay türü (gövdedeki `type` ile aynı).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Fitbilet-Delivery",
            "in": "header",
            "required": true,
            "description": "Teslim kimliği. Yeniden denemelerde aynıdır; tekilleştirme için gövdedeki `id` (olay kimliği) ya da bu değer kullanılır.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Fitbilet-Signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix saniye>,v1=<hex>`; v1 = HMAC-SHA256(imza sırrı, \"<t>.<ham gövde>\"). Sabit zamanlı karşılaştırın, 5 dakikadan eski `t` değerini reddedin.",
            "schema": {
              "type": "string",
              "pattern": "^t=\\d+,v1=[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSessionCancelledEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Alındı. Gövde okunmaz."
          }
        }
      }
    },
    "ping": {
      "post": {
        "operationId": "webhook_ping",
        "tags": [
          "webhook"
        ],
        "summary": "Deneme (paneldeki \"Dene\" düğmesi)",
        "description": "Fitbilet, stüdyonun kaydettiği HTTPS adresine gönderir. 2xx dışındaki yanıt ya da 5 saniyeyi aşan bekleme başarısız sayılır; yönlendirme izlenmez.",
        "parameters": [
          {
            "name": "Fitbilet-Event",
            "in": "header",
            "required": true,
            "description": "Olay türü (gövdedeki `type` ile aynı).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Fitbilet-Delivery",
            "in": "header",
            "required": true,
            "description": "Teslim kimliği. Yeniden denemelerde aynıdır; tekilleştirme için gövdedeki `id` (olay kimliği) ya da bu değer kullanılır.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Fitbilet-Signature",
            "in": "header",
            "required": true,
            "description": "`t=<unix saniye>,v1=<hex>`; v1 = HMAC-SHA256(imza sırrı, \"<t>.<ham gövde>\"). Sabit zamanlı karşılaştırın, 5 dakikadan eski `t` değerini reddedin.",
            "schema": {
              "type": "string",
              "pattern": "^t=\\d+,v1=[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPingEvent"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Alındı. Gövde okunmaz."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "studioKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Stüdyo anahtarı: `Authorization: Bearer stk_<önek>_<sır>`."
      },
      "companyKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Şirket anahtarı: `Authorization: Bearer stk_<önek>_<sır>`."
      },
      "partnerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Ortak uygulama anahtarı: `Authorization: Bearer stk_<önek>_<sır>`."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {}
              }
            },
            "required": [
              "code"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Ok": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "ok"
        ]
      },
      "PageInfo": {
        "type": "object",
        "properties": {
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "nextCursor"
        ]
      },
      "IntegrationMe": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "studio",
              "company",
              "partner"
            ]
          },
          "studio": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "kind",
          "studio"
        ]
      },
      "CheckinResult": {
        "type": "object",
        "properties": {
          "result": {
            "type": "string",
            "enum": [
              "checked_in",
              "already_checked_in"
            ]
          },
          "bookingId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "memberName": {
            "type": [
              "string",
              "null"
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "qr",
              "manual",
              "device"
            ]
          },
          "checkedInAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "result",
          "bookingId",
          "sessionId",
          "memberName",
          "method",
          "checkedInAt"
        ]
      },
      "IntegrationSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "durationMinutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "cancelled",
              "completed"
            ]
          },
          "capacity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "reserved": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "attended": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "title",
          "startsAt",
          "durationMinutes",
          "status",
          "capacity",
          "reserved",
          "attended"
        ]
      },
      "Roster": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "capacity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "reserved": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "attended": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "entries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "bookingId": {
                  "type": "string",
                  "format": "uuid"
                },
                "memberName": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "reserved",
                    "cancelled",
                    "attended",
                    "no_show"
                  ]
                },
                "checkedInAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "checkinMethod": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "qr",
                        "manual",
                        "device"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "bookedAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "bookingId",
                "memberName",
                "status",
                "checkedInAt",
                "checkinMethod",
                "bookedAt"
              ]
            }
          }
        },
        "required": [
          "sessionId",
          "capacity",
          "reserved",
          "attended",
          "entries"
        ]
      },
      "CompanyEmployee": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "waiting",
              "joined"
            ]
          },
          "addedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "email",
          "state",
          "addedAt"
        ]
      },
      "IntegrationAddEmployeesResult": {
        "type": "object",
        "properties": {
          "added": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reactivated": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "alreadyPresent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "invalid": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "notAdded": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "invalidLines": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          }
        },
        "required": [
          "added",
          "reactivated",
          "alreadyPresent",
          "invalid",
          "notAdded",
          "invalidLines"
        ]
      },
      "IntegrationSyncResult": {
        "type": "object",
        "properties": {
          "toAdd": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "toRemove": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "unchanged": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "invalid": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "invalidLines": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            }
          },
          "largeRemoval": {
            "type": "boolean"
          },
          "applied": {
            "type": "boolean"
          },
          "added": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "reactivated": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "removed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "notAdded": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "toAdd",
          "toRemove",
          "unchanged",
          "invalid",
          "invalidLines",
          "largeRemoval",
          "applied",
          "added",
          "reactivated",
          "removed",
          "notAdded"
        ]
      },
      "CompanyUsage": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "pattern": "^(20\\d{2})-(0[1-9]|1[0-2])$"
          },
          "employeeCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "joinedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "activeMembers": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "totalCheckins": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "suppressed": {
            "type": "boolean"
          }
        },
        "required": [
          "month",
          "employeeCount",
          "joinedCount",
          "activeMembers",
          "totalCheckins",
          "suppressed"
        ]
      },
      "CatalogStudio": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "district": {
            "type": [
              "string",
              "null"
            ]
          },
          "logoUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "coverUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "deepLink": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "city",
          "district",
          "logoUrl",
          "coverUrl",
          "deepLink"
        ]
      },
      "CatalogSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "studioId": {
            "type": "string",
            "format": "uuid"
          },
          "studioName": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "startsAt": {
            "type": "string",
            "format": "date-time"
          },
          "durationMinutes": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "creditCost": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "remainingCapacity": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "city": {
            "type": "string"
          },
          "district": {
            "type": [
              "string",
              "null"
            ]
          },
          "deepLink": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "studioId",
          "studioName",
          "title",
          "category",
          "startsAt",
          "durationMinutes",
          "creditCost",
          "remainingCapacity",
          "city",
          "district",
          "deepLink"
        ]
      },
      "PartnerReport": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "pattern": "^(20\\d{2})-(0[1-9]|1[0-2])$"
          },
          "signups": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "firstPurchases": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "suppressed": {
            "type": "boolean"
          }
        },
        "required": [
          "month",
          "signups",
          "firstPurchases",
          "suppressed"
        ]
      },
      "WebhookBookingCreatedData": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionStartsAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "const": "reserved"
          }
        },
        "required": [
          "bookingId",
          "sessionId",
          "sessionStartsAt",
          "status"
        ]
      },
      "WebhookBookingCancelledData": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionStartsAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "const": "cancelled"
          },
          "reason": {
            "type": "string",
            "enum": [
              "member",
              "member_late",
              "session_cancelled"
            ]
          },
          "cancelledBy": {
            "type": "string",
            "enum": [
              "member",
              "studio",
              "admin",
              "system"
            ]
          },
          "cancelledAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "bookingId",
          "sessionId",
          "sessionStartsAt",
          "status",
          "reason",
          "cancelledBy",
          "cancelledAt"
        ]
      },
      "WebhookCheckinCreatedData": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionStartsAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "const": "attended"
          },
          "method": {
            "type": "string",
            "enum": [
              "qr",
              "manual",
              "device"
            ]
          },
          "checkedInAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "bookingId",
          "sessionId",
          "sessionStartsAt",
          "status",
          "method",
          "checkedInAt"
        ]
      },
      "WebhookSessionCancelledData": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "sessionStartsAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "const": "cancelled"
          },
          "cancelledBy": {
            "type": "string",
            "enum": [
              "member",
              "studio",
              "admin",
              "system"
            ]
          },
          "cancelledAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "sessionId",
          "sessionStartsAt",
          "status",
          "cancelledBy",
          "cancelledAt"
        ]
      },
      "WebhookPingData": {
        "type": "object",
        "properties": {
          "endpointId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "endpointId"
        ]
      },
      "WebhookEvent": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/WebhookBookingCreatedEvent"
          },
          {
            "$ref": "#/components/schemas/WebhookBookingCancelledEvent"
          },
          {
            "$ref": "#/components/schemas/WebhookCheckinCreatedEvent"
          },
          {
            "$ref": "#/components/schemas/WebhookSessionCancelledEvent"
          },
          {
            "$ref": "#/components/schemas/WebhookPingEvent"
          }
        ]
      },
      "WebhookBookingCreatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "studioId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "booking.created"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookBookingCreatedData"
          }
        },
        "required": [
          "id",
          "createdAt",
          "studioId",
          "type",
          "data"
        ]
      },
      "WebhookBookingCancelledEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "studioId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "booking.cancelled"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookBookingCancelledData"
          }
        },
        "required": [
          "id",
          "createdAt",
          "studioId",
          "type",
          "data"
        ]
      },
      "WebhookCheckinCreatedEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "studioId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "checkin.created"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookCheckinCreatedData"
          }
        },
        "required": [
          "id",
          "createdAt",
          "studioId",
          "type",
          "data"
        ]
      },
      "WebhookSessionCancelledEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "studioId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "session.cancelled"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookSessionCancelledData"
          }
        },
        "required": [
          "id",
          "createdAt",
          "studioId",
          "type",
          "data"
        ]
      },
      "WebhookPingEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "studioId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "type": "string",
            "const": "ping"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookPingData"
          }
        },
        "required": [
          "id",
          "createdAt",
          "studioId",
          "type",
          "data"
        ]
      },
      "IntegrationCheckinBody": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 20,
            "maxLength": 2048,
            "pattern": "^[A-Za-z0-9_.-]+$"
          },
          "device": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "pattern": "^[\\p{L}\\p{N} ._#:/()-]+$"
          }
        },
        "required": [
          "token"
        ],
        "additionalProperties": false
      },
      "IntegrationManualCheckinBody": {
        "type": "object",
        "properties": {
          "device": {
            "type": "string",
            "minLength": 1,
            "maxLength": 60,
            "pattern": "^[\\p{L}\\p{N} ._#:/()-]+$"
          }
        },
        "additionalProperties": false
      },
      "AddEmployeesBody": {
        "type": "object",
        "properties": {
          "emails": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 320
            }
          }
        },
        "required": [
          "emails"
        ],
        "additionalProperties": false
      },
      "IntegrationSyncBody": {
        "type": "object",
        "properties": {
          "emails": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 320
            }
          },
          "dryRun": {
            "type": "boolean"
          },
          "allowLargeRemoval": {
            "type": "boolean"
          },
          "allowInvalidLines": {
            "type": "boolean"
          }
        },
        "required": [
          "emails"
        ],
        "additionalProperties": false
      }
    }
  }
}
