openapi: 3.0.3
info:
  title: Repzo API - Custom List
  version: 1.0.0
  description: OpenAPI specification for Repzo Custom List endpoints.
servers:
  - url: https://sv.api.repzo.me
paths:
  /custom-list:
    get:
      summary: Find custom lists
      operationId: findCustomLists
      parameters:
        - in: query
          name: params
          schema:
            type: object
          description: Query parameters for filtering custom lists
      responses:
        "200":
          description: A list of custom lists
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListFindResult"
    post:
      summary: Create a custom list
      operationId: createCustomList
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomListCreateBody"
      responses:
        "201":
          description: Custom list created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListCreateResult"
  /custom-list/{id}:
    get:
      summary: Get a custom list by ID
      operationId: getCustomList
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Custom list details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListGetResult"
    put:
      summary: Update a custom list
      operationId: updateCustomList
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomListUpdateBody"
      responses:
        "200":
          description: Custom list updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListUpdateResult"
    delete:
      summary: Remove a custom list
      operationId: removeCustomList
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Custom list removed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomListRemoveResult"
components:
  schemas:
    CustomListFindResult:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/CustomList"
        meta:
          type: object
    CustomListCreateBody:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        entity:
          type: string
        disabled:
          type: boolean
    CustomListCreateResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/CustomList"
    CustomListGetResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/CustomList"
    CustomListUpdateBody:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        entity:
          type: string
        disabled:
          type: boolean
    CustomListUpdateResult:
      type: object
      properties:
        data:
          $ref: "#/components/schemas/CustomList"
    CustomListRemoveResult:
      type: object
      properties:
        success:
          type: boolean
    CustomList:
      type: object
      properties:
        _id:
          type: string
        name:
          type: string
        description:
          type: string
        entity:
          type: string
        disabled:
          type: boolean
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
