Docs

API reference

Every operation of the public API with its fields, errors and examples. The reference is in English.

Authentication

Base URL https://minetric.com, JSON in UTF-8. Every call carries an API key of the studio, created in the studio's settings under API keys, and optionally limited to one server (the API calls a server a game): Authorization: Bearer mtr_.... Keys are secrets for servers, never for game clients.

game is the server's slug in Minetric; it may be left out when the key is limited to one server. Players are the server's own ids (a Minecraft UUID with dashes, a Steam id, an account id). Times are RFC 3339; amounts are integers in minor units (1299 is 12.99) with an ISO 4217 currency.

Reads answer with an ETag: send it back in If-None-Match to get a 304 without a body. Rate limits are per key and minute: reads 1,200, events 600, claims 600, import 120.

Errors

An error is {"error": {"code", "message", "details"?}}. Any operation may answer these; each operation lists its own below.

401missing_api_key
No Authorization: Bearer mtr_… header.
401invalid_api_key
The key is unknown or revoked.
400game_required
No game and the key works for every server (game) of the studio.
400invalid_request
A parameter or the body is malformed; details lists the fields.
403game_not_allowed
The key is limited to another game.
404unknown_game
The studio has no server (game) with this slug.
429rate_limited
Too many calls for this key; wait Retry-After seconds.
503unavailable
Minetric could not answer; retry after Retry-After seconds.

GET/v1/partners

Partners of a game

The game's active partners, their hosts, codes and welcome gifts, and its sources.

Cache it and poll every 30 to 60 seconds with If-None-Match: the answer is 304 without a body while nothing changed.

A game may resolve a joining player's partner from this list (host to partner) to show the gift at once; Minetric resolves it again on player.joined and is the reference.

Query

game

string

The game's slug. Optional when the key is limited to one game.
Request
curl https://minetric.com/v1/partners?game=hideout \
  -H "Authorization: Bearer $MINETRIC_API_KEY"
Response 200
{
  "game": {
    "slug": "hideout",
    "hosts": [
      "playhideout.com"
    ],
    "partner_hosts": [
      "playhideout.com"
    ]
  },
  "partners": [
    {
      "id": "4b1c2f0e-3a51-4c8e-9a7d-2f0c9e1d5b11",
      "slug": "saphir",
      "name": "Saphir",
      "hosts": [
        "saphir.playhideout.com"
      ],
      "code": "saphir",
      "welcome": {
        "reward": {
          "id": "a91f6c3d-8e2b-4f70-b1a4-5c9d0e7f2a63",
          "name": "Starter crate",
          "payload": {
            "items": [
              "crate_starter"
            ]
          }
        },
        "npc": {
          "name": "Saphir",
          "lines": {
            "en": [
              [
                "Hey {player}!"
              ]
            ],
            "fr": [
              [
                "Salut {player} !"
              ]
            ]
          }
        },
        "skin": {
          "value": "ewog…",
          "signature": "kZ1…"
        }
      },
      "updated_at": "2026-11-20T10:12:00Z"
    }
  ],
  "sources": [
    {
      "id": "77e0c1a2-5b3d-4e8f-9a10-6b2c3d4e5f60",
      "name": "Minecraft-MP",
      "hosts": [
        "mp.playhideout.com"
      ]
    }
  ]
}
304-
If-None-Match names the current ETag: no body.

POST/v1/events

Send events

Up to 500 events of one game: joins, sessions, milestones, survey answers, purchases.

Each event has your own id, unique in your studio: sending it again within 35 days is a no-op, counted in duplicates, so retries are safe.

Events are checked one by one: a bad event is listed in rejected with its index in events and an error (invalid_event, unknown_type, invalid_data), the others are kept.

Players' IP addresses are hashed on arrival and never stored.

Body

game

string

The game's slug. Optional when the key is limited to one game.
eventsrequired

array

1 to 500 events: {id, type, at, player: {id, name?}, data}.
Request
curl -X POST https://minetric.com/v1/events \
  -H "Authorization: Bearer $MINETRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
  "game": "hideout",
  "events": [
    {
      "id": "join-8f3e2a1b",
      "type": "player.joined",
      "at": "2026-12-03T18:04:11Z",
      "player": {
        "id": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
        "name": "Notch"
      },
      "data": {
        "host": "saphir.playhideout.com",
        "ip": "203.0.113.7",
        "auth": "authenticated",
        "client": "fabric"
      }
    },
    {
      "id": "sess-55aa01c3",
      "type": "player.session",
      "at": "2026-12-03T19:10:00Z",
      "player": {
        "id": "069a79f4-44e9-4726-a5be-fca90e38aaf5"
      },
      "data": {
        "started_at": "2026-12-03T18:04:11Z",
        "ended_at": "2026-12-03T19:10:00Z",
        "active_seconds": 3420
      }
    }
  ]
}
Response 202
{
  "accepted": 2,
  "duplicates": 0,
  "rejected": []
}
400invalid_json
The body is empty or not JSON.
413payload_too_large
The body is over 5 MiB.

POST/v1/import

Import history

Your players, playtime and purchases from before Minetric, same body as /v1/events.

player.joined may carry attribution ({"partner": slug}, {"source": id} or {"none": true}) instead of an IP; it needs host or attribution.

player.session may be a total: {"total_active_seconds", "sessions"?, "days"?: [{"day", "active_seconds", "sessions"?}]}.

Imported players and purchases never book earnings, and imported players are never offered a welcome gift (POST /v1/claims answers no_welcome): history is for the numbers.

Imported IPs are hashed but not looked up.

Body

game

string

The game's slug. Optional when the key is limited to one game.
eventsrequired

array

1 to 500 events, as for /v1/events.
Request
curl -X POST https://minetric.com/v1/import \
  -H "Authorization: Bearer $MINETRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d @body.json
body.json
{
  "game": "hideout",
  "events": [
    {
      "id": "import-join-069a79f4",
      "type": "player.joined",
      "at": "2025-03-14T20:31:00Z",
      "player": {
        "id": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
        "name": "Notch"
      },
      "data": {
        "host": "saphir.playhideout.com",
        "auth": "authenticated",
        "attribution": {
          "partner": "saphir"
        }
      }
    },
    {
      "id": "import-time-069a79f4",
      "type": "player.session",
      "at": "2026-11-30T00:00:00Z",
      "player": {
        "id": "069a79f4-44e9-4726-a5be-fca90e38aaf5"
      },
      "data": {
        "total_active_seconds": 271800,
        "sessions": 112
      }
    },
    {
      "id": "import-buy-tbx-81723-1",
      "type": "purchase",
      "at": "2025-06-02T15:47:12Z",
      "player": {
        "id": "069a79f4-44e9-4726-a5be-fca90e38aaf5"
      },
      "data": {
        "provider": "tebex",
        "transaction": "tbx-81723",
        "line": 1,
        "product": {
          "id": "5412",
          "name": "VIP 30 days"
        },
        "gross": 999,
        "tax": 166,
        "currency": "EUR",
        "code": "saphir",
        "status": "paid"
      }
    }
  ]
}
Response 202
{
  "accepted": 3,
  "duplicates": 0,
  "rejected": []
}
400invalid_json
The body is empty or not JSON.
413payload_too_large
The body is over 5 MiB.

GET/v1/players/{id}

A player

A player's attribution, qualification and welcome gift.

For games that don't resolve partners themselves: read it once per login. Answers carry an ETag.

Path parameters

idrequired

string

The game's own player id (a Minecraft UUID with dashes, a Steam id…).

Query

game

string

The game's slug. Optional when the key is limited to one game.
Request
curl https://minetric.com/v1/players/069a79f4-44e9-4726-a5be-fca90e38aaf5?game=hideout \
  -H "Authorization: Bearer $MINETRIC_API_KEY"
Response 200
{
  "id": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
  "first_seen_at": "2026-12-03T18:04:11Z",
  "source": {
    "kind": "partner",
    "partner": "saphir"
  },
  "qualification": "pending",
  "welcome": {
    "partner": "saphir",
    "reward_id": "a91f6c3d-8e2b-4f70-b1a4-5c9d0e7f2a63",
    "claimed": false
  }
}
404unknown_player
Minetric has not seen this player join this game.

POST/v1/claims

Claim a welcome gift

Claims the welcome gift of the player's partner, once: give the reward only after a 200.

Don't retry a claim whose answer was lost without checking GET /v1/players/{id} (welcome.claimed): a second claim answers 409.

Body

game

string

The game's slug. Optional when the key is limited to one game.
playerrequired

string

The game's player id.
Request
curl -X POST https://minetric.com/v1/claims \
  -H "Authorization: Bearer $MINETRIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"game":"hideout","player":"069a79f4-44e9-4726-a5be-fca90e38aaf5"}'
body.json
{
  "game": "hideout",
  "player": "069a79f4-44e9-4726-a5be-fca90e38aaf5"
}
Response 200
{
  "partner": "saphir",
  "reward": {
    "id": "a91f6c3d-8e2b-4f70-b1a4-5c9d0e7f2a63",
    "name": "Starter crate",
    "payload": {
      "items": [
        "crate_starter"
      ]
    }
  }
}
409already_claimed
The gift was claimed before; details.partner names the partner.
404no_welcome
The player has no partner, or the partner has no gift for this game.
404unknown_player
Minetric has not seen this player join this game.

Event types

What events[].data holds for each type of /v1/events and /v1/import. Each event also has id (yours, unique in the studio: a repeat is a no-op), at (RFC 3339, at most 15 minutes ahead) and player (id, optional name).

player.joined

A join. Creates the player on their first and attributes them; later joins update their activity.

data

hostrequired

string

The address the player typed, as the handshake has it: Minetric strips the port, trailing dots and what Forge, FML or proxies append.
iprequired

string

The player's IPv4 or IPv6 address; hashed on arrival, never stored.
auth

"authenticated" | "offline" | "unknown"

Whether the account was checked with its platform. Default unknown.
client

string

The client or launcher, when known (fabric, lunar).

Only in /v1/import

attribution

{partner} | {source} | {none: true}

Who sent the player, instead of resolving host. ip and host become optional (one of host, attribution is required).

player.session

A play session: active minutes, sessions and active days.

data

started_atrequired

RFC 3339

Start of the session.
ended_atrequired

RFC 3339

End of the session, not before its start.
active_seconds

integer

Time not idle, at most the session's length. Without it the whole session counts.

Only in /v1/import

total_active_seconds

integer

Instead of a session: the player's total playtime, with optional sessions and days: [{day, active_seconds, sessions?}].

player.milestone

A milestone the qualification rules can require.

data

keyrequired

string

Your milestone's key (tutorial_done), matched exactly.

player.survey

A "Who sent you?" answer: attributes a player without attribution within 24 hours of their first join.

data

partner

string

The partner's slug.
source

uuid

Or a source's id. Exactly one of the two.

purchase

A line of a purchase: books revenue and code shares.

data

providerrequired

string

The store (tebex, paynow, stripe, any name).
transactionrequired

string

The store's transaction id.
linerequired

string | integer

The line within the transaction; with provider and transaction it identifies the purchase.
productrequired

{id, name?}

What was bought.
grossrequired

integer

Amount paid, tax included, in minor units (1299 = 12.99).
tax

integer

Tax included in gross, minor units. Default 0.
currencyrequired

string

ISO 4217 code (EUR).
code

string

The creator code used, if any.
status

"paid" | "refunded" | "chargeback" | "disputed"

Default paid.

purchase.status

A purchase's new status: refunds and chargebacks book reversals.

data

providerrequired

string

As in the purchase.
transactionrequired

string

As in the purchase.
linerequired

string | integer

As in the purchase.
statusrequired

"paid" | "refunded" | "chargeback" | "disputed"

The new status.

Rejected events

Events are checked one by one: a bad event is listed in rejected with its index and one of these codes, the others are kept.

invalid_event
id, at (RFC 3339, at most 15 minutes ahead) or player is missing or malformed.
unknown_type
type is not one of the types above.
invalid_data
data does not fit its type; details lists the fields.