Get Player Statistics
horizon_get_statisticsReads a player's statistics snapshot and server operation window to restore sessions, recover reconnects, or verify an uncertain batch before retrying an update.
Instructions
Reads a player's statistics snapshot and server operation window. Use when: explicit loading, reconnect recovery or checking an uncertain batch before retrying its original ID. Not for: writing counters; use horizon_update_statistics with the original durable ID. Requires: userId and the player's session: sign in with horizon_signin_email or horizon_signin_anonymous and pass its accessToken as sessionToken. Side effects: None (read only). Returns: {userId, definitionVersion, definitions, revision, values, operationWindow, operationId?, replayed?, newlyUnlocked}. definitions null means unchanged since definitionVersion; keep the cached definitions. Errors: 401 SESSION_REQUIRED: sign in again; 403 SESSION_FORBIDDEN: use the matching player. 409 OPERATION_CONFLICT means the ID was already used for a different payload. 410 OPERATION_EXPIRED rejects an expired/evicted unknown ID. Never replace an uncertain ID automatically. 422 UNKNOWN_STATISTIC/UPDATE_ABOVE_LIMIT/VALUE_OVERFLOW rejects the whole batch. Needs HORIZON_API_KEY. Every failure returns an error result (isError) with the HTTP status and body: a 401 that horizon_test_connection also returns means HORIZON_API_KEY is wrong, 429 means the account's per-minute rate limit was reached (wait a minute, then retry).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | Signed-in player UUID matching the supplied session token | |
| sessionToken | Yes | Player accessToken from horizon_signin_anonymous or horizon_signin_email; sent as Bearer | |
| definitionVersion | No | Last cached definitionVersion; omit to load the full catalog |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | ||
| values | Yes | ||
| replayed | No | ||
| revision | Yes | ||
| definitions | Yes | ||
| operationId | No | ||
| newlyUnlocked | Yes | ||
| operationWindow | Yes | ||
| definitionVersion | Yes |