openapi: 3.0.3
info:
  title: PUP - Imaging API v1
  description: >
    PUP is the universal player profile for padel. Players can use PUP to track their performance, playing style, and 
    statistics – no matter where they play.
  version: 1.0.0

servers:
  - url: https://api.gopup.app/
    description: Development server

x-tagGroups:
  - name: Utils
    tags:
      - imaging

tags:
  - name: imaging
    x-displayName: "Imaging"
    description: Operations related to image processing

paths:
  /utils/imaging/v1/strip-background:
    post:
      summary: Remove background from an image
      operationId: stripBackground
      security:
        - OAuth2: [ ]
        - PAT: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                image:
                  type: string
                  format: binary
                  description: The image file to process (JPG, PNG, WebP)
              required:
                - image
      responses:
        '200':
          description: Background removed successfully
          content:
            image/png:
              schema:
                type: string
                format: binary
        '400':
          description: Invalid input or file too large
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '500':
          description: Background removal failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: string
      tags:
        - imaging

components:
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: "https://oauth2.gopup.app/oauth2/auth"
          tokenUrl: "https://oauth2.gopup.app/oauth2/token"
      description: OAuth2

    PAT:
      type: http
      scheme: bearer
      bearerFormat: PAT
      description: Personal Access Token
