Skip to main content

MCCompanion API

The MCCompanion REST API powers the app and is partially available for public integrations. All endpoints live under:

https://api.mccompanion.net

Authentication

Most endpoints require a Firebase ID token passed as a Bearer token in the Authorization header:

Authorization: Bearer <firebase_id_token>

To get a token, sign in with Firebase Authentication using your MCCompanion email and password, then call getIdToken(). Tokens expire after 1 hour. Refresh them automatically using the Firebase SDK.

Unauthenticated requests to protected endpoints return 401 Unauthorized.

Public endpoints

These endpoints do not require authentication:

MethodPathDescription
GET/api/versionCurrent app version string
GET/api/healthAPI health check
GET/api/metricsGlobal stats (top servers, total connections)
GET/api/lookup/java/:identifierLook up a Java player by username or UUID
GET/api/lookup/bedrock/:identifierLook up a Bedrock player by gamertag or XUID
GET/api/lookup/bedrock-java/:identifierAuto-detect and cross-link Java and Bedrock profiles
GET/api/featured-serversList all featured servers
GET/api/featured-packsList all featured resource packs
GET/api/packs/lookup?url=Look up a resource pack by download URL
GET/api/botsXbox relay bot status and friend counts
GET/api/users/:usernameGet a user's public profile
GET/notificationCurrent in-app notification banner

User endpoints

Require a valid Firebase token for any registered MCCompanion user.

MethodPathDescription
GET/api/auth/meGet your roles and registration status
POST/api/users/registerRegister a new MCCompanion account
GET/api/users/meGet your full profile
PATCH/api/users/meUpdate display name, bio, avatar URL, appear offline
GET/api/users/me/subscriptionCheck subscription status and tracker slots
GET/api/users/me/friendsList friends
GET/api/users/me/friend-requestsList pending friend requests
POST/api/users/me/friends/:usernameSend a friend request
PATCH/api/users/me/friends/:username/acceptAccept a friend request
DELETE/api/users/me/friends/:usernameRemove a friend
POST/api/users/me/block/:usernameBlock a user
GET/api/users/search?q=Search users by username (min 2 chars)
GET/api/tracker/serversList your tracked servers
POST/api/tracker/serversAdd a server to track
PATCH/api/tracker/servers/:idUpdate a tracked server
DELETE/api/tracker/servers/:idRemove a tracked server
GET/api/messages/conversationsList your conversations
GET/api/messages/:usernameGet message history with a user
POST/api/messages/:usernameSend a message
PATCH/api/messages/:username/readMark messages as read
POST/api/feedbackSubmit a bug report or feature request
POST/api/reportsReport a user

Xbox and Java account linking

MethodPathDescription
POST/api/users/me/xbox/startStart Xbox account linking (device code flow)
GET/api/users/me/xbox/statusPoll Xbox linking status
DELETE/api/users/me/xbox/:xuidUnlink a specific Xbox account
POST/api/users/me/java/startStart Java account linking (device code flow)
GET/api/users/me/java/statusPoll Java linking status
DELETE/api/users/me/java/:uuidUnlink a specific Java account

Rate limiting

The API applies rate limits per IP. Hitting a limit returns 429 Too Many Requests.

Endpoint groupLimit
General public endpoints60 req / min per IP
Fast read endpoints (e.g. /api/users/me)120 req / min per IP
Feedback submission5 req / 10 min per IP

After 3 violations within 10 minutes, the IP is banned. To appeal, join our Discord.

Error format

All errors follow a consistent JSON format:

{
"error": "error_code",
"message": "Human-readable description"
}
CodeHTTP statusMeaning
unauthorized401Missing or invalid token
not_registered403Firebase user exists but no MCCompanion account yet
forbidden403Valid token but insufficient role
not_found404Resource does not exist
conflict409Resource already exists (e.g. duplicate username)
internal_error500Unexpected server error
info

The API is primarily designed to serve the MCCompanion app. Third-party usage is allowed for non-commercial integrations, but there is no formal SLA. Breaking changes may occur with prior notice in the Discord server.