Guides

Pools and players

A pool is one independent ladder. Most games need exactly one, and already have it.

The default pool

Every project starts with a default pool. Every call that takes a pool uses it when you leave the pool out, so a single-ladder game can skip this page. Create more pools only when you need separate ratings: one per game mode, queue or region.

Create a pool

curl -X POST https://api.inhouseranks.com/v1/pool/create \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Ranked 1v1", "kind": "community", "groupConfig": {} }'
Field What to send
name The pool's display name, at most 50 characters.
kind friends, community or competitive.
groupConfig {} is correct and sufficient. It's also where rank bands go.

Leave out mmrConfig and the pool rates with Elo, starting everyone at 1500.

The reply has the new pool, and its id:

{
  "group": {
    "_id": "6b01eb7991a8d0c2e72af67e",
    "name": "Ranked 1v1"
    // ...
  }
  // ...
}

Keep group._id. It's the pool's poolId, the name every later call knows it by: in a body ("poolId": "..."), a query (?poolId=) or a URL (/v1/pool/<poolId>). A pool has no id of your own, so store this one next to whatever the pool is for: a game mode, a queue, a region.

Use Glicko-2 or another starting rating

Send mmrConfig:

curl -X POST https://api.inhouseranks.com/v1/pool/create \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Arena",
    "kind": "competitive",
    "groupConfig": {},
    "mmrConfig": {
      "kind": "glicko2",
      "initialMmr": 1500,
      "glicko2": {
        "tau": 0.5,
        "initialRatingDeviation": 350,
        "initialVolatility": 0.06
      }
    }
  }'
  • glicko2.tau must be between 0.2 and 1.2. Anything else is refused with 400 Validation failed.
  • To change only the starting rating, send kind and initialMmr, and the engine's defaults fill in the rest: { "kind": "elo", "initialMmr": 1200 }. The same goes for a Glicko-2 config sent without its glicko2 block.

Not sure which to pick? Elo is simpler. Glicko-2 tracks how sure it is of each rating, so new players settle faster, and it's what placement matches and confidence-based hidden ratings need.

Read and list pools

To Call
Read one pool GET /v1/pool/<poolId>
Read the default pool GET /v1/pool
List your organization's pools GET /v1/pools
List the pools one player is rated in GET /v1/pools?mmrEntityExternalId=<yourUserId>

GET /v1/pools returns every pool in your organization, test and live, each with its _id. That makes it the place to look a poolId up again. If your players each own pools, that is the wrong list for a player's screen. Pass mmrEntityExternalId to get only the pools that player is rated in:

curl "https://api.inhouseranks.com/v1/pools?mmrEntityExternalId=bob" \
  -H "x-api-key: $INHOUSE_API_KEY"

A player is rated in a pool from the moment a match they're in is recorded there, or you create them in it. Being scored in a match that isn't recorded yet doesn't count. So a pool a player just made shows up only if you seeded them into it: creating a pool does not put its creator in it. Call /v1/user/create right after /v1/pool/create:

curl -X POST https://api.inhouseranks.com/v1/user/create \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "poolId": "6b01eb7991a8d0c2e72af67e",
    "mmrEntityExternalId": "bob",
    "name": "Bob"
  }'

An unknown mmrEntityExternalId returns an empty list, never the unfiltered one.

Add players ahead of time

You can skip this. A player is created the first time a recorded match names their mmrEntityExternalId. Call /v1/user/create only to set a display name that differs from the id, or to put a player in a pool before their first match.

curl -X POST https://api.inhouseranks.com/v1/user/create \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mmrEntityExternalId": "carol", "name": "Carol" }'
  • mmrEntityExternalId is your id for the player, the same value you send in match results. It's required, and at most 100 characters.
  • A player created by a match uses their mmrEntityExternalId as their name until you rename them. Calling /v1/user/create again with a name renames them: the call is idempotent per mmrEntityExternalId.
  • Use the same mmrEntityExternalId for a person in every pool. That's how they count as one player for billing.

Later changes to a player:

To Call
Correct a rating by hand POST /v1/user/update-rating
Rename, archive or restore a player POST /v1/mmr_entities/update
Bring players over with their ratings POST /v1/user/migrate

Change a pool's settings

/v1/pool/update changes a pool: its name, rating settings, rank bands, matchmaking rules and game settings. Two things to know:

  • Changes apply from now on. Existing ratings keep their values, and matches already created keep the settings they were created with.
  • mmrConfig, groupConfig, gameConfig and matchmakingRules each replace the whole value. Send all of it, not only the part you're changing.

The fields are under Update a pool.

End a season

/v1/pool/season/end ends a pool's season and starts the next one.

  • Every rating resets. Each player goes back to resetSkillRating, or to the pool's starting rating when you leave it out.
  • Records stay all-time. Wins, losses and match counts are kept. Each stats block notes where they stood when the season began (seasonStartWins, seasonStartMatchCount), so "this season" is the difference.
  • The ended season keeps the standings. The reply's endedSeason holds every player as they stood before the reset.
  • In a Glicko-2 pool, every rating deviation resets too, and open rating windows close first.

See End a season.