Skip to content

Create persistent rooms

Persistent rooms are created through the HTTP API. The relay does not accept a direct host claim from an arbitrary token; it selects a connected client and issues the claim token itself.

  1. Create the room from a trusted service

    Terminal window
    curl -X POST http://relay.example.com:7771/rooms \
    -H "Authorization: Bearer $BLITZ_RELAY_HTTP_ADMIN_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
    "maximumClients": 8,
    "displayName": "Ranked match",
    "isPublic": true,
    "metadata": {
    "region": "eu",
    "mode": "ranked"
    }
    }'

    Save the code from the response and return it to the players that should enter the room.

  2. Join the first player as a client

    Set the room code on the Unity transport and start the networking framework’s client side. Because the room has no host, the relay selects the earliest connected client for promotion.

  3. Let the transport acknowledge promotion

    Both official transports send HostPromotionAck automatically. The relay then disconnects that client so it can reconnect with the issued claim token.

  4. Complete the framework-specific transition

    The Fish-Networking transport stops the client, starts the server with the claim, then starts its local client automatically.

    The NGO transport stores the promotion data and raises OnHostPromotionReceived; your game must switch the NetworkManager lifecycle. Follow the NGO migration flow.

Clients that join while a claim is already pending receive JoinSuccess and HostUnavailable. They can remain connected until the promoted host claims the room.