User API
What you can do with it:
Read your account: memberships and install limits.
Control your Gameservers: list them, read their status, start, stop, restart, kill and rename them.
Use the console: read the console, also live, and send console commands.
The API only ever sees your own Gameservers. It cannot delete a Gameserver, install a new one or change your account, password or Discord link.
Quickstart
Step 1 — Create an API token
Create a token
Open your account, open the tab and click Create token.
Enter a Name, tick only the Scopes you need and choose a Lifetime.
Click Create — you are briefly redirected to the login and back — and copy the token. It starts with
mgp_pat_and is shown only once.
Each request needs exactly one scope. For a first test, account:read and servers:read are enough.
Scope | Allows |
|---|---|
| Read your account: user ID, display name, memberships, install limits and the scopes of the token. |
| List your Gameservers and read their status, idle detection and maintenance. |
| Start, stop, restart, kill and rename your Gameservers. |
| Read the console of your Gameservers, also live. It only reads. |
| Send commands to the console of your Gameservers, as in the console of the game panel. |
Step 2 — Make your first request
Base URL: https://user.gw.mygameplatform.com/api/v1. Send the header Authorization: Bearer mgp_pat_… with every request — only /health and /openapi.json work without it. Keep the token in an environment variable instead of typing it into every command:
/health answers {"status":"UP"}; /account shows your user ID, memberships and the scopes of the token; /servers lists your Gameservers with their id.
Step 3 — Next steps
Pick the requests you need from the overview below and add the matching scopes to a new token.
Import openapi.json into your API client, or generate a client for your language from it.
Let an AI assistant write the commands for you.
Requests
All paths are relative to the base URL. {id} is the ID of your Gameserver from GET /servers.
Method | Path | Scope | What it does |
|---|---|---|---|
|
| — | Checks that the API is reachable |
|
| — | The full API description |
|
|
| Your user ID, name, memberships and the token used |
|
|
| Your install limits per catalog, computed live |
|
|
| All your Gameservers |
|
|
| One Gameserver with its address, idle detection and maintenance (below) |
|
|
| Power state: |
|
|
| Start it (likewise |
|
|
| Rename it, body |
|
|
| The newest console lines |
|
|
| The console live, as Server-Sent Events |
|
|
| Send one console command, body |
Console lines are cleaned of colour codes, and passwords and keys from the server settings are masked. A console command is one line of up to 1000 characters; it is never logged.
Only GET /servers/{id} has idle and maintenance, the list does not. idle.enabled says whether idle detection checks the Gameserver; idle.expiresAt is the earliest time it would be removed — the end of its term (termExpiresAt), 36 hours after it was stopped for 4 hours (idleExpiresAt, starting it clears this) or, for a new Gameserver that was never started, earlyExpiresAt. maintenance.nextAt is the next weekly maintenance, which stops the Gameserver if it runs. Times are UTC; null means none — or, for the whole idle or maintenance object, that it cannot be read right now.
Lifetime, pause and revoke
Lifetime: 30, 90 or 365 days, or No expiration. A token without expiration only ends when you revoke it;
/accountthen reports"neverExpires": true— check that field, not the placeholder date inexpiresAt.Pause: a token not used for 30 days is paused — with or without expiration. It is also paused when the sign-in behind it ends, for example after you change your password. Click Resume next to it in the API Tokens tab; the token stays the same, so your scripts keep working. The lifetime keeps running while paused.
Revoke a token you no longer need or that may have leaked. Every app using it stops working at once.
Keep your token safe
Never share it, post it on Discord or commit it to Git. Keep it in an environment variable or a secret store, not in your code.
Give each app its own token with only the scopes it needs and the shortest lifetime that works for it.
If a token may have leaked, revoke it right away in the API Tokens tab and create a new one.
Errors and limits
Errors are JSON (application/problem+json); the field code says why. Include the requestId when you report a problem.
Status | What to do |
|---|---|
400 | The request is invalid, for example a missing or too long |
401 | Token missing, wrong, revoked, expired or paused: check the header, Resume a paused token, otherwise create a new one. |
403 | The token lacks the scope ( |
404 | No Gameserver with this ID, or it is not yours. |
409 | The Gameserver cannot do this right now ( |
429 | Too many requests: wait the seconds in the |
502, 503 | The platform behind the API is briefly unavailable. Retry later. |
Limits apply per token, per user and per IP address. Every answer carries them in RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset and RateLimit-Policy (for example 60;w=60 = 60 requests per 60 seconds). Poll the status no more often than you need; use /logs/stream instead of polling /logs.
Errors about the token or your account also carry their own type, a link of the form https://mygameplatform.com/docs/api/problems/… that leads to the matching entry below. Compare type or code in your scripts, never the text.
API token missing
401, code missing_token. The request has no Authorization: Bearer mgp_pat_… header. Add it — only /health and /openapi.json work without a token.
API token invalid
401, code invalid_token. The token is unknown, incomplete or revoked. Check that you copied all of it; otherwise create a new one.
API token expired
401, code token_expired. The lifetime you chose has ended. Create a new token; an expired token cannot be resumed.
API token paused
401, code token_paused. The token was not used for 30 days, or the sign-in behind it ended. Click Resume next to it in the API Tokens tab — the token stays the same, so your scripts keep working.
Account locked
403, code account_locked. Your mygameplatform account is locked — the FAQ lists the usual reasons — and API tokens do not work while it is. A new token does not help; if you do not know why, open a ticket in the 📋help channel on our Discord.
API access not enabled
403, code api_access_not_enabled. Your account cannot use the User API. Every account has access, so this should not happen — open a ticket in the 📋help channel on our Discord and include the requestId.
API access blocked
403, code user_blocked. An administrator has blocked API access for your account. A new token does not help; open a ticket in the 📋help channel on our Discord.
Use the API with your AI assistant
An AI assistant such as ChatGPT or Claude can walk you through the API and write the commands for you. Copy the prompt below into a new chat and tell it what you want to do.