MMatchdock

API reference

Base URL: https://api.matchdock.io. JSON in, JSON out. Errors look like {"statusCode": 400, "message": "…"}.

Header Used for
x-matchdock-key: md_pub_… Identifies the project on player calls.
Authorization: Bearer <accessToken> Identifies the player. Required on every player call except sign-in.
x-matchdock-key: md_sec_… Management calls for your project.

401 means the token is missing, expired or revoked: sign the device in again and repeat the request once. 429 means slow down; Retry-After says for how long.

Player API

Endpoint Purpose
POST /auth/device {deviceId, platform, displayName?, appVersion?}{userId, accessToken, isNewUser, profile}. platform: IOS, ANDROID, UNITY_EDITOR, UNKNOWN.
POST /auth/logout Revokes the token used for the call.
GET /me Profile: rating, league, next league, leaderboard rank, record, currencies.
POST /matchmaking/join {queueName?, region?} → the ticket.
GET /matchmaking/status See Matchmaking.
POST /matchmaking/leave Leave the queue.
POST /matchmaking/abandon Leave the queue or back out before kick-off.
POST /matchmaking/friend {requesterUnityPlayerId, accepterUnityPlayerId, region?, queueName?}
GET /sessions/{serverSessionId}/reconnect-status/me {canReconnect, status, expiresInSeconds, host, port, joinToken}
GET /matches/me/history Recent matches with ratingDelta.
GET /matches/{matchId} One match.
GET /leaderboard?limit=&league= Top players of the project.
GET /leagues League tiers and thresholds.

Dedicated server API

Authenticated by serverSecret in the body. See Dedicated server.

Endpoint Body
POST /internal/sessions/{id}/players/{userId}/connected {serverSecret, joinToken, slot}
POST /internal/sessions/{id}/players/{userId}/heartbeat {serverSecret}
POST /internal/sessions/{id}/players/{userId}/disconnected {serverSecret, reason}
POST /internal/sessions/result Win: {serverSessionId, serverSecret, winnerUserId, loserUserId, winnerScore, loserScore, durationSeconds, serverBuildVersion?} · Draw: {…, resultType: "DRAW", player1UserId, player2UserId, player1Score, player2Score}

Management API

With your server key, scoped to your project ({p}).

Endpoint Purpose
GET /admin/whoami What this key can see.
GET /admin/projects/{p} Project with its queues, builds and keys (keys show a prefix only).
GET /admin/projects/{p}/overview Live sessions, queue size, 24-hour outcomes, active build.
GET /admin/projects/{p}/sessions Running servers with players, endpoint, CPU and memory.
GET /admin/projects/{p}/matches?limit= Recent matches with outcome, reason and server load.
GET /admin/projects/{p}/usage?from=&to= Per UTC day: sessions, server minutes, finished and aborted matches, unique players.
GET · POST /admin/projects/{p}/builds List, register.
PUT /admin/projects/{p}/builds/{id}/artifact Upload the archive (raw body).
POST /admin/projects/{p}/builds/{id}/activate Make it live.
PUT /admin/projects/{p}/queues/{name} {enabled?, ratingWindows?}
POST /admin/projects/{p}/api-keys `{name, kind: "CLIENT"
DELETE /admin/projects/{p}/api-keys/{id} Revoke.