> ## 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.

# Update Lobby

> Update a lobby.

Allowed entity token types: game_server, title_player_account

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| LobbyBadRequest | 13007 |
| LobbyCurrentOwnerStillConnected | 13010 |
| LobbyCurrentPlayersMoreThanMaxPlayers | 13005 |
| LobbyDoesNotExist | 13000 |
| LobbyMemberIsNotOwner | 13011 |
| LobbyNewOwnerMustBeConnected | 13009 |
| LobbyRateLimitExceeded | 13001 |




## OpenAPI

````yaml /services/playfab/api-references/rest/multiplayer/multiplayer.openapi.json post /Lobby/UpdateLobby
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:
  /Lobby/UpdateLobby:
    post:
      tags:
        - Lobby
      summary: Update Lobby
      description: |
        Update a lobby.

        Allowed entity token types: game_server, title_player_account

        ## Error codes

        This operation may return the following PlayFab errors:

        | Error | Code |
        | --- | --- |
        | LobbyBadRequest | 13007 |
        | LobbyCurrentOwnerStillConnected | 13010 |
        | LobbyCurrentPlayersMoreThanMaxPlayers | 13005 |
        | LobbyDoesNotExist | 13000 |
        | LobbyMemberIsNotOwner | 13011 |
        | LobbyNewOwnerMustBeConnected | 13009 |
        | LobbyRateLimitExceeded | 13001 |
      operationId: UpdateLobby
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLobbyRequest'
        description: Request to update a lobby.
      responses:
        '200':
          $ref: '#/components/responses/LobbyEmptyResult'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security:
        - EntityToken: []
components:
  schemas:
    UpdateLobbyRequest:
      description: Request to update a lobby.
      type: object
      properties:
        AccessPolicy:
          allOf:
            - $ref: '#/components/schemas/AccessPolicy'
          description: >-
            The policy indicating who is allowed to join the lobby, and the
            visibility to queries. May be 'Public', 'Friends' or 'Private'.
            Public means the lobby is both visible in queries and any player may
            join, including invited players. Friends means that users who are
            bidirectional friends of members in the lobby may search to find
            friend lobbies, to retrieve its connection string. Private means the
            lobby is not visible in queries, and a player must receive an
            invitation to join. Defaults to 'Public' on creation. Can only be
            changed by the lobby owner.
        CustomTags:
          description: >-
            The optional custom tags associated with the request (e.g. build
            number, external trace identifiers, etc.).
          type: object
        LobbyData:
          description: >-
            The private key-value pairs which are visible to all entities in the
            lobby. Optional. Sets or updates key-value pairs on the lobby. Only
            the current lobby owner can set lobby data. Keys may be an arbitrary
            string of at most 30 characters. The total size of all lobbyData
            values may not exceed 4096 bytes. Values are not individually
            limited. There can be up to 30 key-value pairs stored here. Keys are
            case sensitive.
          type: object
        LobbyDataToDelete:
          description: >-
            The keys to delete from the lobby LobbyData. Optional. Behaves
            similar to searchDataToDelete, but applies to lobbyData.
          type: array
          items:
            type: string
        LobbyId:
          description: The id of the lobby.
          type: string
        MaxPlayers:
          description: >-
            The maximum number of players allowed in the lobby. Updates the
            maximum allowed number of players in the lobby. Only the current
            lobby owner can set this. If set, the value must be greater than or
            equal to the number of members currently in the lobby.
          type: number
          x-actualtype: uint32
        MemberData:
          description: >-
            The private key-value pairs used by the member to communicate
            information to other members and the owner. Optional. Sets or
            updates new key-value pairs on the caller's member data. New keys
            will be added with their values and existing keys will be updated
            with the new values. Visible to all entities in the lobby. At most
            30 key-value pairs may be stored here, keys are limited to 30
            characters and values to 1000. The total size of all memberData
            values may not exceed 4096 bytes. Keys are case sensitive. Servers
            cannot specifiy this.
          type: object
        MemberDataToDelete:
          description: >-
            The keys to delete from the lobby MemberData. Optional. Deletes
            key-value pairs on the caller's member data. All the specified keys
            will be removed from the caller's member data. Keys that do not
            exist are a no-op. If the key to delete exists in the memberData
            (same request) it will result in a bad request. Servers cannot
            specifiy this.
          type: array
          items:
            type: string
        MemberEntity:
          allOf:
            - $ref: '#/components/schemas/EntityKey'
          description: >-
            The member entity whose data is being modified. Servers cannot
            specify this.
        MembershipLock:
          allOf:
            - $ref: '#/components/schemas/MembershipLock'
          description: >-
            A setting indicating whether the lobby is locked. May be 'Unlocked'
            or 'Locked'. When Locked new members are not allowed to join.
            Defaults to 'Unlocked' on creation. Can only be changed by the lobby
            owner.
        Owner:
          allOf:
            - $ref: '#/components/schemas/EntityKey'
          description: >-
            The lobby owner. Optional. Set to transfer ownership of the lobby.
            If client - owned and 'Automatic' - The Lobby service will
            automatically assign another connected owner when the current owner
            leaves or disconnects. useConnections must be true. If client -
            owned and 'Manual' - Ownership is protected as long as the current
            owner is connected. If the current owner leaves or disconnects any
            member may set themselves as the current owner. The useConnections
            property must be true. If client-owned and 'None' - Any member can
            set ownership. The useConnections property can be either true or
            false. For all client-owned lobbies when the owner leaves and a new
            owner can not be automatically selected - The owner field is set to
            null. For all client-owned lobbies when the owner disconnects and a
            new owner can not be automatically selected - The owner field
            remains unchanged and the current owner retains all owner abilities
            for the lobby. If server-owned (must be 'Server') - Any server can
            set ownership. The useConnections property must be true.
        RestrictInvitesToLobbyOwner:
          description: >-
            A setting that controls whether only the lobby owner can send
            invites to join the lobby. When true, only the lobby owner can send
            invites. When false or not specified, any member can send invites.
            Will not modify current configuration if not specified. Restricted
            to client owned lobbies.
          type: boolean
        SearchData:
          description: >-
            The public key-value pairs which allow queries to differentiate
            between lobbies. Optional. Sets or updates key-value pairs on the
            lobby for use with queries. Only the current lobby owner can set
            search data. New keys will be added with their values and existing
            keys will be updated with the new values. There can be up to 30
            key-value pairs stored here. Keys are of the format string_key1,
            string_key2... string_key30 for string values, or number_key1,
            number_key2, ... number_key30 for numeric values. Numeric values are
            floats. Values can be at most 256 characters long. The total size of
            all searchData values may not exceed 1024 bytes.Keys are case
            sensitive.
          type: object
        SearchDataToDelete:
          description: >-
            The keys to delete from the lobby SearchData. Optional. Deletes
            key-value pairs on the lobby. Only the current lobby owner can
            delete search data. All the specified keys will be removed from the
            search data. Keys that do not exist in the lobby are a no-op.If the
            key to delete exists in the searchData (same request) it will result
            in a bad request.
          type: array
          items:
            type: string
      example:
        LobbyId: 12345678-1234-1234-1234-123456789ABC
        MaxPlayers: 50
        AccessPolicy: Friends
        MembershipLock: Locked
        SearchData:
          string_key1: searchable value
        LobbyData:
          MyGameKey: MyGameKey value
        MemberEntity:
          Id: '1234'
          Type: title_player_account
          TypeString: title_player_account
        MemberData:
          MyDataKey: MyDataKey updated value
        SearchDataToDelete:
          - number_key1
        LobbyDataToDelete:
          - MyOldGameKey
        MemberDataToDelete: []
    AccessPolicy:
      type: string
      enum:
        - Public
        - Friends
        - Private
    EntityKey:
      description: >-
        Combined entity type and ID structure which uniquely identifies a single
        entity.
      type: object
      properties:
        Id:
          description: Unique ID of the entity.
          type: string
        Type:
          description: >-
            Entity type. See
            https://learn.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types
          type: string
      required:
        - Id
    MembershipLock:
      type: string
      enum:
        - Unlocked
        - Locked
    LobbyEmptyResult:
      type: object
      properties: {}
    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
  responses:
    LobbyEmptyResult:
      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/LobbyEmptyResult'
    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

- [Update Lobby](/services/playfab/api-references/rest/multiplayer/lobby/update-lobby.md)
- [Update Lobby As Server](/api-reference/lobby/update-lobby-as-server.md)
- [Lobby.ServerPostUpdate](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/ServerPostUpdate.md)
- [Lobby ownership](/services/playfab/multiplayer/lobby/owner-requirements-and-privileges.md)
- [Lobby.PostUpdate](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/Lobby/PostUpdate.md)
