openapi: 3.0.2
info:
  title: gaming-public API
  description: API for Microservice gaming-public-api
  termsOfService: http://www.noenv.com/
  contact:
    name: NoEnv team
    url: http://www.noenv.com
  version: 1.0.2
servers:
  - url: /v1/api

paths:
  /lobbies/{lobbyId}:
    get:
      description: Get Lobby.
      operationId: getLobby
      tags: [lobby]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/headerIfNoneMatch"
      responses:
        "200":
          description: Lobby response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  categoryBar:
                    type: array
                    items:
                      $ref: "#/components/schemas/categoryBarItem"
                  categories:
                    type: array
                    items:
                      $ref: "#/components/schemas/category"
                  studios:
                    type: array
                    items:
                      $ref: "#/components/schemas/studio"
                  search:
                    $ref: "#/components/schemas/search"
                  searchFilters:
                    type: array
                    items:
                      $ref: "#/components/schemas/searchFilterGroup"
                  searchTags:
                    type: array
                    items:
                      $ref: "#/components/schemas/searchTag"
                  gameSidePanels:
                    type: array
                    items:
                      $ref: "#/components/schemas/gameSidePanel"
                  tags:
                    type: array
                    items:
                      $ref: "#/components/schemas/tag"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/games/category:
    get:
      description: Get Games in a lobby via a combined filter (user + filter).
      operationId: categoryGames
      tags: [games]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/queryFilterIds"
        - $ref: "#/components/parameters/ruleSet"
        - $ref: "#/components/parameters/queryTileType"
        - $ref: "#/components/parameters/queryDisplaySet"
        - $ref: "#/components/parameters/queryLimitGames"
        - $ref: "#/components/parameters/queryFilterInfo"
        - $ref: "#/components/parameters/queryDevice"
        - $ref: "#/components/parameters/queryShowVideo"
        - $ref: "#/components/parameters/headerIfNoneMatch"
      responses:
        "200":
          description: Games response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/gamesResult"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/games/search:
    get:
      description: Search for games in a lobby.
      operationId: searchGames
      tags: [games]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/querySearch"
        - $ref: "#/components/parameters/queryTileType"
        - $ref: "#/components/parameters/queryDisplaySet"
        - $ref: "#/components/parameters/queryLimitGames"
        - $ref: "#/components/parameters/queryDevice"
        - $ref: "#/components/parameters/queryShowVideo"
      responses:
        "200":
          description: Games response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/gamesResult"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/games/tag:
    get:
      description: Search for games in a lobby for certain tag.
      operationId: tagGames
      tags: [games]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/querySlugs"
        - $ref: "#/components/parameters/queryTagCategory"
        - $ref: "#/components/parameters/queryTags"
        - $ref: "#/components/parameters/queryTileType"
        - $ref: "#/components/parameters/queryDisplaySet"
        - $ref: "#/components/parameters/queryLimitGames"
        - $ref: "#/components/parameters/queryDevice"
        - $ref: "#/components/parameters/queryShowVideo"
      responses:
        "200":
          description: Games response.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/gameAppearance"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/games/list:
    get:
      description: List games in a lobby.
      operationId: listGames
      tags: [games]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/queryGameIds"
        - $ref: "#/components/parameters/queryTileType"
        - $ref: "#/components/parameters/queryDisplaySet"
        - $ref: "#/components/parameters/queryShowVideo"
      responses:
        "200":
          description: Games response.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/gameAppearance"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/games/info:
    get:
      description: List game infos in a lobby.
      operationId: infoGames
      tags: [games]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - in: query
          name: gameIds
          description: Comma delimited list of Game Ids.
          required: false
          schema:
            type: string
            maxLength: 1500
          example: ogs:550077,ogs:550125
        - $ref: "#/components/parameters/queryReturnParams"
      responses:
        "200":
          description: Game Information.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/casinoGameInfo"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/games/{gameId}/info:
    get:
      description: Get game information.
      operationId: getGameDetails
      tags: [game]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/pathGameId"
        - $ref: "#/components/parameters/queryIdType"
        - $ref: "#/components/parameters/queryDisplaySet"
        - $ref: "#/components/parameters/queryTileType"
        - $ref: "#/components/parameters/queryShowVideo"
      responses:
        "200":
          description: Game information.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/casinoGameDetails"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/games/{gameId}/similar:
    get:
      description: Get similar games.
      operationId: getGameSimilar
      tags: [game]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/pathGameId"
        - $ref: "#/components/parameters/queryDisplaySet"
        - $ref: "#/components/parameters/queryTileType"
        - $ref: "#/components/parameters/queryLimitGames"
        - $ref: "#/components/parameters/queryShowVideo"
        - $ref: "#/components/parameters/queryDevice"
      responses:
        "200":
          description: Games response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  games:
                    type: array
                    items:
                      $ref: "#/components/schemas/gameAppearance"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/panelInfo:
    get:
      description: Get panel information.
      operationId: getPanelInfo
      tags: [other]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/tags"
        - $ref: "#/components/parameters/gameStudioIds"
      responses:
        "200":
          description: Panel information.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/panelInfo"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/filterInfo:
    get:
      description: Get game count for filters in a lobby.
      operationId: getFilterInfo
      tags: [other]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
        - $ref: "#/components/parameters/queryFilterIds"
        - $ref: "#/components/parameters/queryDevice"
      responses:
        "200":
          description: Game counts response.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: id of filter
                      example: filterId1
                    gameCount:
                      type: integer
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/sitemap:
    get:
      description: Get Lobby Sitemap Entries.
      operationId: getLobbySitemap
      tags: [content feeds]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
      responses:
        "200":
          description: Sitemap response.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /lobbies/{lobbyId}/whitelist:
    get:
      description: Get Lobby Whitelist Entries.
      operationId: getLobbyWhitelist
      tags: [content feeds]
      parameters:
        - $ref: "#/components/parameters/pathLobbyId"
      responses:
        "200":
          description: Whitelist response.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /games:
    get:
      description: List games.
      operationId: allGames
      tags: [game listings]
      parameters:
        - in: query
          name: gameIds
          description: Comma delimited list of Game Ids.
          required: false
          schema:
            type: string
            maxLength: 1500
          example: ogs:550077,ogs:550125
        - $ref: "#/components/parameters/queryReturnParams"
      responses:
        "200":
          description: Game Information.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/allGameInfo"
        "400":
          $ref: "#/components/responses/400"
        "500":
          $ref: "#/components/responses/500"

  /migrate:
    get:
      description: Temp endpoint to map game IDs for migrated games
      operationId: getMigratedGameId
      tags: [migration]
      parameters:
        - in: query
          name: gameId
          description: ID of game in question
          required: true
          schema:
            type: string
            maxLength: 1500
          example: ogs:550077
      responses:
        "200":
          description: Game ID response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string

components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: "Enter the full header value including the 'Bearer ' prefix, e.g. 'Bearer eyJ...'"

  parameters:
    pathLobbyId:
      name: lobbyId
      in: path
      description: The Lobby ID.
      required: true
      schema:
        type: string
      example: nj-dev

    pathGameId:
      in: path
      name: gameId
      description: The Game ID.
      required: true
      schema:
        type: string
      example: ogs:233322

    queryIdType:
      in: query
      name: idType
      description: The ID Type. If not supplied defaults to 'id'
      required: false
      schema:
        type: string
        enum:
          - id
          - slug

    querySearch:
      in: query
      name: search
      description: Full Text search string.
      required: true
      schema:
        $ref: "#/components/schemas/searchString"
      example: castles

    queryGameIds:
      in: query
      name: gameIds
      description: Comma delimited list of Game Ids.
      required: true
      schema:
        type: string
        maxLength: 1500
      example: ogs:550077,ogs:550125

    queryFilterIds:
      in: query
      name: filterIds
      description: Comma separated list of predefined Filter Ids.
      required: true
      schema:
        type: string
      example: TopWins,GameStudio-Evolution

    queryTagCategory:
      in: query
      name: tagCategory
      description: tag category.
      required: false
      deprecated: true
      schema:
        type: string
        enum:
          - theme
          - feature
      example: theme

    queryTags:
      in: query
      name: tags
      description: Comma delimited list of tag names.
      required: false
      deprecated: true
      schema:
        type: string
      example: Abenteuer,Mythologie

    querySlugs:
      in: query
      name: slugs
      description: Comma delimited list of slugs.
      required: false
      schema:
        type: string
      example: abenteuer,mythologie

    ruleSet:
      in: query
      name: ruleSet
      description: A rule set in the format of a rule filter.
      allowReserved: true
      schema:
        type: object

    queryDisplaySet:
      name: displaySet
      in: query
      description: Display set to use to find images.
      required: false
      schema:
        type: string
        default: default

    queryTileType:
      name: tileType
      in: query
      description: Tile type.
      required: false
      schema:
        type: string
        enum: [p1, p2, p3, p4, l1, l2]
        default: p3

    queryLimitGames:
      name: limit
      in: query
      description: Limits the number of games in the returned games list(s)
      schema:
        type: integer

    queryDevice:
      name: device
      in: query
      schema:
        $ref: "#/components/schemas/device"

    queryFilterInfo:
      name: includeFilterInfo
      in: query
      description: Show additional filter info.
      required: false
      schema:
        type: boolean

    queryShowVideo:
      in: query
      name: showVideo
      description: Include video field for games, and return `poster` as `img` if available.
      required: false
      schema:
        type: boolean
        default: true

    queryReturnParams:
      in: query
      name: returnParams
      description: List of parameters to include.
      required: false
      style: form
      explode: false
      schema:
        type: array
        uniqueItems: true
        items:
          type: string

    tags:
      name: tags
      in: query
      description: panel tags.
      required: false
      schema:
        type: array
        items:
          type: string

    gameStudioIds:
      name: gameStudioIds
      in: query
      description: panel game studio ids.
      required: false
      schema:
        type: array
        items:
          type: string

    headerIfNoneMatch:
      name: If-None-Match
      in: header
      required: false
      description: |
        ETag value from a previous response. If it matches the current
        resource ETag, the server returns 304 Not Modified.
      schema:
        type: string

  schemas:
    gameAppearance:
      type: object
      properties:
        id:
          type: string
          example: "ogs:70476"
          description: id of the game in `provider:providerGameId` format
        title:
          type: string
          example: Monopoly Megaways
          description: title of the game
        img:
          type: string
        maintenance:
          type: boolean
        labels:
          type: string
          enum: [NEW, EXCLUSIVE]
        exclude:
          type: object
          properties:
            orientations:
              type: string
              enum: [PORTRAIT, LANDSCAPE]
            devices:
              type: string
              enum: [ios, android, desktop]
    gamesResult:
      type: object
      properties:
        games:
          type: array
          items:
            $ref: "#/components/schemas/gameAppearance"
    casinoGameDetails:
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        rtp:
          type: number
          format: double
        volatility:
          type: number
          format: int32
        minBet:
          type: number
          format: int32
        maxBet:
          type: number
          format: int32
        themes:
          type: array
          items:
            type: string
        studio:
          type: string
        img:
          type: string
        hasFunMode:
          type: boolean
        tags:
          type: array
          items:
            $ref: "#/components/schemas/tag"

    casinoGameInfo:
      properties:
        gameId:
          type: string
        title:
          type: string
        description:
          type: string
        studio:
          type: string

    allGameInfo:
      properties:
        gameId:
          type: string
        title:
          type: string

    tileType:
      type: string
      enum: [p1, p2, p3, p4, l1, l2]

    lobbyCategoryDisplay:
      type: object
      properties:
        tile:
          $ref: "#/components/schemas/tileType"
        rank:
          type: boolean
          example: false
        rows:
          type: integer
          example: 1
        limit:
          type: integer
          example: 10
        showLabels:
          type: boolean
        showVideo:
          type: boolean

    lobbyPage:
      type: object
      properties:
        tile:
          $ref: "#/components/schemas/tileType"
        showLabels:
          type: boolean
        showSearchFilters:
          type: boolean
        showVideo:
          type: boolean

    category:
      type: object
      properties:
        title:
          type: string
          description: title of the category
          example: "Egypt"
        displaySet:
          type: string
        display:
          $ref: "#/components/schemas/lobbyCategoryDisplay"
        displayMobile:
          $ref: "#/components/schemas/lobbyCategoryDisplay"
        page:
          $ref: "#/components/schemas/lobbyPage"
        pageMobile:
          $ref: "#/components/schemas/lobbyPage"
        filterId:
          type: string
        slug:
          type: string
        games:
          type: array
          items:
            $ref: "#/components/schemas/gameAppearance"

    categoryBarItem:
      type: object
      properties:
        title:
          type: string
        filterId:
          type: string
        slug:
          type: string
        icon:
          type: string
        page:
          $ref: "#/components/schemas/lobbyPage"
        pageMobile:
          $ref: "#/components/schemas/lobbyPage"
      required:
        - title
        - filterId

    studio:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        img:
          type: string
        filterId:
          type: string
        slug:
          type: string

    search:
      type: object
      properties:
        title:
          type: string
        filterId:
          type: string
        page:
          $ref: "#/components/schemas/lobbyPage"
        pageMobile:
          $ref: "#/components/schemas/lobbyPage"

    searchFilterGroup:
      type: object
      properties:
        title:
          type: string
        filters:
          type: array
          items:
            $ref: "#/components/schemas/searchFilter"

    searchFilter:
      type: object
      properties:
        title:
          type: string
        slug:
          type: string
        filterId:
          type: string
        icon:
          type: string
          description: asset reference

    searchTag:
      type: object
      properties:
        name:
          type: string
        slug:
          type: string
        filterId:
          type: string

    gameSidePanel:
      type: object
      properties:
        title:
          type: string
        filterId:
          type: string
        position:
          type: string
          enum: [LEFT, RIGHT]
        page:
          $ref: "#/components/schemas/lobbyPage"
        pageMobile:
          $ref: "#/components/schemas/lobbyPage"

    tag:
      type: object
      properties:
        name:
          type: string
        slug:
          type: string

    searchString:
      type: string
      minLength: 2 # searching for 88 Fortunes
      maxLength: 100

    device:
      type: string
      enum: [desktop, android, ios]

    error:
      type: object
      required:
        - type
        - message
      properties:
        message:
          type: string
        type:
          type: string
        errors:
          type: array
          items:
            $ref: "#/components/schemas/error"
    panelInfo:
      type: array
      items:
        $ref: "#/components/schemas/panelObject"

    panelObject:
      type: object
      properties:
        title:
          type: string
        filters:
          type: array
          items:
            type: object
            properties:
              title:
                type: string
              filterId:
                type: string
              icon:
                type: string
  responses:
    400:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/error"
          example:
            type: "gaming-public-api:bad-request"
            message: Invalid Input
    500:
      description: An internal server error occurred
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/error"
          example:
            type: "gaming-public-api:unknown-error"
            message: Unknown Error
