mp.playersawait mp.players.register(playerName, { playerData?, birthYear?, steamTicket?, steamIdentity?, googleAuthCode?, googleIntegrityToken?, playerToken?, restore? })
Registers a player. Returns player_id, private_key (the player token — store it) and player_tag. Steam fields accept a hex auth ticket + identity; Google Play fields accept the server auth code plus optional Play Integrity token. Pass restore only after the player explicitly confirms a deletion-restore prompt — never automatically.
await mp.players.login(playerToken)
Starts the player session (PUT /login).
await mp.players.heartbeat(playerToken)
Keeps the player marked online — call on an interval while the session is active.
await mp.players.logout(playerToken)
Ends the session cleanly.
await mp.players.rename(playerToken, newName)
Renames the player; the new name is validated against the game's name rules server-side.
await mp.players.rotate(playerToken)
Rotates the player credential — store the returned private_key; the old token is retired.
await mp.players.deleteAccount(playerToken)
Schedules player-initiated account deletion. The account freezes immediately and is purged after the 30-day grace window unless restored. Keep the player credential during the window; the response includes deletion_pending and purge_after.
await mp.players.restoreAccount(playerToken)
Cancels a pending deletion. This must be an explicit player action, never an automatic login or background retry. Provider-linked accounts can also restore after reinstall by signing in with the provider and restore: true after confirmation.
await mp.players.list()
Lists all players. Requires apiPrivateToken — server-side only.
await mp.players.ban(playerId, { banDuration?, banReason? })
await mp.players.unban(playerId)
Timed or permanent bans. Admin operations — never ship the private token in a client.
await mp.players.getData(playerToken)
await mp.players.updateData(playerToken, playerData)
Per-player JSON storage — stats, loadouts, progression. Leaderboards rank these fields server-side.
Register creates the player and returns the token your game stores and presents as X-Game-Player-Token. Login re-opens the session on a later run; heartbeat keeps the player marked online while they play; logout ends the session cleanly. Rotate issues a fresh credential and invalidates the old one — call it any time a token may have leaked.
Registration and rename validate the display name server-side against your game's name rules — allowed scripts, case policy and symbols, edited in the cabinet — plus the profanity screen. A rejected name comes back as a fielded error you can show the player instead of guessing why it failed.