API reference

Matches

A match is a result: teams, their places, and who was on them. Only a recorded, ranked match moves ratings. For the flows these calls make up, see Record matches.

Record a match

POST/v1/match/record

Rates a match, in one call. You name the match by matchExternalId, your id for it, or by matchId, Inhouse's. What the call does depends on what that names:

The id names Result
No match yet: a matchExternalId not seen before, or no id sent The match is created from matchResult, then rated.
A match that isn't rated yet Any matchResult and scores sent are applied, then it's rated.
A match already recorded 409 match-already-recorded. Nothing changes.

A match is only ever created under your own id. A matchId that names no match is 404 match-not-found: Inhouse's ids are made by the server.

Body parameters

Field Type Required Description
matchExternalId string recommended Your id for the match. It makes a retry safe: without one, a retry writes a second match.
matchResult object for a new match The teams, their places and their players. See Match result. Sent with a match that exists, it replaces that match's result.
scores array no Results to set just before rating. See Scores.
ranked boolean no Defaults to false. Send true for the match to move ratings. A matchmade match is already ranked.
poolId string no The pool, for a new match. Defaults to the default pool.
name string no A label, at most 80 characters.
description string no A longer label, at most 300 characters.

When any team has no place, places are worked out from pointsScored by the pool's winCondition.

Request

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" }] }
      ]
    }
  }'

To rate a match that already exists, name it: by the matchId its match.found event gave you, or by your own matchExternalId. Send any last results in scores:

curl -X POST https://api.inhouseranks.com/v1/match/record \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "matchId": "6b01eb7991a8d0c2e72af694",
    "scores": [
      { "teamId": "<teamAId>", "place": 1 },
      { "teamId": "<teamBId>", "place": 2 }
    ]
  }'

Response 200

{
  "match": {
    "_id": "6b01eb7991a8d0c2e72af670",
    "poolId": "6b01eb7991a8d0c2e72af66b",
    "createdAt": "2026-11-21T19:05:29.446480Z",
    "status": "recorded",
    "result": {
      "teams": [
        {
          "id": "<teamAId>",
          "place": 1,
          "pointsScored": null,
          "caption": null,
          "constituents": [
            {
              "mmrEntityId": "6b01eb7991a8d0c2e72af66e",
              "mmrEntityExternalId": "alice",
              "positionId": null,
              "caption": null
              // ...
            }
          ],
          "calculations": {
            "startingMmr": 1500,
            "originalPlace": 1,
            "reassignedPlace": 1,
            "normalizedPlace": 1,
            "teamAdvantage": 0,
            "playerAdvantages": 0,
            "mmrWithAdvantages": 1500,
            "outcome": "win",
            "finalMmr": 1516
          }
        }
        // ... 1 more
      ]
    },
    "ranked": true,
    "name": "Grand Final",
    "externalId": "m_1042",
    "recordedAt": "2026-11-21T19:05:29.463796Z"
    // ...
  },
  "matchPlayers": [
    {
      "_id": "6b01eb7991a8d0c2e72af671",
      "teamId": "<teamAId>",
      "matchId": "6b01eb7991a8d0c2e72af670",
      "mmrEntityId": "6b01eb7991a8d0c2e72af66e",
      "mmrEntityExternalId": "alice",
      "mmrChanges": [
        {
          "positionId": null,
          "multiplier": null,
          "advantage": null,
          "before": 1500,
          "after": 1516,
          "bonus": null
        }
      ],
      "pointsScored": null,
      "outcome": "win",
      "ratingWindow": null
      // ...
    }
    // ... 1 more
  ]
}
Key Contains
match The match, now recorded, with recordedAt and each team's calculations.
matchPlayers One match player per player. mmrChanges[].before and after are their rating change.

Errors

Status code When
400 match-result-required No match named and no matchResult: there is nothing to create the match from.
400 match-has-unplaced-teams The teams have neither places nor points. A new match is refused before anything is written.
400 min-two-teams-required The match has fewer than two teams, for example after /match/score named only one player. It stays pending.
400 match-not-pending You sent a matchResult for a match that is written but not rated: retry with only the match's id. Or another call is rating the match right now: retry shortly.
400 team-not-in-match, player-not-in-match A scores entry names a team or player the match doesn't have.
400 conflicting-scores Two scores entries give one team different places or points.
400 others A malformed matchResult or scores entry. See Match results and scores.
402 over-plan-limit A monthly allowance is spent. Nothing was written or rated.
404 match-not-found A matchId that names no match. Or a matchExternalId that names none, sent with no matchResult to create it from.
409 match-already-recorded The match is already recorded. After a timed-out call, this means the first one went through.
409 player-in-queue A player of a new match is waiting in the pool's matchmaking queue. mmrEntityExternalIds (and userExternalIds) names them.
409 rating-update-conflict The call kept losing to other writes to the same players. Nothing changed. Send it again.

Score a match

POST/v1/match/score

Sets scores on a pending match, for one or many players at a time. Only the players you list change. It never rates and never assigns places.

If matchExternalId names a match that doesn't exist yet, this call creates it. It has to be your id: Inhouse's ids are made by the server, so a matchId that names no match is a 404. Sending the same body twice is safe.

Body parameters

Field Type Required Description
matchExternalId string yes Your id for the match. An id not seen before opens a new match.
scores array yes At least one { mmrEntityExternalId, pointsScored?, caption? }. A player can also be named by mmrEntityId, or by their user names. A player not yet in the match is added as a team of their own.
poolId string no Used when this call creates the match: the pool. Defaults to the default pool.
ranked boolean no Defaults to false. On a match that exists, overwrites what's stored.
name, description string no Labels. On a match that exists, they overwrite what's stored (null or "" clears).
matchResult object no Used when this call creates the match. Defaults to no teams. Ignored on a match that exists.

Request

curl -X POST https://api.inhouseranks.com/v1/match/score \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "matchExternalId": "m_1043",
    "ranked": true,
    "scores": [
      {
        "mmrEntityExternalId": "alice",
        "pointsScored": 12,
        "caption": "clean run"
      }
    ]
  }'

Response 200

{
  "match": {
    "_id": "6b01eb7991a8d0c2e72af673",
    "status": "pending",
    "result": {
      "teams": [
        {
          "id": "<teamAId>",
          "place": null,
          "pointsScored": 12,
          "caption": "clean run",
          "constituents": [
            {
              "mmrEntityId": "6b01eb7991a8d0c2e72af66e",
              "mmrEntityExternalId": null,
              "positionId": null,
              "caption": null
              // ...
            }
          ],
          "calculations": null
        }
      ]
    },
    "ranked": true,
    "externalId": "m_1043"
    // ...
  }
}

match is the match, still pending.

Errors

Status code When
400 no-scores scores is empty.
400 match-not-pending The match is already recorded.
400 player-not-in-match The pool's game declares teams, and a scored player isn't in the match. Adding players on the fly needs the default, team-less pool.
400 others A malformed scores entry. See Match results and scores.
402 over-plan-limit Opening the match would exceed your monthly matches.
404 match-not-found A matchId that names no match. To open a new match, send your own matchExternalId.
409 player-in-queue A player this call would add to a match is waiting in the pool's matchmaking queue.

Create a pending match

POST/v1/match/create

Writes a match as pending, unrated, so you can edit or score it before /match/record. Optional: /match/score opens a match by itself.

Body parameters

Field Type Required Description
matchResult object yes See Match result. { "teams": [] } is valid.
matchExternalId string no Your id for the match.
poolId string no The pool. Defaults to the default pool.
ranked boolean no Defaults to false.
name, description string no Labels.

Request

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

Response 200

{
  "match": {
    "_id": "6b01eb7991a8d0c2e72af67d",
    "status": "pending",
    "result": {
      "teams": [
        {
          "id": "<teamAId>",
          "place": 1,
          "pointsScored": null,
          "caption": null,
          "constituents": [
            {
              "mmrEntityId": null,
              "mmrEntityExternalId": "bob",
              "positionId": null,
              "caption": null
              // ...
            }
          ],
          "calculations": null
        }
        // ... 1 more
      ]
    },
    "ranked": true,
    "externalId": "m_1045"
    // ...
  },
  "matchPlayers": []
}

matchPlayers is empty until the match is rated.

Errors

Status code When
400 match-external-id-exists Another match in your project already has this matchExternalId. (/match/record treats a used matchExternalId as that match instead.)
400 others A malformed matchResult. See Match results and scores.
402 over-plan-limit The match would exceed your monthly matches.
409 player-in-queue A player is waiting in the pool's matchmaking queue.

Update a match

POST/v1/match/update

Patches a match. Only the fields you send are written.

Body parameters

Field Type Required Description
matchExternalId string yes The match.
name, description string or null no Labels. Changeable in any status. null or "" clears one, and leaving it out keeps it.
matchResult object no Replaces the whole result. pending matches only.
ranked boolean no pending matches only.

Request

curl -X POST https://api.inhouseranks.com/v1/match/update \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "matchExternalId": "m_1045", "name": "Grand Final (replay)" }'

Response 200

{
  "match": {
    "_id": "6b01eb7991a8d0c2e72af67d",
    "status": "pending",
    "externalId": "m_1045",
    "name": "Grand Final (replay)"
    // ...
  }
}

Errors

Status code When
400 match-id-required No matchExternalId or matchId.
400 match-not-pending matchResult or ranked sent for a match that is already recorded. Renaming works in any status.
400 others A malformed matchResult. See Match results and scores.
404 match-not-found No such match.
409 player-in-queue The new result adds a player who is waiting in the pool's matchmaking queue.

Delete a match

POST/v1/match/delete

Deletes a pending match. A recorded match can't be deleted.

Body parameters

Field Type Required Description
matchExternalId string yes The match.

Request

curl -X POST https://api.inhouseranks.com/v1/match/delete \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "matchExternalId": "m_1045" }'

Response 200

{ "matchId": "6b01eb7991a8d0c2e72af67d" }

matchId is Inhouse's id for the deleted match.

Errors

Status code When
400 match-id-required No matchExternalId or matchId.
400 match-not-pending The match is already recorded.
404 match-not-found No such match.

Get a match

GET/v1/match/get

Returns one match with its players.

Parameters

Parameter In Required Description
matchExternalId query yes Your id for the match.

Request

curl "https://api.inhouseranks.com/v1/match/get?matchExternalId=m_1042" \
  -H "x-api-key: $INHOUSE_API_KEY"

Response 200

{
  "match": {
    "_id": "6b01eb7991a8d0c2e72af670",
    "name": "Grand Final",
    "recordedAt": "2026-11-21T19:05:29.463796Z",
    "status": "recorded",
    "ranked": true,
    "result": {
      "teams": [
        {
          "id": "<teamAId>",
          "place": 1,
          "constituents": [
            {
              "mmrEntityId": "6b01eb7991a8d0c2e72af66e",
              "mmrEntityExternalId": "alice"
              // ...
            }
          ]
          // ...
        }
        // ... 1 more
      ]
    },
    "externalId": "m_1042",
    "matchPlayers": [
      {
        "teamId": "<teamAId>",
        "mmrEntityId": "6b01eb7991a8d0c2e72af66e",
        "mmrChanges": [
          {
            "positionId": null,
            "multiplier": null,
            "advantage": null,
            "before": 1500,
            "after": 1516,
            "bonus": null
          }
        ],
        "outcome": "win",
        "mmrEntity": {
          "_id": "6b01eb7991a8d0c2e72af66e",
          "name": "alice",
          "externalId": "alice"
          // ...
        }
        // ...
      }
      // ... 1 more
    ]
    // ...
  }
}

match is the match plus matchPlayers: its match players, each with the player's mmrEntity as it is now.

Errors

Status code When
400 match-id-required No matchExternalId or matchId.
404 match-not-found No such match.

List matches

GET/v1/match/list

A pool's match history, newest first, 10 per page.

Parameters

Parameter In Required Description
poolId query no The pool. Defaults to the default pool.
page query no Starts at 0. Default 0. page=1 is the second page.
status query no recorded (default), or pending for matches not yet rated.

Request

curl https://api.inhouseranks.com/v1/match/list \
  -H "x-api-key: $INHOUSE_API_KEY"

Response 200

{
  "matches": [
    {
      "_id": "6b01eb7991a8d0c2e72af678",
      "name": null,
      "recordedAt": "2026-11-21T19:05:29.559434Z",
      "status": "recorded",
      "ranked": true,
      "externalId": "m_1044"
      // ...
    },
    {
      "_id": "6b01eb7991a8d0c2e72af673",
      "name": null,
      "recordedAt": "2026-11-21T19:05:29.541312Z",
      "status": "recorded",
      "ranked": true,
      "externalId": "m_1043"
      // ...
    }
    // ... 1 more
  ],
  "page": 0,
  "pageSize": 10,
  "totalCount": 3,
  "hasMore": false
}

Each element of matches is a match as Get a match returns it.

Errors

Status code When
400 invalid-pagination page isn't a whole number from 0 up.

Import matches

POST/v1/match/import

Records and rates many old matches in one call, oldest first. Each match is a free-for-all, and players are matched by name: an unknown name creates a rated user without an mmrEntityExternalId. Read Import match history first.

Body parameters

Field Type Required Description
matches array yes 1 to 1000 matches, each { playDate, title?, players }.
matches[].playDate string yes When the match was played, as an ISO 8601 time.
matches[].title string no A label for the match.
matches[].players array yes At least two { name, placement, score?, role? }. placement (or rank) decides the result. score and role only go into the player's caption.
poolId string no The pool. Defaults to the default pool.
ranked boolean no Defaults to true here.
source, data string, object no Instead of matches: "source": "bgstats" with a BG Stats export in data.

Request

curl -X POST https://api.inhouseranks.com/v1/match/import \
  -H "x-api-key: $INHOUSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "poolId": "6b01eb7991a8d0c2e72af67e",
    "matches": [
      {
        "playDate": "2024-05-01T19:30:00Z",
        "title": "Week 1",
        "players": [
          { "name": "Alice", "placement": 1, "score": 21 },
          { "name": "Bob", "placement": 2, "score": 17 }
        ]
      }
    ]
  }'

Response 200

{
  "passedCount": 1,
  "failedCount": 0,
  "passed": [
    {
      "index": 0,
      "matchId": "6b01eb7991a8d0c2e72af683",
      "playDate": "2024-05-01T19:30:00.000Z"
    }
  ],
  "failed": []
}
Key Contains
passedCount, passed The matches that were recorded and rated.
failedCount, failed The first match that couldn't be recorded, with its code, and every match after it as not-processed.

The import stops at the first match that fails and still answers 200. Check failedCount.

Errors

Status code When
400 no-matches matches is missing or empty.
400 too-many-matches More than 1000 matches. max is the limit.
400 invalid-import Some matches are malformed, and nothing was written. errors holds one { index, code } per bad match.
400 invalid-source, invalid-bgstats-data A source other than default or bgstats (allowed lists them), or "source": "bgstats" without a data object.

A bad match's code in errors is one of match-not-an-object, invalid-play-date, min-two-players-required, player-not-an-object, player-missing-name, duplicate-player or player-missing-placement.