Python SDK — Matchmaking

Matchmaking — client.matchmaking / client.matchmaking_requests

list
client.matchmaking.list(search: str | None = None, limit: int | None = None, rules_cls: type | None = None) -> MatchmakingListResponse

Lists all available matchmaking lobbies with optional search and typed rules.

create (direct join)
client.matchmaking.create(
    player_token: str,
    matchmaking_name: str,
    max_players: int = 4,
    strict_full: bool = False,
    host_switch: bool = False,
    can_leave_room: bool = False,
    realtime_room: bool = False,
    password: str | None = None,
    player_data: Any = None,
    rules: Any = None,
) -> MatchmakingCreateResponse

Creates a lobby that players can join directly. For approval-based joins use client.matchmaking_requests.create(..., join_by_requests=True).

request_to_join
client.matchmaking_requests.request_to_join(player_token: str, matchmaking_id: str, player_data: Any = None) -> MatchmakingJoinRequestResponse

Requests to join a lobby that requires host approval.

respond
client.matchmaking_requests.respond(player_token: str, request_id: str, action: MatchmakingRequestAction) -> MatchmakingPermissionResponse

Host responds to a join request (MatchmakingRequestAction.APPROVE or REJECT).

check_status
client.matchmaking_requests.check_status(player_token: str, request_id: str) -> MatchmakingRequestStatusResponse

Checks the status of a join request.

get_current
client.matchmaking.get_current(player_token: str, rules_cls: type | None = None) -> MatchmakingCurrentResponse

Gets the current lobby status including pending join requests.

join
client.matchmaking.join(player_token: str, matchmaking_id: str, player_data: Any = None) -> MatchmakingDirectJoinResponse

Joins a matchmaking lobby directly (only if it doesn't require approval).

leave
client.matchmaking.leave(player_token: str) -> MatchmakingLeaveResponse

Leaves the current matchmaking lobby.

get_players
client.matchmaking.get_players(player_token: str, data_cls: type | None = None) -> MatchmakingPlayersResponse

Gets all players in the current lobby with typed player data.

heartbeat
client.matchmaking.heartbeat(player_token: str) -> MatchmakingHeartbeatResponse

Sends a heartbeat to maintain presence in the lobby.

remove
client.matchmaking.remove(player_token: str) -> MatchmakingRemoveResponse

Removes the matchmaking lobby (host only).

start
client.matchmaking.start(player_token: str) -> MatchmakingStartResponse

Starts the game: creates a game room and transfers all lobby players (host only).

stop
client.matchmaking.stop(player_token: str) -> MatchmakingStopResponse

Stops the matchmaking lobby (host only, before the game has started).

kick
client.matchmaking.kick(player_token: str, player_id: int) -> MatchmakingKickResponse

Kicks a player from the lobby (host only, before the game has started).

update_password
client.matchmaking.update_password(player_token: str, password: str | None = None) -> MatchmakingPasswordResponse

Updates the lobby password (host only, before the game has started). Pass None to remove it.