openapi: 3.0.3
info:
  title: PratikYedek API
  description: KVKK uyumlu, uçtan uca şifrelenmiş Türkiye bulut yedekleme API
  version: 0.1.0
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas: {}
paths:
  /v1/health:
    get:
      summary: Liveness probe — public, no auth
      tags:
        - system
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                  service:
                    type: string
                    enum:
                      - pratikyedek-api
                  version:
                    type: string
                  timestamp:
                    type: string
                required:
                  - status
                  - service
                  - version
                  - timestamp
                additionalProperties: false
  /v1/version:
    get:
      summary: API version info
      tags:
        - system
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  service:
                    type: string
                    enum:
                      - pratikyedek-api
                  version:
                    type: string
                  node_env:
                    type: string
                required:
                  - service
                  - version
                  - node_env
                additionalProperties: false
  /v1/status:
    get:
      summary: Component status — public, no auth (status page tüketir)
      tags:
        - system
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                      - degraded
                      - down
                  service:
                    type: string
                    enum:
                      - pratikyedek-api
                  version:
                    type: string
                  timestamp:
                    type: string
                  components:
                    type: object
                    properties:
                      api:
                        type: object
                        properties:
                          status:
                            type: string
                            enum:
                              - ok
                              - degraded
                              - down
                              - unknown
                          latency_ms:
                            type: number
                        required:
                          - status
                        additionalProperties: false
                      db:
                        type: object
                        properties:
                          status:
                            type: string
                            enum:
                              - ok
                              - degraded
                              - down
                              - unknown
                          latency_ms:
                            type: number
                          error:
                            type: string
                        required:
                          - status
                        additionalProperties: false
                      redis:
                        type: object
                        properties:
                          status:
                            type: string
                            enum:
                              - ok
                              - degraded
                              - down
                              - unknown
                          latency_ms:
                            type: number
                          error:
                            type: string
                        required:
                          - status
                        additionalProperties: false
                    required:
                      - api
                      - db
                      - redis
                    additionalProperties: false
                required:
                  - status
                  - service
                  - version
                  - timestamp
                  - components
                additionalProperties: false
        "503":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - ok
                      - degraded
                      - down
                  service:
                    type: string
                    enum:
                      - pratikyedek-api
                  version:
                    type: string
                  timestamp:
                    type: string
                  components:
                    type: object
                    properties:
                      api:
                        type: object
                        properties:
                          status:
                            type: string
                            enum:
                              - ok
                              - degraded
                              - down
                              - unknown
                          latency_ms:
                            type: number
                        required:
                          - status
                        additionalProperties: false
                      db:
                        type: object
                        properties:
                          status:
                            type: string
                            enum:
                              - ok
                              - degraded
                              - down
                              - unknown
                          latency_ms:
                            type: number
                          error:
                            type: string
                        required:
                          - status
                        additionalProperties: false
                      redis:
                        type: object
                        properties:
                          status:
                            type: string
                            enum:
                              - ok
                              - degraded
                              - down
                              - unknown
                          latency_ms:
                            type: number
                          error:
                            type: string
                        required:
                          - status
                        additionalProperties: false
                    required:
                      - api
                      - db
                      - redis
                    additionalProperties: false
                required:
                  - status
                  - service
                  - version
                  - timestamp
                  - components
                additionalProperties: false
  /v1/auth/register:
    post:
      summary: Yeni hesap ve ilk kullanıcı oluşturur (Argon2id parola hash)
      tags:
        - auth
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  maxLength: 254
                password:
                  type: string
                  minLength: 12
                  maxLength: 200
                  allOf:
                    - pattern: "[A-Z]"
                    - pattern: "[a-z]"
                    - pattern: "[0-9]"
                account_type:
                  type: string
                  enum:
                    - individual
                    - business
                    - accountant
                    - enterprise
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
                display_name:
                  type: string
                  minLength: 1
                  maxLength: 200
                kvkk_consent:
                  type: boolean
                  enum:
                    - true
                kvkk_consent_version:
                  type: string
                  minLength: 1
                  maxLength: 20
                marketing_consent:
                  type: boolean
                locale:
                  type: string
                  minLength: 2
                  maxLength: 10
              required:
                - email
                - password
                - account_type
                - name
                - kvkk_consent
                - kvkk_consent_version
              additionalProperties: false
        required: true
      responses:
        "201":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  user_id:
                    type: string
                    pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                  account_id:
                    type: string
                    pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                  verification_required:
                    type: boolean
                    enum:
                      - true
                required:
                  - user_id
                  - account_id
                  - verification_required
                additionalProperties: false
  /v1/auth/login:
    post:
      summary: E-posta + parola (+ opsiyonel TOTP) ile oturum açar
      tags:
        - auth
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  maxLength: 254
                password:
                  type: string
                  minLength: 1
                  maxLength: 200
                totp_code:
                  type: string
                  pattern: ^\d{6}$
                backup_code:
                  type: string
                  minLength: 4
                  maxLength: 40
              required:
                - email
                - password
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  expires_in:
                    type: number
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                        pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                      email:
                        type: string
                      name:
                        type: string
                      role:
                        type: string
                        enum:
                          - owner
                          - admin
                          - member
                      totp_enabled:
                        type: boolean
                    required:
                      - id
                      - email
                      - name
                      - role
                      - totp_enabled
                    additionalProperties: false
                  account:
                    type: object
                    properties:
                      id:
                        type: string
                        pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                      account_type:
                        type: string
                        enum:
                          - individual
                          - business
                          - accountant
                          - enterprise
                      display_name:
                        type: string
                      density_mode:
                        type: string
                        enum:
                          - comfort
                          - pro
                      locale:
                        type: string
                    required:
                      - id
                      - account_type
                      - display_name
                      - density_mode
                      - locale
                    additionalProperties: false
                required:
                  - access_token
                  - expires_in
                  - user
                  - account
                additionalProperties: false
  /v1/auth/logout:
    post:
      summary: Refresh cookie'yi siler ve session'ı revoke eder
      tags:
        - auth
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                required:
                  - ok
                additionalProperties: false
  /v1/auth/refresh:
    post:
      summary: Refresh token rotation — eski token geri verirse tüm aile invalidate olur
      tags:
        - auth
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  expires_in:
                    type: number
                required:
                  - access_token
                  - expires_in
                additionalProperties: false
  /v1/auth/2fa/setup:
    post:
      summary: 2FA TOTP secret üret + 8 backup code
      tags:
        - auth
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  secret:
                    type: string
                  qr_url:
                    type: string
                  backup_codes:
                    type: array
                    items:
                      type: string
                    minItems: 8
                    maxItems: 8
                required:
                  - secret
                  - qr_url
                  - backup_codes
                additionalProperties: false
  /v1/auth/2fa/verify:
    post:
      summary: 2FA TOTP kodu doğrula ve aktive et
      tags:
        - auth
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                totp_code:
                  type: string
                  pattern: ^\d{6}$
              required:
                - totp_code
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                required:
                  - ok
                additionalProperties: false
  /v1/auth/2fa/disable:
    post:
      summary: 2FA devre dışı bırak (parola + TOTP zorunlu)
      tags:
        - auth
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  minLength: 1
                  maxLength: 200
                totp_code:
                  type: string
                  pattern: ^\d{6}$
              required:
                - password
                - totp_code
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                required:
                  - ok
                additionalProperties: false
  /v1/auth/magic-link:
    post:
      summary: Tek-kullanımlık giriş bağlantısı gönder
      tags:
        - auth
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                  maxLength: 254
              required:
                - email
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                required:
                  - ok
                additionalProperties: false
  /v1/auth/magic-link/{token}:
    get:
      summary: Magic link token doğrula → access + refresh tokens
      tags:
        - auth
      parameters:
        - schema:
            type: string
            minLength: 8
            maxLength: 200
          in: path
          name: token
          required: true
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                  expires_in:
                    type: number
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                        pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                      email:
                        type: string
                      name:
                        type: string
                      role:
                        type: string
                        enum:
                          - owner
                          - admin
                          - member
                      totp_enabled:
                        type: boolean
                    required:
                      - id
                      - email
                      - name
                      - role
                      - totp_enabled
                    additionalProperties: false
                  account:
                    type: object
                    properties:
                      id:
                        type: string
                        pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                      account_type:
                        type: string
                        enum:
                          - individual
                          - business
                          - accountant
                          - enterprise
                      display_name:
                        type: string
                      density_mode:
                        type: string
                        enum:
                          - comfort
                          - pro
                      locale:
                        type: string
                    required:
                      - id
                      - account_type
                      - display_name
                      - density_mode
                      - locale
                    additionalProperties: false
                required:
                  - access_token
                  - expires_in
                  - user
                  - account
                additionalProperties: false
  /v1/users/me/change-password:
    post:
      summary: Parola değiştir — tüm session'lar revoke edilir
      tags:
        - users
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                current_password:
                  type: string
                  minLength: 1
                  maxLength: 200
                new_password:
                  type: string
                  minLength: 12
                  maxLength: 200
                  allOf:
                    - pattern: "[A-Z]"
                    - pattern: "[a-z]"
                    - pattern: "[0-9]"
              required:
                - current_password
                - new_password
              additionalProperties: false
        required: true
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                  reauth_required:
                    type: boolean
                    enum:
                      - true
                required:
                  - ok
                  - reauth_required
                additionalProperties: false
  /v1/snapshots/:
    post:
      summary: Yeni yedek meta kaydı oluşturur
      tags:
        - snapshots
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                musavir_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                mukellef_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                source_path:
                  type: string
                  minLength: 1
                  maxLength: 4096
                source_host:
                  type: string
                  maxLength: 200
                document_year:
                  type: integer
                  minimum: 1900
                  maximum: 2200
                document_type:
                  type: string
                  maxLength: 50
                kopia_repo_id:
                  type: string
                  maxLength: 64
                kopia_snapshot_id:
                  type: string
                  minLength: 1
                  maxLength: 64
                manifest_hash:
                  type: string
                  pattern: ^[a-f0-9]{64}$
                size_original:
                  type: integer
                  format: int64
                  minimum: 0
                size_compressed:
                  type: integer
                  format: int64
                  minimum: 0
                size_deduplicated:
                  type: integer
                  format: int64
                  minimum: 0
                file_count:
                  type: integer
                  minimum: 0
                storage_backend_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                provider_path:
                  type: string
                  minLength: 1
                  maxLength: 2048
                started_at:
                  type: string
                  format: date-time
                completed_at:
                  type: string
                  format: date-time
                metadata:
                  type: object
                  additionalProperties: {}
              required:
                - source_path
                - kopia_snapshot_id
                - manifest_hash
                - size_original
                - size_compressed
                - size_deduplicated
                - file_count
                - provider_path
                - started_at
                - completed_at
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
    get:
      summary: Yedekleri listeler
      tags:
        - snapshots
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: query
          name: musavir_id
          required: false
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: query
          name: mukellef_id
          required: false
        - schema:
            type: integer
            minimum: 1900
            maximum: 2200
          in: query
          name: document_year
          required: false
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: query
          name: storage_backend_id
          required: false
        - schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
            maximum: 100
          in: query
          name: limit
          required: false
      responses:
        "200":
          description: Default Response
  /v1/snapshots/{id}:
    get:
      summary: Yedek detayı
      tags:
        - snapshots
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    delete:
      summary: Yedeği siler (retention süresi içinde 403)
      tags:
        - snapshots
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/snapshots/{id}/upload-url:
    post:
      summary: Yedek için presigned PUT URL üretir
      tags:
        - snapshots
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                  minLength: 1
                  maxLength: 512
                storage_backend_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                expires_in:
                  type: integer
                  minimum: 60
                  maximum: 3600
                content_type:
                  type: string
                  maxLength: 200
              required:
                - key
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/snapshots/{id}/stream:
    put:
      summary: Yedek blob'unu sunucu üzerinden backend'e yükler (presign desteklemeyen
        backend'ler için zorunlu yol).
      tags:
        - snapshots
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    get:
      summary: Yedek blob'unu sunucu üzerinden backend'den indirir (presign
        desteklemeyen backend'ler için zorunlu yol).
      tags:
        - snapshots
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/snapshots/{id}/download-url:
    post:
      summary: Yedek için presigned GET URL üretir
      tags:
        - snapshots
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                  minLength: 1
                  maxLength: 512
                storage_backend_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                expires_in:
                  type: integer
                  minimum: 60
                  maximum: 3600
                content_type:
                  type: string
                  maxLength: 200
              required:
                - key
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/storage/fs/{backendId}/{*}:
    put:
      parameters:
        - schema:
            type: string
          in: path
          name: backendId
          required: true
        - schema:
            type: string
          in: path
          name: "*"
          required: true
      responses:
        "200":
          description: Default Response
    get:
      parameters:
        - schema:
            type: string
          in: path
          name: backendId
          required: true
        - schema:
            type: string
          in: path
          name: "*"
          required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/storage-backends/:
    post:
      summary: Yeni Hosted storage backend ekler
      tags:
        - admin
        - storage-backends
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                provider_type:
                  type: string
                  enum:
                    - filesystem
                    - s3
                    - s3_partner
                    - minio
                    - s3_compat
                    - google_drive
                    - onedrive
                    - yandex
                    - dropbox
                    - webdav
                display_name:
                  type: string
                  minLength: 1
                  maxLength: 200
                config:
                  type: object
                  additionalProperties: {}
                credentials:
                  type: object
                  additionalProperties: {}
                capacity_bytes:
                  type: integer
                  format: int64
                  minimum: 0
                kvkk_jurisdiction:
                  type: string
                  minLength: 2
                  maxLength: 2
                status:
                  type: string
                  enum:
                    - active
                    - paused
                    - draining
                    - archived
                    - auth_expired
                    - quota_exceeded
                    - error
              required:
                - provider_type
                - display_name
                - config
                - credentials
                - kvkk_jurisdiction
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
    get:
      summary: Admin-owned storage backend listesi
      tags:
        - admin
        - storage-backends
      responses:
        "200":
          description: Default Response
  /v1/admin/storage-backends/{id}:
    get:
      summary: Backend detayı (credentials maskeli)
      tags:
        - admin
        - storage-backends
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    patch:
      summary: Backend günceller (display_name, status, capacity, config, credentials)
      tags:
        - admin
        - storage-backends
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                display_name:
                  type: string
                  minLength: 1
                  maxLength: 200
                status:
                  type: string
                  enum:
                    - active
                    - paused
                    - draining
                    - archived
                    - auth_expired
                    - quota_exceeded
                    - error
                capacity_bytes:
                  type: integer
                  format: int64
                  minimum: 0
                  nullable: true
                config:
                  type: object
                  additionalProperties: {}
                credentials:
                  type: object
                  additionalProperties: {}
              additionalProperties: false
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    delete:
      summary: Backend siler (referans varsa archive)
      tags:
        - admin
        - storage-backends
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/storage-backends/{id}/test-connection:
    post:
      summary: Backend bağlantı testi (write/read/unlink probe)
      tags:
        - admin
        - storage-backends
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/storage-backends/{id}/assign:
    post:
      summary: Backend'i account'lara default olarak ata
      tags:
        - admin
        - storage-backends
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                account_ids:
                  type: array
                  items:
                    type: string
                    pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                  minItems: 1
                  maxItems: 1000
                set_as_default:
                  type: boolean
              required:
                - account_ids
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/storage-backends/{id}/usage:
    get:
      summary: Backend kullanım toplamı (snapshot count, size totals, account count)
      tags:
        - admin
        - storage-backends
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/musavirs/:
    get:
      summary: Hesaba bağlı mali müşavir(ler)i listeler
      tags:
        - musavirs
      responses:
        "200":
          description: Default Response
    post:
      summary: Mali müşavir kaydı oluşturur (account_type=accountant, hesap başına 1)
      tags:
        - musavirs
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
                title:
                  type: string
                  enum:
                    - SMMM
                    - YMM
                    - serbest_muhasebeci
                registration_number:
                  type: string
                  maxLength: 50
                chamber:
                  type: string
                  maxLength: 100
                signature_seal_url:
                  type: string
                  format: uri
                  maxLength: 2048
                vekil_musavir_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
              required:
                - name
                - title
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/musavirs/{id}:
    get:
      summary: Mali müşavir detayı (RLS account isolation)
      tags:
        - musavirs
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    patch:
      summary: Mali müşavir günceller
      tags:
        - musavirs
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 200
                title:
                  type: string
                  enum:
                    - SMMM
                    - YMM
                    - serbest_muhasebeci
                registration_number:
                  type: string
                  maxLength: 50
                chamber:
                  type: string
                  maxLength: 100
                signature_seal_url:
                  type: string
                  format: uri
                  maxLength: 2048
                vekil_musavir_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
              additionalProperties: false
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/musavirs/{id}/mukellefs:
    get:
      summary: Müşaviri mükelleflerini listeler (cursor pagination + filter)
      tags:
        - musavirs
        - mukelleflar
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: query
          name: musavir_id
          required: false
        - schema:
            type: string
            enum:
              - gercek_kisi
              - sermaye_sirketi
              - sahis_sirketi
              - kollektif
              - komandit
              - kooperatif
              - dernek
              - vakif
          in: query
          name: mukellef_type
          required: false
        - schema:
            type: string
            enum:
              - "true"
              - "false"
          in: query
          name: active
          required: false
        - schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
            maximum: 100
          in: query
          name: limit
          required: false
        - schema:
            type: string
            minLength: 1
            maxLength: 512
          in: query
          name: cursor
          required: false
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    post:
      summary: Müşaviri için yeni mükellef ekler (KVKK § 6.2 açık rıza beyanı zorunlu)
      tags:
        - musavirs
        - mukelleflar
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tax_id:
                  type: string
                  pattern: ^[0-9]{10,11}$
                legal_name:
                  type: string
                  minLength: 1
                  maxLength: 200
                trade_name:
                  type: string
                  maxLength: 200
                mukellef_type:
                  type: string
                  enum:
                    - gercek_kisi
                    - sermaye_sirketi
                    - sahis_sirketi
                    - kollektif
                    - komandit
                    - kooperatif
                    - dernek
                    - vakif
                contact_email:
                  type: string
                  format: email
                  maxLength: 254
                contact_phone:
                  type: string
                  maxLength: 20
                address:
                  type: string
                  maxLength: 2000
                active_from:
                  type: string
                  format: date-time
                active_until:
                  type: string
                  format: date-time
                storage_backend_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                kvkk_consent_acknowledged:
                  type: boolean
                  enum:
                    - true
                kvkk_consent_doc_url:
                  type: string
                  format: uri
                  maxLength: 2048
                metadata:
                  type: object
                  additionalProperties: {}
              required:
                - tax_id
                - legal_name
                - mukellef_type
                - active_from
                - kvkk_consent_acknowledged
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/mukellefs/{id}:
    get:
      summary: Mükellef detayı (RLS account isolation)
      tags:
        - mukelleflar
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    patch:
      summary: Mükellef günceller (tax_id ve KVKK consent immutable — zod .omit)
      tags:
        - mukelleflar
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                legal_name:
                  type: string
                  minLength: 1
                  maxLength: 200
                trade_name:
                  type: string
                  maxLength: 200
                mukellef_type:
                  type: string
                  enum:
                    - gercek_kisi
                    - sermaye_sirketi
                    - sahis_sirketi
                    - kollektif
                    - komandit
                    - kooperatif
                    - dernek
                    - vakif
                contact_email:
                  type: string
                  format: email
                  maxLength: 254
                contact_phone:
                  type: string
                  maxLength: 20
                address:
                  type: string
                  maxLength: 2000
                active_from:
                  type: string
                  format: date-time
                active_until:
                  type: string
                  format: date-time
                storage_backend_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                kvkk_consent_doc_url:
                  type: string
                  format: uri
                  maxLength: 2048
                metadata:
                  type: object
                  additionalProperties: {}
              additionalProperties: false
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    delete:
      summary: Mükellef silme — KVKK akışı zorunlu (önce /v1/kvkk/deletion-request);
        cooldown sonu worker siler
      tags:
        - mukelleflar
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/mukellefs/{id}/transfer:
    post:
      summary: Mukellefin baska musavire devrini baslatir (Idempotency-Key zorunlu;
        KVKK § 6.2 yeniden onay)
      tags:
        - mukelleflar
        - transfers
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                target_musavir_email:
                  type: string
                  format: email
                  maxLength: 254
                document_year_range:
                  type: array
                  minItems: 2
                  maxItems: 2
                  items:
                    - type: integer
                      minimum: 1900
                      maximum: 2200
                    - type: integer
                      minimum: 1900
                      maximum: 2200
                acknowledgement:
                  type: boolean
                  enum:
                    - true
                note:
                  type: string
                  maxLength: 2000
              required:
                - target_musavir_email
                - acknowledgement
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/audit-shares/:
    get:
      summary: Hesabın oluşturduğu vergi denetimi paylaşımları (RLS isolation)
      tags:
        - audit-shares
      parameters:
        - schema: {}
          in: query
          name: not
        - schema:
            type: string
          in: query
          name: active
          required: false
      responses:
        "200":
          description: Default Response
    post:
      summary: Vergi denetimi paylaşımı oluşturur (Idempotency-Key 24h replay)
      tags:
        - audit-shares
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                mukellef_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                period_start:
                  type: string
                  format: date-time
                period_end:
                  type: string
                  format: date-time
                document_types:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 50
                  minItems: 1
                  maxItems: 20
                auditor_email:
                  type: string
                  format: email
                  maxLength: 254
                auditor_phone:
                  type: string
                  pattern: ^\+?[0-9]{10,15}$
                auditor_name:
                  type: string
                  minLength: 1
                  maxLength: 200
                valid_for_days:
                  type: integer
                  minimum: 1
                  maximum: 30
                include_audit_trail:
                  type: boolean
              required:
                - mukellef_id
                - period_start
                - period_end
                - document_types
                - auditor_email
                - auditor_phone
                - valid_for_days
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/audit-shares/{id}:
    get:
      summary: Paylaşım detayı (RLS isolation; share_token serialize edilmez)
      tags:
        - audit-shares
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/audit-shares/{id}/revoke:
    post:
      summary: Paylaşımı manuel iptal eder (idempotent)
      tags:
        - audit-shares
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/public/audit-shares/verify:
    post:
      summary: Denetçi share_token + SMS OTP doğrulaması; dosya listesi + presigned
        URL döner
      tags:
        - audit-shares
        - public
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                share_token:
                  type: string
                  minLength: 32
                  maxLength: 256
                sms_code:
                  type: string
                  pattern: ^\d{6}$
              required:
                - share_token
                - sms_code
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/kvkk/deletion-request:
    post:
      summary: KVKK m.11 silme talebi olusturur (Idempotency-Key zorunlu, 24h replay;
        30 gun cooldown)
      tags:
        - kvkk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                request_type:
                  type: string
                  enum:
                    - deletion
                    - data_export
                    - rectification
                    - access
                scope:
                  type: object
                  properties:
                    target:
                      type: string
                      enum:
                        - account
                        - mukellefs
                        - period
                    mukellef_ids:
                      type: array
                      items:
                        type: string
                        pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                      maxItems: 1000
                    period_start:
                      type: string
                      format: date-time
                    period_end:
                      type: string
                      format: date-time
                    document_types:
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 50
                  required:
                    - target
                  additionalProperties: false
                acknowledgement:
                  type: boolean
                  enum:
                    - true
                reason:
                  type: string
                  maxLength: 2000
              required:
                - request_type
                - scope
                - acknowledgement
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/kvkk/deletion-requests:
    get:
      summary: Hesabin KVKK taleplerini listeler (RLS isolation)
      tags:
        - kvkk
      responses:
        "200":
          description: Default Response
  /v1/kvkk/deletion-request/{id}:
    get:
      summary: KVKK talebi detay (RLS isolation)
      tags:
        - kvkk
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/kvkk/deletion-request/{id}/cancel:
    post:
      summary: Bekleyen KVKK silme talebini iptal eder (cooldown icinde)
      tags:
        - kvkk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  maxLength: 2000
              additionalProperties: false
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/kvkk/deletion-certificate/{id}:
    get:
      summary: KVKK Silme Sertifikasi presigned download URL (sadece status=completed
        taleplerde)
      tags:
        - kvkk
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/kvkk/data-export-request:
    post:
      summary: "KVKK m.11 veri tasinabilirligi talebi (Faz 4 worker; bu Faz: kayit +
        status=pending)"
      tags:
        - kvkk
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                request_type:
                  type: string
                  enum:
                    - deletion
                    - data_export
                    - rectification
                    - access
                scope:
                  type: object
                  properties:
                    target:
                      type: string
                      enum:
                        - account
                        - mukellefs
                        - period
                    mukellef_ids:
                      type: array
                      items:
                        type: string
                        pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
                      maxItems: 1000
                    period_start:
                      type: string
                      format: date-time
                    period_end:
                      type: string
                      format: date-time
                    document_types:
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 50
                  required:
                    - target
                  additionalProperties: false
                acknowledgement:
                  type: boolean
                  enum:
                    - true
                reason:
                  type: string
                  maxLength: 2000
              required:
                - request_type
                - scope
                - acknowledgement
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/transfers/:
    get:
      summary: Hesabin source veya target oldugu devirler (RLS isolation)
      tags:
        - transfers
      parameters:
        - schema: {}
          in: query
          name: not
        - schema:
            type: string
            enum:
              - pending
              - accepted
              - in_progress
              - completed
              - rejected
              - cancelled
          in: query
          name: status
          required: false
      responses:
        "200":
          description: Default Response
  /v1/transfers/{id}:
    get:
      summary: Devir detayi (source veya target erisebilir)
      tags:
        - transfers
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/transfers/{id}/accept:
    post:
      summary: Target musavir devri kabul eder (KVKK § 6.2 yeniden onay)
      tags:
        - transfers
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                acknowledgement:
                  type: boolean
                  enum:
                    - true
                signature:
                  type: string
                  minLength: 1
                  maxLength: 512
              required:
                - acknowledgement
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/transfers/{id}/reject:
    post:
      summary: Devri reddeder (source veya target)
      tags:
        - transfers
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  maxLength: 2000
              additionalProperties: false
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/transfers/{id}/cancel:
    post:
      summary: Devri iptal eder (sadece source musavir)
      tags:
        - transfers
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  maxLength: 2000
              additionalProperties: false
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/oauth/google-drive/authorize:
    post:
      summary: Google Drive OAuth flow başlatır — authorize URL döner
      tags:
        - oauth
        - google-drive
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                return_url:
                  type: string
                  format: uri
              additionalProperties: false
      responses:
        "200":
          description: Default Response
  /v1/oauth/google-drive/callback:
    get:
      summary: Google OAuth callback — code+state exchange + storage_backend create
      tags:
        - oauth
        - google-drive
      parameters:
        - schema:
            type: string
          in: query
          name: code
          required: false
        - schema:
            type: string
          in: query
          name: state
          required: false
        - schema:
            type: string
          in: query
          name: error
          required: false
        - schema:
            type: string
          in: query
          name: error_description
          required: false
      responses:
        "200":
          description: Default Response
  /v1/oauth/google-drive/revoke:
    post:
      summary: Google Drive bağlantısını kaldırır — token revoke + backend delete
      tags:
        - oauth
        - google-drive
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                backend_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
              required:
                - backend_id
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/oauth/onedrive/authorize:
    post:
      summary: OneDrive OAuth flow başlatır — authorize URL döner
      tags:
        - oauth
        - onedrive
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                return_url:
                  type: string
                  format: uri
              additionalProperties: false
      responses:
        "200":
          description: Default Response
  /v1/oauth/onedrive/callback:
    get:
      summary: Microsoft OAuth callback — code+state exchange + storage_backend create
      tags:
        - oauth
        - onedrive
      parameters:
        - schema:
            type: string
          in: query
          name: code
          required: false
        - schema:
            type: string
          in: query
          name: state
          required: false
        - schema:
            type: string
          in: query
          name: error
          required: false
        - schema:
            type: string
          in: query
          name: error_description
          required: false
      responses:
        "200":
          description: Default Response
  /v1/oauth/onedrive/revoke:
    post:
      summary: OneDrive bağlantısını kaldırır — token revoke + backend delete
      tags:
        - oauth
        - onedrive
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                backend_id:
                  type: string
                  pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
              required:
                - backend_id
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/storage-backends/:
    get:
      summary: Kullanıcının BYOS backend listesi
      tags:
        - storage-backends
      responses:
        "200":
          description: Default Response
  /v1/storage-backends/{id}:
    get:
      summary: BYOS backend detayı
      tags:
        - storage-backends
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    patch:
      summary: Görünen adı düzenle
      tags:
        - storage-backends
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                display_name:
                  type: string
                  minLength: 1
                  maxLength: 200
              required:
                - display_name
              additionalProperties: false
        required: true
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    delete:
      summary: Backend kaldır + OAuth token revoke
      tags:
        - storage-backends
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/storage-backends/{id}/set-default:
    post:
      summary: Bu backend'i hesap için varsayılan yap (paket kısıtı uygulanır)
      tags:
        - storage-backends
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/storage-backends/{id}/test-connection:
    post:
      summary: Backend bağlantı testi (about.get / read-write probe)
      tags:
        - storage-backends
      parameters:
        - schema:
            type: string
            pattern: ^[a-z]+_[0-9A-HJKMNP-TV-Z]{26}$
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/billing/plans:
    get:
      summary: Hesap türüne uygun plan listesi
      tags:
        - billing
      responses:
        "200":
          description: Default Response
  /v1/billing/subscription:
    get:
      summary: Mevcut abonelik
      tags:
        - billing
      responses:
        "200":
          description: Default Response
  /v1/billing/subscribe:
    post:
      summary: Abonelik ödeme akışı başlat
      tags:
        - billing
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                plan_code:
                  type: string
                  minLength: 1
                  maxLength: 40
                return_url:
                  type: string
                  format: uri
              required:
                - plan_code
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/billing/cancel:
    post:
      summary: Abonelik iptal işaretle
      tags:
        - billing
      responses:
        "200":
          description: Default Response
  /v1/billing/undo-cancel:
    post:
      summary: Abonelik iptal geri al
      tags:
        - billing
      responses:
        "200":
          description: Default Response
  /v1/billing/invoices:
    get:
      summary: Fatura listesi
      tags:
        - billing
      responses:
        "200":
          description: Default Response
  /v1/billing/callback/paynkolay:
    post:
      tags:
        - billing
      responses:
        "200":
          description: Default Response
  /v1/billing/callback/paytr:
    post:
      tags:
        - billing
      responses:
        "200":
          description: Default Response
  /v1/billing/callback/iyzico:
    post:
      tags:
        - billing
      responses:
        "200":
          description: Default Response
  /v1/applications:
    post:
      summary: Başvuru/kayıt formu — KVKK rıza + GSM OTP doğrulama zorunlu
      tags:
        - applications
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - musavir
                    - bireysel
                    - kurumsal
                    - pilot
                package_code:
                  type: string
                  maxLength: 40
                name:
                  type: string
                  minLength: 2
                  maxLength: 200
                email:
                  type: string
                  format: email
                  maxLength: 255
                phone:
                  type: string
                  minLength: 10
                  maxLength: 20
                company_name:
                  type: string
                  maxLength: 255
                vkn_tckn:
                  type: string
                  pattern: ^[0-9]{10,11}$
                musavir_license_no:
                  type: string
                  maxLength: 40
                mukellef_count_estimate:
                  type: integer
                  minimum: 0
                  maximum: 100000
                address:
                  type: string
                  maxLength: 2000
                city:
                  type: string
                  maxLength: 80
                message:
                  type: string
                  maxLength: 2000
                kvkk_consent:
                  type: boolean
                  enum:
                    - true
                marketing_consent:
                  type: boolean
                  default: false
                utm_source:
                  type: string
                  maxLength: 120
                utm_medium:
                  type: string
                  maxLength: 120
                utm_campaign:
                  type: string
                  maxLength: 120
              required:
                - type
                - name
                - email
                - phone
                - kvkk_consent
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/auth/sms-otp/request:
    post:
      summary: SMS doğrulama kodu iste (6 haneli, 5 dk TTL)
      tags:
        - auth
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone:
                  type: string
                  minLength: 10
                  maxLength: 20
                purpose:
                  type: string
                  enum:
                    - application
                    - login
                    - phone-change
                    - pilot:invite
                  default: application
              required:
                - phone
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/auth/sms-otp/verify:
    post:
      summary: SMS doğrulama kodunu doğrula
      tags:
        - auth
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone:
                  type: string
                  minLength: 10
                  maxLength: 20
                code:
                  type: string
                  minLength: 6
                  maxLength: 6
                purpose:
                  type: string
                  enum:
                    - application
                    - login
                    - phone-change
                    - pilot:invite
                  default: application
              required:
                - phone
                - code
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/sms-providers:
    get:
      responses:
        "200":
          description: Default Response
  /v1/admin/sms-providers/{code}:
    patch:
      parameters:
        - schema:
            type: string
          in: path
          name: code
          required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/sms-providers/{code}/set-default:
    post:
      parameters:
        - schema:
            type: string
          in: path
          name: code
          required: true
      responses:
        "200":
          description: Default Response
  /v1/pilot-feedback:
    post:
      summary: Pilot 30g programı haftalık geri bildirim — KVKK rıza zorunlu
      tags:
        - pilot
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                pilot_code:
                  type: string
                  pattern: ^PIL-[A-Z0-9]{4}-[A-Z0-9]{4,8}$
                week_number:
                  type: integer
                  minimum: 1
                  maximum: 4
                nps_score:
                  type: integer
                  minimum: 0
                  maximum: 10
                usage_days:
                  type: integer
                  minimum: 0
                  maximum: 7
                most_used_flow:
                  type: string
                  enum:
                    - snapshot
                    - restore
                    - mukellef
                    - paylasim
                    - devir
                    - fatura
                    - byos
                    - diger
                had_blocking_bug:
                  type: boolean
                bug_description:
                  type: string
                  maxLength: 2000
                open_response_1:
                  type: string
                  maxLength: 2000
                open_response_2:
                  type: string
                  maxLength: 2000
                open_response_3:
                  type: string
                  maxLength: 2000
                berhan_note:
                  type: string
                  maxLength: 2000
                kvkk_consent:
                  type: boolean
                  enum:
                    - true
              required:
                - pilot_code
                - week_number
                - kvkk_consent
              additionalProperties: false
        required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/pilot-feedback:
    get:
      responses:
        "200":
          description: Default Response
  /v1/admin/applications:
    get:
      responses:
        "200":
          description: Default Response
  /v1/admin/applications/{id}:
    get:
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
    patch:
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/applications/{id}/invite:
    post:
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
  /v1/admin/applications/{id}/convert:
    post:
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        "200":
          description: Default Response
servers:
  - url: https://api.pratikyedek.com
    description: production
