> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Request Multiplayer Server

> Request a multiplayer server session. Accepts tokens for title and if game client access is enabled, allows game client to request a server with player entity token.

Allowed entity token types: title, title_player_account

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| APINotEnabledForGameClientAccess | 1082 |
| MultiplayerServerBadRequest | 1382 |
| MultiplayerServerForbidden | 1384 |
| MultiplayerServerInternalServerError | 1387 |
| MultiplayerServerNotFound | 1385 |
| MultiplayerServerTooManyRequests | 1380 |
| MultiplayerServerUnauthorized | 1383 |
| MultiplayerServerUnavailable | 1388 |
| ProductDisabledForTitle | 1609 |




## OpenAPI

````yaml post /MultiplayerServer/RequestMultiplayerServer
openapi: 3.0.0
info:
  version: '260922'
  title: PlayFab Multiplayer API
  description: >-
    API methods for managing multiplayer servers. API methods for managing
    parties. The lobby service helps players group together to play multiplayer
    games. It is often used as a rendezvous point for players to share
    connection information. The TrueSkill service helps titles to estimate a
    player's skill based on their match results. The player skill values from
    this service are commonly used by a matchmaking service to provide players
    with balanced matches.
  termsOfService: https://playfab.com/terms/
  contact:
    url: https://community.playfab.com/index.html
  license:
    name: Apache 2.0
    url: https://github.com/PlayFab/API_Specs/blob/master/LICENSE
servers:
  - url: https://{titleId}.playfabapi.com
    description: PlayFab title endpoint
    variables:
      titleId:
        default: your_title_id
        description: Your PlayFab title ID (hex).
security: []
tags:
  - name: Lobby
    description: ''
  - name: Matchmaking
    description: Matchmaking APIs
  - name: Matchmaking Admin
    description: Matchmaking Admin APIs
  - name: MultiplayerServer
    description: Multiplayer Server APIs
  - name: PubSub
    description: PlayFab PubSub APIs
  - name: TrueSkill
    description: TrueSkill APIs
  - name: TrueSkill Admin
    description: TrueSkill Admin APIs
paths:
  /MultiplayerServer/RequestMultiplayerServer:
    post:
      tags:
        - MultiplayerServer
      summary: Request Multiplayer Server
      description: >
        Request a multiplayer server session. Accepts tokens for title and if
        game client access is enabled, allows game client to request a server
        with player entity token.


        Allowed entity token types: title, title_player_account


        ## Error codes


        This operation may return the following PlayFab errors:


        | Error | Code |

        | --- | --- |

        | APINotEnabledForGameClientAccess | 1082 |

        | MultiplayerServerBadRequest | 1382 |

        | MultiplayerServerForbidden | 1384 |

        | MultiplayerServerInternalServerError | 1387 |

        | MultiplayerServerNotFound | 1385 |

        | MultiplayerServerTooManyRequests | 1380 |

        | MultiplayerServerUnauthorized | 1383 |

        | MultiplayerServerUnavailable | 1388 |

        | ProductDisabledForTitle | 1609 |
      operationId: RequestMultiplayerServer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestMultiplayerServerRequest'
        description: >-
          Requests a multiplayer server session from a particular build in any
          of the given preferred regions.
      responses:
        '200':
          $ref: '#/components/responses/RequestMultiplayerServerResponse'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security:
        - EntityToken: []
components:
  schemas:
    RequestMultiplayerServerRequest:
      description: >-
        Requests a multiplayer server session from a particular build in any of
        the given preferred regions.
      type: object
      properties:
        BuildAliasParams:
          allOf:
            - $ref: '#/components/schemas/BuildAliasParams'
          description: The identifiers of the build alias to use for the request.
        BuildId:
          description: The guid string build ID of the multiplayer server to request.
          type: string
        CustomTags:
          description: >-
            The optional custom tags associated with the request (e.g. build
            number, external trace identifiers, etc.).
          type: object
        InitialPlayers:
          description: >-
            Initial list of players (potentially matchmade) allowed to connect
            to the game. This list is passed to the game server when requested
            (via GSDK) and can be used to validate players connecting to it.
          type: array
          items:
            type: string
        PreferredRegions:
          description: >-
            The preferred regions to request a multiplayer server from. The
            Multiplayer Service will iterate through the regions in the
            specified order and allocate a server from the first one that has
            servers available.
          type: array
          items:
            $ref: '#/components/schemas/AzureRegion'
        SessionCookie:
          description: >-
            Data encoded as a string that is passed to the game server when
            requested. This can be used to communicate information such as game
            mode or map through the request flow. Maximum size is 8KB
          type: string
        SessionId:
          description: >-
            A guid string session ID created track the multiplayer server
            session over its life.
          type: string
      required:
        - SessionId
        - PreferredRegions
      example:
        BuildId: 21781fa8-096d-4d9c-b699-75433d579285
        SessionId: 02bdef0e-e01e-4b29-8efe-ff9f47a06d8c
        SessionCookie: U2Vzc2lvbkNvb2tpZQ==
        InitialPlayers:
          - gamer1
          - gamer2
        PreferredRegions:
          - SouthCentralUs
          - WestUs
    BuildAliasParams:
      type: object
      properties:
        AliasId:
          description: The guid string alias ID to use for the request.
          type: string
      required:
        - AliasId
    AzureRegion:
      type: string
      enum:
        - AustraliaEast
        - AustraliaSoutheast
        - BrazilSouth
        - CentralUs
        - EastAsia
        - EastUs
        - EastUs2
        - JapanEast
        - JapanWest
        - NorthCentralUs
        - NorthEurope
        - SouthCentralUs
        - SoutheastAsia
        - WestEurope
        - WestUs
        - SouthAfricaNorth
        - WestCentralUs
        - KoreaCentral
        - FranceCentral
        - WestUs2
        - CentralIndia
        - UaeNorth
        - UkSouth
        - SwedenCentral
        - CanadaCentral
        - MexicoCentral
        - WestUs3
        - CanadaEast
        - UkWest
        - FranceSouth
        - SouthIndia
        - SpainCentral
        - GermanyWestCentral
        - ItalyNorth
        - IndonesiaCentral
        - ChileCentral
        - PolandCentral
        - NewZealandNorth
        - BrazilSoutheast
        - NorwayEast
        - SwitzerlandNorth
        - MalaysiaWest
        - IsraelCentral
        - QatarCentral
        - UaeCentral
        - GermanyNorth
        - AustriaEast
        - BelgiumCentral
        - DenmarkEast
        - SwitzerlandWest
        - SwedenSouth
        - NorwayWest
        - SouthAfricaWest
        - MalaysiaSouth
    RequestMultiplayerServerResponse:
      type: object
      properties:
        BuildId:
          description: The identity of the build in which the server was allocated.
          type: string
        ConnectedPlayers:
          description: The connected players in the multiplayer server.
          type: array
          items:
            $ref: '#/components/schemas/ConnectedPlayer'
          x-isclass: true
        FQDN:
          description: >-
            The fully qualified domain name of the virtual machine that is
            hosting this multiplayer server.
          type: string
        IPV4Address:
          description: >-
            The public IPv4 address of the virtual machine that is hosting this
            multiplayer server.
          type: string
        LastStateTransitionTime:
          description: >-
            The time (UTC) at which a change in the multiplayer server state was
            observed.
          type: string
        Ports:
          description: The ports the multiplayer server uses.
          type: array
          items:
            $ref: '#/components/schemas/Port'
          x-isclass: true
        PublicIPV4Addresses:
          description: The list of public Ipv4 addresses associated with the server.
          type: array
          items:
            $ref: '#/components/schemas/PublicIpAddress'
          x-isclass: true
        Region:
          allOf:
            - $ref: '#/components/schemas/AzureRegion'
          description: The region the multiplayer server is located in.
        ServerId:
          description: The string server ID of the multiplayer server generated by PlayFab.
          type: string
        SessionId:
          description: The guid string session ID of the multiplayer server.
          type: string
        State:
          description: The state of the multiplayer server.
          type: string
        VmId:
          description: The virtual machine ID that the multiplayer server is located on.
          type: string
      example:
        SessionId: 02bdef0e-e01e-4b29-8efe-ff9f47a06d8c
        ServerId: AMultiplayerGameServer
        VmId: 80c00b02-a559-4961-9b31-4a04b39e26a6
        IPV4Address: 10.250.24.54
        FQDN: vm.azure.cloudapp.net
        Ports:
          - Name: PortName
            Num: 1243
        Region: SouthCentralUs
        State: Active
        ConnectedPlayers:
          - PlayerId: '10931352888739351331'
          - PlayerId: '10271352123739051532'
        BuildId: 4da1a0f6-7e36-430c-a264-723ff6a605de
    ApiErrorWrapper:
      description: The basic wrapper around every failed API response
      type: object
      properties:
        code:
          description: Numerical HTTP code
          type: integer
        status:
          description: String HTTP code
          type: string
        error:
          description: Playfab error code
          type: string
        errorCode:
          description: Numerical PlayFab error code
          type: integer
        errorMessage:
          description: Description for the PlayFab errorCode
          type: string
        errorDetails:
          description: Detailed description of individual issues with the request object
          type: object
      required:
        - code
        - errorCode
    ConnectedPlayer:
      type: object
      properties:
        PlayerId:
          description: The player ID of the player connected to the multiplayer server.
          type: string
    Port:
      type: object
      properties:
        Name:
          description: The name for the port.
          type: string
        Num:
          description: The number for the port.
          type: number
          x-actualtype: int32
        Protocol:
          allOf:
            - $ref: '#/components/schemas/ProtocolType'
          description: The protocol for the port.
      required:
        - Name
        - Num
        - Protocol
    PublicIpAddress:
      type: object
      properties:
        FQDN:
          description: FQDN of the public IP
          type: string
        IpAddress:
          description: Server IP Address
          type: string
        RoutingType:
          allOf:
            - $ref: '#/components/schemas/RoutingType'
          description: Routing Type of the public IP.
      required:
        - IpAddress
        - FQDN
        - RoutingType
    ProtocolType:
      type: string
      enum:
        - TCP
        - UDP
    RoutingType:
      type: string
      enum:
        - Microsoft
        - Internet
  responses:
    RequestMultiplayerServerResponse:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                description: >-
                  The Http status code. If X-ReportErrorAsSuccess header is set
                  to true, this will report the actual http error code.
              status:
                type: string
                description: The Http status code as a string.
              data:
                $ref: '#/components/schemas/RequestMultiplayerServerResponse'
            example:
              code: 200
              status: OK
              data:
                SessionId: 02bdef0e-e01e-4b29-8efe-ff9f47a06d8c
                ServerId: AMultiplayerGameServer
                VmId: 80c00b02-a559-4961-9b31-4a04b39e26a6
                IPV4Address: 10.250.24.54
                FQDN: vm.azure.cloudapp.net
                Ports:
                  - Name: PortName
                    Num: 1243
                Region: SouthCentralUs
                State: Active
                ConnectedPlayers:
                  - PlayerId: '10931352888739351331'
                  - PlayerId: '10271352123739051532'
                BuildId: 4da1a0f6-7e36-430c-a264-723ff6a605de
    ApiErrorWrapper:
      description: This is the outer wrapper for all responses with errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorWrapper'
  securitySchemes:
    EntityToken:
      type: apiKey
      in: header
      name: X-EntityToken
      description: >-
        This API requires an Entity Session Token, available from the Entity
        GetEntityToken method.

````

## Related topics

- [Request Multiplayer Server](/api-reference/multiplayerserver/request-multiplayer-server.md)
- [PFMultiplayerServerRequestMultiplayerServerRequest](/services/playfab/api-references/c/pfmultiplayerservertypes/structs/pfmultiplayerserverrequestmultiplayerserverrequest.md)
- [PFMultiplayerServerRequestMultiplayerServerAsync](/services/playfab/api-references/c/pfmultiplayerserver/functions/pfmultiplayerserverrequestmultiplayerserverasync.md)
- [PFMultiplayerServerRequestMultiplayerServerResponse](/services/playfab/api-references/c/pfmultiplayerservertypes/structs/pfmultiplayerserverrequestmultiplayerserverresponse.md)
- [PFMultiplayerServerRequestMultiplayerServerGetResult](/services/playfab/api-references/c/pfmultiplayerserver/functions/pfmultiplayerserverrequestmultiplayerservergetresult.md)
