Guides

Webhooks

Inhouse tells your server what the matchmaker did by sending events to your project's webhook endpoints. Add them in the portal, on the Webhooks page. Test and live each have their own.

Endpoints

An endpoint is a URL on your server, the events it receives, and a signing secret of its own. A project has up to 5.

  • Each endpoint receives the event types you choose, or all of them. An endpoint set to all events also gets any type added later.
  • An event goes to every endpoint that receives its type. Each gets the same body, with the same id, signed with that endpoint's secret.
  • Each endpoint is sent, retried and logged on its own. One that is down or slow doesn't hold back the others.
  • /queue/join needs one endpoint that receives match.found. Without one it answers 400 webhook-not-configured: a formed match is announced no other way.

The portal shows each endpoint's deliveries, and its Event catalog lists every field of every event with its type and meaning.

Events

type Sent when data
match.found A lobby formed. One event per match. The match, and its teams, parties and players. See Handle match.found.
party.expired A party waited its rule's maxQueueSeconds without a lobby. The party.
party.cancelled The queue gave up on a party. The party, plus reason.
webhook.test You pressed Send test event on an endpoint in the portal. It goes to that endpoint only, whatever events it receives. { projectId, webhookId }. Never retried.

Every event has the same envelope: id, type, createdAt and data.

{
  "id": "6b01eb7991a8d0c2e72af699",
  "type": "party.expired",
  "createdAt": "2026-11-21T19:15:29.812613Z",
  "data": {
    "partyId": "6b01eb7991a8d0c2e72af698",
    "partyExternalId": "party-erin",
    "poolId": "6b01eb7991a8d0c2e72af66b",
    "matchmakingRuleId": "ranked-1v1",
    "regionIds": [],
    "players": [{ "mmrEntityExternalId": "erin", "userExternalId": "erin" }]
  }
}

party.cancelled carries the same data plus a reason:

{
  "id": "6b01eb7991a8d0c2e72af68b",
  "type": "party.cancelled",
  "createdAt": "2026-11-21T19:05:29.707698Z",
  "data": {
    "partyId": "6b01eb7991a8d0c2e72af68a",
    "partyExternalId": "squad-7",
    "poolId": "6b01eb7991a8d0c2e72af687",
    "matchmakingRuleId": "ranked-5v5",
    "regionIds": [],
    "players": [
      { "mmrEntityExternalId": "gina", "userExternalId": "gina" },
      { "mmrEntityExternalId": "hugo", "userExternalId": "hugo" }
    ],
    "reason": "rule-removed"
  }
}
reason Meaning
rule-removed The rule or its pool is gone.
region-removed The queue no longer offers any of the regions the party listed: the project's, the pool's or the rule's regions changed while it waited. See Regions.
over-plan-limit Your plan couldn't take the lobby's match. Either the match allowance ran out while the parties waited, or the lobby's players not yet counted this month didn't fit in the active-player allowance. Parties that each fit on their own can still overflow it together.
server-shutdown The server restarted while the party waited, and the queue isn't stored. Queue the party again. See What to know about the queue.

Six things to know about the payloads:

  • An event names its pool poolId and its rule matchmakingRuleId. Those are the ids you send to /queue/join.
  • match.found lists each player as { mmrEntityExternalId, mmrEntity }, the party.* events as { mmrEntityExternalId } only. Every event also carries a player's ids under their user names, so userExternalId is there too, with the same value. mmrEntity is the player's rated user as it was when they joined the queue, the same object a reply carries. A player with no rated user in the pool yet gets a default one at the pool's starting rating, with _id: null.
  • Under a rule with positions, each match.found player also has positionIds and positionId: the positions they listed, and the one they were given. See Positions.
  • match.found has regionId: the region to host the match in, or null when the queue has no regions. The party.* events carry the party's regionIds, the regions it listed, or [] for any. See Regions.
  • teamId is one of your game's declared teams when it declares enough of them. Otherwise it's an id the server made up for this match. Either way, send it back as scores[].teamId when you record the result.
  • partyExternalId is the id you joined the party with, or null when you sent none.

Leaving with /queue/leave sends no event: you made that call yourself.

Receive an event

Every event is a POST with a JSON body and these headers:

Header Value
Inhouse-Event The event type, such as match.found.
Inhouse-Delivery The event's id.
Inhouse-Attempt 1 for the first try, up to 6.
Inhouse-Signature t=<unix seconds>,v1=<hex HMAC-SHA256>.

It also carries Content-Type: application/json and User-Agent: Inhouse-Webhooks/1.0.

Answer 2xx within 10 seconds to acknowledge it. Then:

  • Answer 2xx to event types you don't handle, webhook.test included.
  • Handle each event idempotently. An event can arrive more than once (a retry after your answer timed out) and not necessarily in order. A retry carries the same id.
  • Answer quickly. Your endpoint is sent at most 100 events at a time, and the rest wait their turn, oldest first. An endpoint that answers within 100 ms gets events as fast as they're made, several hundred a second. One that takes a second gets 100 a second, and everything behind those waits, your match.founds included. Acknowledge first, then do the work.
  • An event is only sent to endpoints that receive its type. With no such endpoint, nothing is sent and nothing goes in the log. A lobby formed after you remove your last match.found endpoint is written with no event.

Retries

Anything but a 2xx in time (another status, a timeout, a refused connection) is retried up to 5 times, waiting 4 s, 8 s, 16 s, 32 s and then 60 s between attempts. The last retry goes out about 2 minutes after the first attempt. If it fails too, the event is dropped.

An attempt that waits 2 minutes for its turn isn't sent. Every attempt takes a turn, a retry like a first attempt, and your endpoint has at most 100 at a time. An attempt still waiting for one after 2 minutes is given up on: its delivery is logged as failed, with a lastError that begins Not sent. That is what keeps events from piling up behind an endpoint that has stopped answering. It can also reach an endpoint that does answer, when events arrive faster than they can be sent for two minutes on end: one that takes seconds over each event during a large burst, for example. Answering quickly is what keeps it from coming up.

Redirects aren't followed. Each attempt reads the endpoint's URL and secret afresh, so retries after you rotate the secret are signed with the new one. Retries to an endpoint you delete stop, and its deliveries are logged as failed.

Verify the signature

Check the signature before trusting an event. Compute HMAC-SHA256 of <t>.<raw request body> with the endpoint's signing secret (whsec_…, shown in the portal; each endpoint has its own), compare it to v1 in constant time, and reject a t more than 5 minutes old:

import crypto from 'node:crypto';

function isFromInhouse(rawBody, signatureHeader, secret) {
  const parts = Object.fromEntries(
    signatureHeader.split(',').map((part) => part.split('=')),
  );
  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${parts.t}.${rawBody}`)
    .digest('hex');
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  return (
    fresh &&
    typeof parts.v1 === 'string' &&
    parts.v1.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(parts.v1), Buffer.from(expected))
  );
}

Catch up after downtime

Every event sent to your project's endpoints, and what became of it, is kept for 7 days. Read the ones an endpoint missed:

curl "https://api.inhouseranks.com/v1/projects/webhook/deliveries?status=failed" \
  -H "x-api-key: $INHOUSE_API_KEY"
A delivery's status Meaning
delivered The endpoint acknowledged it.
failed The endpoint never acknowledged it: it was down for longer than the retries, it was deleted, the server shut down mid-retry, or an attempt waited over 2 minutes for its turn to be sent.
pending A retry is waiting (nextAttemptAt). If nextAttemptAt is in the past, the server crashed between retries.

Each delivery's body is the exact JSON that was sent. Process the body of a failed delivery, or of a pending one whose nextAttemptAt has passed, as if it had just arrived.

A delivery is one event to one endpoint. With several endpoints an event is listed once for each, with the same eventId (the id in its body), so handle each eventId once. Add webhookId=<the endpoint's id> to read one endpoint's deliveries.

The portal shows the same log, endpoint by endpoint, on its Webhooks page. The query parameters and fields are under List webhook deliveries.