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

# Join Arranged Lobby

> Join an Arranged lobby.

Allowed entity token types: title_player_account

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| LobbyBadRequest | 13007 |
| LobbyMemberCannotRejoin | 13004 |
| LobbyNotJoinable | 13003 |
| LobbyPlayerAlreadyJoined | 13002 |
| LobbyPlayerMaxLobbyLimitExceeded | 13008 |
| LobbyRateLimitExceeded | 13001 |




## OpenAPI

````yaml /services/playfab/api-references/rest/multiplayer/multiplayer.openapi.json post /Lobby/JoinArrangedLobby
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/JoinArrangedLobby:
    post:
      tags:
        - Lobby
      summary: Join Arranged Lobby
      description: |
        Join an Arranged lobby.

        Allowed entity token types: title_player_account

        ## Error codes

        This operation may return the following PlayFab errors:

        | Error | Code |
        | --- | --- |
        | LobbyBadRequest | 13007 |
        | LobbyMemberCannotRejoin | 13004 |
        | LobbyNotJoinable | 13003 |
        | LobbyPlayerAlreadyJoined | 13002 |
        | LobbyPlayerMaxLobbyLimitExceeded | 13008 |
        | LobbyRateLimitExceeded | 13001 |
      operationId: JoinArrangedLobby
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JoinArrangedLobbyRequest'
        description: >-
          Request to join an arranged lobby. Only a client can join an arranged
          lobby.
      responses:
        '200':
          $ref: '#/components/responses/JoinLobbyResult'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security:
        - EntityToken: []
components:
  schemas:
    JoinArrangedLobbyRequest:
      description: >-
        Request to join an arranged lobby. Only a client can join an arranged
        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.
        ArrangementString:
          description: >-
            A field which indicates which lobby the user will be joining. This
            field is opaque to everyone except the Lobby service and the creator
            of the arrangementString (Matchmaking). This string defines a unique
            identifier for the arranged lobby as well as the title and member
            the string is valid for. Arrangement strings have an expiration.
          type: string
        CustomTags:
          description: >-
            The optional custom tags associated with the request (e.g. build
            number, external trace identifiers, etc.).
          type: object
        MaxPlayers:
          description: >-
            The maximum number of players allowed in the lobby. The value must
            be between 2 and 128.
          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. 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.
          type: object
        MemberEntity:
          allOf:
            - $ref: '#/components/schemas/EntityKey'
          description: >-
            The member entity who is joining the lobby. The first member to join
            will be the lobby owner.
        OwnerMigrationPolicy:
          allOf:
            - $ref: '#/components/schemas/OwnerMigrationPolicy'
          description: >-
            The policy for how a new owner is chosen. May be 'Automatic',
            'Manual' or 'None'. Can only be specified by clients. If
            client-owned and 'Automatic' - The Lobby service will automatically
            assign another connected owner when the current owner leaves or
            disconnects. The useConnections property 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.
        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.
            Defaults to false if not specified. Restricted to client owned
            lobbies.
          type: boolean
        UseConnections:
          description: >-
            A setting to control whether connections are used. Defaults to true.
            When true, notifications are sent to subscribed players, disconnect
            detection removes connectionHandles, only owner migration policies
            using connections are allowed, and lobbies must have at least one
            connected member to be searchable or be a server hosted lobby with a
            connected server. If false, then notifications are not sent,
            connections are not allowed, and lobbies do not need connections to
            be searchable.
          type: boolean
      required:
        - MaxPlayers
        - UseConnections
        - MemberEntity
        - ArrangementString
        - RestrictInvitesToLobbyOwner
      example:
        MaxPlayers: 50
        OwnerMigrationPolicy: Automatic
        UseConnections: true
        AccessPolicy: Public
        MemberEntity:
          Id: '1234'
          Type: title_player_account
          TypeString: title_player_account
        ArrangementString: arrangementString
        MemberData:
          MyMemberKey: MyMemberKey value
    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
    OwnerMigrationPolicy:
      type: string
      enum:
        - None
        - Automatic
        - Manual
        - Server
    JoinLobbyResult:
      type: object
      properties:
        LobbyId:
          description: Successfully joined lobby's id.
          type: string
      required:
        - LobbyId
    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:
    JoinLobbyResult:
      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/JoinLobbyResult'
    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

- [Join Arranged Lobby](/services/playfab/api-references/rest/multiplayer/lobby/join-arranged-lobby.md)
- [PFMultiplayerJoinArrangedLobby](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerjoinarrangedlobby.md)
- [PFLobbyJoinArrangedLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyjoinarrangedlobbycompletedstatechange.md)
- [PlayFabMultiplayer.JoinArrangedLobby](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/JoinArrangedLobby.md)
- [PlayFabMultiplayer.OnLobbyJoinArrangedLobbyCompleted](/services/playfab/multiplayer/lobby/unity-multiplayer-api-reference/PlayFab.Multiplayer/PlayFabMultiplayer/OnLobbyJoinArrangedLobbyCompleted.md)
