Prerequisites
- A PlayFlow project (free tier works — sign up here)
- Your Client API Key (from Project Settings → starts with
pfclient_)
This quickstart assumes no player-auth provider is configured on the project (the free-tier default), so the
x-player-id header names the player. If you’ve set up JWT, PlayFab, or Steam auth, client-key calls must send a valid x-player-token instead — see the player authentication guide.1. Create a Lobby
A lobby is created by a “host” player. The host is whoever sends thex-player-id header on the create request.
You just made a lobby. No dashboard config was needed — PlayFlow used defaults. Note the
code field: that’s the invite code your players share.About {config}
The default in the URL is a lobby config name. If no config with that name exists in your dashboard, PlayFlow uses sensible defaults:
timeout: 300sserverSize: small- Build: latest
default
maxPlayers isn’t a config default — it comes from the create request body (omit it and you get 2). Set it explicitly on each create call, as shown above.
For production games, you’ll create named configs in the dashboard (casual, ranked_2v2, etc.) with custom matchmaking rules and server overrides. But you don’t need to yet.
2. Join as a Second Player
Share the invite codeMEOW-42 with your friend. They call:
3. Check Your Current Lobby
Any player can check which lobby they’re in using/me:
404.
4. Update Player State
Ready up, pick a character, set your MMR — anything goes in player state. The server merges your updates into existing state.player2’s updated state:
State updates merge — existing keys are preserved unless overwritten. Setting
ready: true doesn’t wipe out team: blue.5. Start the Game
When ready, the host launches a game server directly:server populated:
server.network_ports[0].host and server.network_ports[0].external_port to connect your game client. The server block is the same shape as GET /v3/servers/{instance_id}. The server transitions from launching → running in typically 10-30 seconds.
6. Leave (Cleanup)
Every player leaves with:{"status": "lobby_deleted"}.
If the host leaves while others remain, host transfers to the next player automatically.
That’s It
You’ve now exercised the full lobby lifecycle using just 6 API calls. The full API adds matchmaking, host-only actions (kick, settings), invite code joining, lobby browsing, real-time SSE updates, and more — but this is the 80% of what most games need.Lobby Lifecycle
Host-only actions (kick, settings, transfer host), leaving behavior, error handling.
Matchmaking
Skip the manual “start” — let PlayFlow find opponents automatically.
Real-time Events
Stop polling. Subscribe to live events with SSE.
API Reference
Every endpoint with full schemas and try-it-out.