⭐️ games.versions.createGameVersion


Description

Creates a new game version.


Code Examples

# Write the request body to body.json before running
curl -X POST -d '@body.json' 'https://api.rivet.gg/cloud/games/{game_id}/versions'

Request Parameters

game_id

required path parameter

Request Body

  • display_name
    string

    Represent a resource's readable display name.

  • config
    object

    Cloud configuration for a given version.

    • config.scripts
      union of empty object and string
    • config.engine
      object
      • config.engine.unity
        empty object
      • config.engine.unreal
        object
        • config.engine.unreal.game_module
          string

          Name of the Unreal module that holds the game code. This is usually the value of $.Modules[0].Name in the file MyProject.unproject. Configures Rivet CLI behavior. Has no effect on server behavior.

      • config.engine.godot
        empty object
      • config.engine.html5
        empty object
      • config.engine.custom
        empty object
    • config.cdn
      object

      CDN configuration for a given version.

      • config.cdn.build_command
        string

        Configures Rivet CLI behavior. Has no effect on server behavior.

      • config.cdn.build_output
        string

        Configures Rivet CLI behavior. Has no effect on server behavior.

      • config.cdn.build_env
        union of empty object and string

        Configures Rivet CLI behavior. Has no effect on server behavior.

      • config.cdn.site_id
        string
      • config.cdn.routes
        array of objects

        Multiple CDN version routes.

        • config.cdn.routes.glob
          string
        • config.cdn.routes.priority
          number

          Unsigned 32 bit integer.

        • config.cdn.routes.middlewares
          array of objects

          Multiple CDN version middleware.

          • config.cdn.routes.middlewares.kind
            object
            • config.cdn.routes.middlewares.kind.custom_headers
              object
              • config.cdn.routes.middlewares.kind.custom_headers.headers
                array of objects
                • config.cdn.routes.middlewares.kind.custom_headers.headers.name
                  string
                • config.cdn.routes.middlewares.kind.custom_headers.headers.value
                  string
    • config.matchmaker
      object

      Matchmaker configuration for a given version.

      • config.matchmaker.game_modes
        union of empty object and object

        A list of game modes.

          • config.matchmaker.game_modes.regions
            union of empty object and object
              • config.matchmaker.game_modes.regions.tier
                string
              • config.matchmaker.game_modes.regions.idle_lobbies
                object

                Configuration for how many idle lobbies a game version should have.

                • config.matchmaker.game_modes.regions.idle_lobbies.min
                  number
                • config.matchmaker.game_modes.regions.idle_lobbies.max
                  number
          • config.matchmaker.game_modes.max_players
            number
          • config.matchmaker.game_modes.max_players_direct
            number
          • config.matchmaker.game_modes.max_players_party
            number
          • config.matchmaker.game_modes.docker
            object

            A game mode runtime running through Docker.

            • config.matchmaker.game_modes.docker.dockerfile
              string

              Configures Rivet CLI behavior. Has no effect on server behavior.

            • config.matchmaker.game_modes.docker.build_args
              union of empty object and string

              Configures Rivet CLI behavior. Has no effect on server behavior.

            • config.matchmaker.game_modes.docker.image
              string

              Configures Rivet CLI behavior. Has no effect on server behavior.

            • config.matchmaker.game_modes.docker.image_id
              string
            • config.matchmaker.game_modes.docker.args
              array of strings
            • config.matchmaker.game_modes.docker.env
              union of empty object and string
            • config.matchmaker.game_modes.docker.network_mode
              string

              Configures how the container's network is isolated from the host. bridge (default) networking isolates the container's network from the host & other containers. host networking removes isolation between the container and the host. Only available in Rivet Open Source & Enterprise. Read more about bridge vs host networking here.

            • config.matchmaker.game_modes.docker.ports
              union of empty object and object
                • config.matchmaker.game_modes.docker.ports.port
                  number
                • config.matchmaker.game_modes.docker.ports.port_range
                  object

                  Range of ports that can be connected to. If configured, network_mode must equal host. Port ranges may overlap between containers, it is the responsibility of the developer to ensure ports are available before using. Read more about host networking here. Only available on Rivet Open Source & Enterprise.

                  Related

                  • cloud.version.matchmaker.PortProtocol
                  • cloud.version.matchmaker.ProxyKind
                  • config.matchmaker.game_modes.docker.ports.port_range.min
                    number

                    Unsigned 32 bit integer.

                  • config.matchmaker.game_modes.docker.ports.port_range.max
                    number

                    Unsigned 32 bit integer.

                • config.matchmaker.game_modes.docker.ports.protocol
                  string

                  Signifies the protocol of the port. Note that when proxying through GameGuard (via ProxyKind), the port number returned by /find, /join, and /create will not be the same as the port number configured in the config:

                  • With HTTP, the port will always be 80. The hostname of the port correctly routes the incoming connection to the correct port being used by the game server.
                  • With HTTPS, the port will always be 443. The hostname of the port correctly routes the incoming connection to the correct port being used by the game server.
                  • Using TCP/UDP, the port will be a random number between 26000 and 31999. This gets automatically routed to the correct port being used by the game server.

                  Related - cloud.version.matchmaker.GameModeRuntimeDockerPort - cloud.version.matchmaker.ProxyKind - /docs/dynamic-servers/concepts/game-guard - matchmaker.lobbies.find

                • config.matchmaker.game_modes.docker.ports.proxy
                  string

                  How this port should be proxied. Defaults to 'game-guard`.

                • config.matchmaker.game_modes.docker.ports.dev_port
                  number

                  Configures Rivet CLI behavior. Has no effect on server behavior.

                • config.matchmaker.game_modes.docker.ports.dev_port_range
                  object

                  Configures Rivet CLI behavior. Has no effect on server behavior.

                  • config.matchmaker.game_modes.docker.ports.dev_port_range.min
                    number

                    Unsigned 32 bit integer.

                  • config.matchmaker.game_modes.docker.ports.dev_port_range.max
                    number

                    Unsigned 32 bit integer.

                • config.matchmaker.game_modes.docker.ports.dev_protocol
                  string

                  Configures Rivet CLI behavior. Has no effect on server behavior.

          • config.matchmaker.game_modes.listable
            boolean
          • config.matchmaker.game_modes.taggable
            boolean
          • config.matchmaker.game_modes.allow_dynamic_max_players
            boolean
          • config.matchmaker.game_modes.actions
            object

            Configuration for the connection types allowed for a game mode.

            • config.matchmaker.game_modes.actions.find
              object

              Configures the requirements and authentication for the /find endpoint. If this value is not set in the config, the /find endpoint is still enabled.

              • config.matchmaker.game_modes.actions.find.enabled
                boolean

                Sets whether or not the /find endpoint is enabled.

              • config.matchmaker.game_modes.actions.find.identity_requirement
                any value
              • config.matchmaker.game_modes.actions.find.verification
                object

                Configuration that tells Rivet where to send validation requests and with what headers. When set, Rivet will send the verification_data property (given by the user in the find/join/create endpoint) to the given url along with the headers provided and some information about the requested lobby. The response of this request will determine if the user can join that lobby or not.

                • config.matchmaker.game_modes.actions.find.verification.url
                  string
                • config.matchmaker.game_modes.actions.find.verification.headers
                  union of empty object and string
            • config.matchmaker.game_modes.actions.join
              object

              Configures the requirements and authentication for the /join endpoint. If this value is not set in the config, the /join endpoint is still enabled.

              • config.matchmaker.game_modes.actions.join.enabled
                boolean

                Sets whether or not the /join endpoint is enabled.

              • config.matchmaker.game_modes.actions.join.identity_requirement
                any value
              • config.matchmaker.game_modes.actions.join.verification
                object

                Configuration that tells Rivet where to send validation requests and with what headers. When set, Rivet will send the verification_data property (given by the user in the find/join/create endpoint) to the given url along with the headers provided and some information about the requested lobby. The response of this request will determine if the user can join that lobby or not.

                • config.matchmaker.game_modes.actions.join.verification.url
                  string
                • config.matchmaker.game_modes.actions.join.verification.headers
                  union of empty object and string
            • config.matchmaker.game_modes.actions.create
              object

              Configures the requirements and authentication for the /create endpoint. If this value is not set in the config, the /create endpoint is NOT enabled.

              • config.matchmaker.game_modes.actions.create.enabled
                boolean

                Sets whether or not the /create endpoint is enabled.

              • config.matchmaker.game_modes.actions.create.identity_requirement
                any value
              • config.matchmaker.game_modes.actions.create.verification
                object

                Configuration that tells Rivet where to send validation requests and with what headers. When set, Rivet will send the verification_data property (given by the user in the find/join/create endpoint) to the given url along with the headers provided and some information about the requested lobby. The response of this request will determine if the user can join that lobby or not.

                • config.matchmaker.game_modes.actions.create.verification.url
                  string
                • config.matchmaker.game_modes.actions.create.verification.headers
                  union of empty object and string
              • config.matchmaker.game_modes.actions.create.enable_public
                boolean

                Defaults to false when unset.

              • config.matchmaker.game_modes.actions.create.enable_private
                boolean

                Defaults to true when unset.

              • config.matchmaker.game_modes.actions.create.max_lobbies_per_identity
                any value
          • config.matchmaker.game_modes.tier
            string
          • config.matchmaker.game_modes.idle_lobbies
            object

            Configuration for how many idle lobbies a game version should have.

            • config.matchmaker.game_modes.idle_lobbies.min
              number
            • config.matchmaker.game_modes.idle_lobbies.max
              number
      • config.matchmaker.captcha
        object

        Matchmaker captcha configuration.

        • config.matchmaker.captcha.requests_before_reverify
          number

          Denotes how many requests a connection can make before it is required to reverify a captcha.

        • config.matchmaker.captcha.verification_ttl
          number

          Denotes how long a connection can continue to reconnect without having to reverify a captcha (in milliseconds).

        • config.matchmaker.captcha.hcaptcha
          object

          hCpatcha configuration.

          • config.matchmaker.captcha.hcaptcha.level
            any value
          • config.matchmaker.captcha.hcaptcha.site_key
            string

            Site key for your hCaptcha application. Must be set.

          • config.matchmaker.captcha.hcaptcha.secret_key
            string

            Secret key for your hCaptcha application. Must be set.

        • config.matchmaker.captcha.turnstile
          object

          Turnstile captcha configuration.

          • config.matchmaker.captcha.turnstile.site_key
            string
          • config.matchmaker.captcha.turnstile.secret_key
            string
      • config.matchmaker.dev_hostname
        string

        Configures Rivet CLI behavior. Has no effect on server behavior.

      • config.matchmaker.regions
        union of empty object and object
          • config.matchmaker.regions.tier
            string
          • config.matchmaker.regions.idle_lobbies
            object

            Configuration for how many idle lobbies a game version should have.

            • config.matchmaker.regions.idle_lobbies.min
              number
            • config.matchmaker.regions.idle_lobbies.max
              number
      • config.matchmaker.max_players
        number
      • config.matchmaker.max_players_direct
        number
      • config.matchmaker.max_players_party
        number
      • config.matchmaker.docker
        object

        A game mode runtime running through Docker.

        • config.matchmaker.docker.dockerfile
          string

          Configures Rivet CLI behavior. Has no effect on server behavior.

        • config.matchmaker.docker.build_args
          union of empty object and string

          Configures Rivet CLI behavior. Has no effect on server behavior.

        • config.matchmaker.docker.image
          string

          Configures Rivet CLI behavior. Has no effect on server behavior.

        • config.matchmaker.docker.image_id
          string
        • config.matchmaker.docker.args
          array of strings
        • config.matchmaker.docker.env
          union of empty object and string
        • config.matchmaker.docker.network_mode
          string

          Configures how the container's network is isolated from the host. bridge (default) networking isolates the container's network from the host & other containers. host networking removes isolation between the container and the host. Only available in Rivet Open Source & Enterprise. Read more about bridge vs host networking here.

        • config.matchmaker.docker.ports
          union of empty object and object
            • config.matchmaker.docker.ports.port
              number
            • config.matchmaker.docker.ports.port_range
              object

              Range of ports that can be connected to. If configured, network_mode must equal host. Port ranges may overlap between containers, it is the responsibility of the developer to ensure ports are available before using. Read more about host networking here. Only available on Rivet Open Source & Enterprise.

              Related

              • cloud.version.matchmaker.PortProtocol
              • cloud.version.matchmaker.ProxyKind
              • config.matchmaker.docker.ports.port_range.min
                number

                Unsigned 32 bit integer.

              • config.matchmaker.docker.ports.port_range.max
                number

                Unsigned 32 bit integer.

            • config.matchmaker.docker.ports.protocol
              string

              Signifies the protocol of the port. Note that when proxying through GameGuard (via ProxyKind), the port number returned by /find, /join, and /create will not be the same as the port number configured in the config:

              • With HTTP, the port will always be 80. The hostname of the port correctly routes the incoming connection to the correct port being used by the game server.
              • With HTTPS, the port will always be 443. The hostname of the port correctly routes the incoming connection to the correct port being used by the game server.
              • Using TCP/UDP, the port will be a random number between 26000 and 31999. This gets automatically routed to the correct port being used by the game server.

              Related - cloud.version.matchmaker.GameModeRuntimeDockerPort - cloud.version.matchmaker.ProxyKind - /docs/dynamic-servers/concepts/game-guard - matchmaker.lobbies.find

            • config.matchmaker.docker.ports.proxy
              string

              How this port should be proxied. Defaults to 'game-guard`.

            • config.matchmaker.docker.ports.dev_port
              number

              Configures Rivet CLI behavior. Has no effect on server behavior.

            • config.matchmaker.docker.ports.dev_port_range
              object

              Configures Rivet CLI behavior. Has no effect on server behavior.

              • config.matchmaker.docker.ports.dev_port_range.min
                number

                Unsigned 32 bit integer.

              • config.matchmaker.docker.ports.dev_port_range.max
                number

                Unsigned 32 bit integer.

            • config.matchmaker.docker.ports.dev_protocol
              string

              Configures Rivet CLI behavior. Has no effect on server behavior.

      • config.matchmaker.tier
        string
      • config.matchmaker.idle_lobbies
        object

        Configuration for how many idle lobbies a game version should have.

        • config.matchmaker.idle_lobbies.min
          number
        • config.matchmaker.idle_lobbies.max
          number
      • config.matchmaker.lobby_groups
        any value
    • config.kv
      empty object

      KV configuration for a given version.

    • config.identity
      any value

Response Body

  • version_id
    string