Find Match
Finds an available host for matchmaking. The service scans all registered hosts, filters by region (if specified), and returns connection details for an idle host.Request Body
Geographic region filter for matchmaking. If provided, only hosts in the specified region will be considered.Supported values:
us-east-1, us-west-1, eu-central, localIf omitted, any available host from any region may be returned.Request Example
With region filter:Success Response (200 OK)
Returned when an available host is found.Always
true in a 200 response. Indicates a host was successfully matched.The room identifier for WebRTC signaling. Use this to join the signaling channel and establish a peer connection with the host.
WebSocket URL for the signaling server. Connect to this URL to exchange WebRTC offer/answer/ICE candidates.Format:
ws:// for development, wss:// for productionArray of ICE (Interactive Connectivity Establishment) server configurations for WebRTC.Each server object contains:
urls- STUN/TURN server URLusername- Temporary username for TURN authenticationcredential- Temporary password generated using shared secret with Coturn
Success Response Example
Not Found Response (404)
Returned when no available hosts match the criteria.Always
false in a 404 response. Indicates no hosts are currently available.Human-readable explanation of why no host was found.
Not Found Response Example
Possible 404 Scenarios
- No hosts are currently registered (no active heartbeats)
- All registered hosts have
status: "busy" - No hosts match the specified region filter
- All hosts in the region are busy
WebRTC Connection Flow
Once you receive a successful match response:-
Connect to signaling server:
-
Join the room:
-
Create peer connection with ICE servers:
- Exchange WebRTC signaling messages through the WebSocket connection
ICE Server Credentials
The TURN credentials are temporary and generated using a shared secret with Coturn. They expire after a configured time period.
username format is timestamp:user, where:
timestamp- Unix timestamp when the credential was generateduser- Generic user identifier
credential is a password hash computed from the timestamp and shared secret.
Regional Matchmaking
For optimal latency, specify a region close to the client:Error Handling
Rate Limiting
There are currently no rate limits enforced. However, avoid polling this endpoint repeatedly. Implement exponential backoff if retrying after a 404.