Get started

Inhouse API

Hosted skill ratings for multiplayer games. You send match results, and Inhouse keeps Elo or Glicko-2 ratings, win/loss records and leaderboards. It can also matchmake your players.

The API is server-to-server. Call it from your game server with a project API key, never from a game client.

  • Base URL: https://api.inhouseranks.com
  • Auth: send your key in the x-api-key header. A key looks like inhouse-<test|live>-<projectId>-<secret>.
  • Content type: application/json on every POST. Send {} rather than an empty body.
  • Get a key: the Inhouse Build portal → Credentials. A key belongs to one project. Treat it as a secret.
Building with a coding agent? Point it at /docs/llms-full.txt, every page of these docs as plain markdown, or the short index at /docs/llms.txt.

Quickstart

Two calls take you from an API key to a ranked leaderboard. There is nothing to set up first: every project has a default pool, and a player is created the first time a recorded match names them.

1. Record a match

curl -X POST https://api.inhouseranks.com/v1/match/record \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "matchExternalId": "m_1042",
    "ranked": true,
    "name": "Grand Final",
    "matchResult": {
      "teams": [
        { "place": 1, "constituents": [{ "mmrEntityExternalId": "alice" }] },
        { "place": 2, "constituents": [{ "mmrEntityExternalId": "bob" }] }
      ]
    }
  }'

place 1 is the winner. matchExternalId and each mmrEntityExternalId are your own ids. "ranked": true is what makes the match move ratings: it defaults to false.

The reply is the recorded match and each player's rating change:

{
  "match": {
    "_id": "6b01eb7991a8d0c2e72af670",
    "status": "recorded",
    "ranked": true,
    "externalId": "m_1042",
    "recordedAt": "2026-11-21T19:05:29.463796Z"
    // ...
  },
  "matchPlayers": [
    {
      "mmrEntityId": "6b01eb7991a8d0c2e72af66e",
      "mmrChanges": [{ "before": 1500, "after": 1516 /* ... */ }],
      "outcome": "win"
      // ...
    },
    {
      "mmrEntityId": "6b01eb7991a8d0c2e72af66f",
      "mmrChanges": [{ "before": 1500, "after": 1484 /* ... */ }],
      "outcome": "lose"
      // ...
    }
  ]
}

2. Read the leaderboard

curl https://api.inhouseranks.com/v1/pool/leaderboard \
  -H "x-api-key: $INHOUSE_API_KEY"
{
  "poolId": "6b01eb7991a8d0c2e72af66b",
  "leaderboard": [
    {
      "rank": 1,
      "mmrEntityExternalId": "alice",
      "mmrEntity": {
        "name": "alice",
        "stats": [
          {
            "mmr": { "value": 1516 /* ... */ },
            "wins": 1,
            "losses": 0
            // ...
          }
        ]
        // ...
      }
      // ...
    },
    {
      "rank": 2,
      "mmrEntityExternalId": "bob",
      "mmrEntity": {
        "name": "bob",
        "stats": [
          {
            "mmr": { "value": 1484 /* ... */ },
            "wins": 0,
            "losses": 1
            // ...
          }
        ]
        // ...
      }
      // ...
    }
  ],
  "page": 1,
  "pageSize": 25,
  "totalCount": 2,
  "hasMore": false
}

That's a working integration. Record matches covers team games, draws, scoring as results come in, and safe retries.

Matchmaking flow

How a match moves from queue to rating. Your game server is the only side that talks to Inhouse: it holds the API key, queues parties, receives webhooks and reports results. Game clients never call Inhouse.

  • Request you send
  • Response
  • Webhook Inhouse sends you
Game clientsno API keyYour game serverAPI key + webhook receiverInhouseAPI · matchmaker1QUEUEper party2MATCH FOUNDper match3PLAY4RECORD RESULTper matchParty wants to playyour own protocolPOST /v1/queue/joinplayers: [{mmrEntityExternalId}]one call per partyparty._idkeep it: events name parties by itJoin fails if the pool isn't set up400 webhook-not-configured404 default-matchmaking-rule-not-foundMatchmaker forms a lobbymatch.founddata.matchId · teams → parties → playerswinProbability per teamYour receiver mustcheck the Inhouse-Signature HMACanswer 2xx within 10 sdedupe on the event id2xxelse retried for ~2 min, then droppedparty.expired · party.cancelledno match: requeue or tell the playersSeat players, run the matchentirely yoursInhouse isn't involvedPOST /v1/match/recordmatchId: the event's data.matchIdscores: a place per teamId (or mmrEntityExternalId)Always send matchIdwithout it, record makes a new matchScored and ratedin this one callmatch.status: recordeda repeat gets 409 match-already-recorded
Requests go out from your game server with the API key. Matches come back by webhook, naming parties by the party._id that join returned. The result goes back in with the data.matchId from match.found.

Step by step

  1. 1

    Queue each party

    Call POST /v1/queue/join with players: [{mmrEntityExternalId}]. It's one call per party, so a 5v5 of solo players is 10 joins. Keep the returned party._id, because webhook events identify parties by it.

    Join returns 400 webhook-not-configured if the project has no webhook endpoint that receives match.found, and 404 default-matchmaking-rule-not-found if you didn't pass matchmakingRuleId and the pool has no rule marked "default": true.

  2. 2

    Receive the match by webhook

    match.found carries matchId and the teams. Each team lists its parties, each party its players ({mmrEntityExternalId, mmrEntity}), and each team has a winProbability. Your receiver must:

    • check the Inhouse-Signature header, t=<unix>,v1=<hex>, where v1 is the HMAC-SHA256 of "<t>.<raw body>" keyed by the endpoint's signing secret;
    • answer 2xx within 10 s. A failed attempt is retried after 4, 8, 16, 32 and 60 s (about 2 minutes in all), then dropped;
    • dedupe on the event id, which stays the same across retries.

    Also handle party.expired (the party waited its rule's maxQueueSeconds without a match) and party.cancelled (the queue gave up on the party; reason says why).

  3. 3

    Seat the players

    This part is entirely yours. Inhouse never hosts a match or connects players.

  4. 4

    Record the result

    One call: POST /v1/match/record with the event's data.matchId (as matchId) and the result in scores. It scores the match the matchmaker wrote and rates it in the same call.

    {
      "matchId": "<data.matchId>",
      "scores": [
        { "teamId": "<winningTeamId>", "place": 1 },
        { "teamId": "<losingTeamId>", "place": 2 }
      ]
    }
    • A scores entry names a team by its teamId from match.found, or a player by mmrEntityExternalId, and gives a place or pointsScored.
    • Always send the matchId. Without it, /match/record can't find this match: it answers 400 match-result-required, or writes a second match if you sent a matchResult.
    • Retrying is safe. A match is only rated once: if a /match/record timed out and you send it again, 409 match-already-recorded means the first call went through.
Mermaid source

The same flow as a Mermaid sequence diagram, for docs of your own that render Mermaid.

sequenceDiagram
    participant C as Game clients
    participant S as Your game server
    participant I as Inhouse

    Note over C,I: 1. Queue (one call per party)
    C->>S: Party wants to play (your own protocol)
    S->>I: POST /v1/queue/join (players[].mmrEntityExternalId)
    I-->>S: party._id (keep it)
    Note over S,I: Fails with 400 webhook-not-configured or 404 default-matchmaking-rule-not-found

    Note over S,I: 2. Match found
    Note over I: Matchmaker forms a lobby
    I->>S: webhook match.found (data.matchId, teams, winProbability)
    Note over S: Check Inhouse-Signature HMAC, dedupe on event id
    S-->>I: 2xx within 10 s (else retried for ~2 min, then dropped)
    I->>S: webhook party.expired or party.cancelled

    Note over C,I: 3. Play
    S->>C: Seat players, run the match (entirely yours)

    Note over S,I: 4. Record result
    S->>I: POST /v1/match/record (matchId = data.matchId, a place per teamId)
    Note over I: Scores and rates the match in this one call
    I-->>S: match recorded (a repeat gets 409 match-already-recorded)
    Note over S: Always send matchId, or record can't find this match

Where next

To Read
Learn the five objects the API is built on Core concepts
Record team games, draws and live scores Record matches
Show a top-players board or a player's rating Leaderboards and ratings
Run separate ladders per mode, queue or region Pools and players
Let Inhouse build the lobbies Matchmaking and Webhooks
Name ratings "Gold", hide new ratings, run placement matches Rank bands, Hidden ratings, Placement matches
Bring over players and history from another system Import and migrate
Know the quotas before you ship Limits and billing
Look up an endpoint, a field or an error code API reference