openapi: 3.1.0
info:
  title: pour.fyi Public API
  version: 1.0.0
  description: >-
    The documented public HTTP surface for pour.fyi. Private data endpoints
    require a signed-in Better Auth session and are intentionally not a public
    data API.
servers:
  - url: https://pour.fyi
paths:
  /api/health:
    get:
      operationId: getHealth
      summary: Read service health
      responses:
        '200':
          description: Service health response
          content:
            application/json:
              schema:
                type: object
                required: [status, service]
                properties:
                  status:
                    type: string
                    example: ok
                  service:
                    type: string
  /api/data/export/json:
    get:
      operationId: exportJson
      summary: Export the signed-in user's data as JSON
      security:
        - betterAuthSession: []
      responses:
        '200':
          description: JSON export for the authenticated account
        '401':
          description: Authentication required
  /api/data/export/csv:
    get:
      operationId: exportCsv
      summary: Export the signed-in user's drink history as CSV
      security:
        - betterAuthSession: []
      responses:
        '200':
          description: CSV export for the authenticated account
        '401':
          description: Authentication required
  /api/data/export:
    get:
      operationId: exportAlcoDroidBackup
      summary: Export the signed-in user's data in AlcoDroid-compatible format
      security:
        - betterAuthSession: []
      responses:
        '200':
          description: Binary AlcoDroid-compatible backup
        '401':
          description: Authentication required
components:
  securitySchemes:
    betterAuthSession:
      type: apiKey
      in: cookie
      name: better-auth.session_token
      description: Browser session cookie issued after authentication.
