Wiki of mygameplatform.com Help

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

  1. Open your account, open the API Tokens tab and click Create token.

  2. Enter a Name, tick only the Scopes you need and choose a Lifetime.

  3. 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

account:read

Read your account: user ID, display name, memberships, install limits and the scopes of the token.

servers:read

List your Gameservers and read their status, idle detection and maintenance.

servers:control

Start, stop, restart, kill and rename your Gameservers.

servers:console

Read the console of your Gameservers, also live. It only reads.

servers:command

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:

export MGP_API_TOKEN="mgp_pat_YOUR_TOKEN" curl https://user.gw.mygameplatform.com/api/v1/health curl -H "Authorization: Bearer $MGP_API_TOKEN" https://user.gw.mygameplatform.com/api/v1/account curl -H "Authorization: Bearer $MGP_API_TOKEN" https://user.gw.mygameplatform.com/api/v1/servers
$env:MGP_API_TOKEN = "mgp_pat_YOUR_TOKEN" $headers = @{ Authorization = "Bearer $env:MGP_API_TOKEN" } Invoke-RestMethod https://user.gw.mygameplatform.com/api/v1/health Invoke-RestMethod https://user.gw.mygameplatform.com/api/v1/account -Headers $headers Invoke-RestMethod https://user.gw.mygameplatform.com/api/v1/servers -Headers $headers

/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

GET

/health

—

Checks that the API is reachable

GET

/openapi.json

—

The full API description

GET

/account

account:read

Your user ID, name, memberships and the token used

GET

/account/limits

account:read

Your install limits per catalog, computed live

GET

/servers

servers:read

All your Gameservers

GET

/servers/{id}

servers:read

One Gameserver with its address, idle detection and maintenance (below)

GET

/servers/{id}/status

servers:read

Power state: running, starting, stopping, stopped or unknown

POST

/servers/{id}/start

servers:control

Start it (likewise /stop, /restart, /kill); answers 202 without waiting

PATCH

/servers/{id}

servers:control

Rename it, body {"name": "My Valheim"}; answers 204

GET

/servers/{id}/logs

servers:console

The newest console lines

GET

/servers/{id}/logs/stream

servers:console

The console live, as Server-Sent Events

POST

/servers/{id}/command

servers:command

Send one console command, body {"command": "say Hello"}; answers 202, the output shows in /logs

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; /account then reports "neverExpires": true — check that field, not the placeholder date in expiresAt.

  • 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 name or command.

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 (insufficient_scope), or your account is locked or blocked for the API.

404

No Gameserver with this ID, or it is not yours.

409

The Gameserver cannot do this right now (server_conflict), or it is not running for console commands and the live console (server_not_running). Retry later or start it first.

429

Too many requests: wait the seconds in the Retry-After header.

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.

You are helping me use the mygameplatform User API. It lets me read my mygameplatform account and manage my own Gameservers with a personal API token. Basics - Base URL: https://user.gw.mygameplatform.com/api/v1 - Every request needs the header: Authorization: Bearer $MGP_API_TOKEN - The full, current API description is https://user.gw.mygameplatform.com/api/v1/openapi.json (no token needed). Read it, or ask me to paste it, before using an endpoint. Never guess endpoints, fields or error codes. - The user guide is https://wiki.mygameplatform.com/user-api.html Token - If I have no token yet, guide me step by step: open https://mygameplatform.com/apps/account?to=/home%3Ftab%3Dapi-tokens, then open the "API Tokens" tab, click "Create token", choose only the scopes account:read and servers:read and a lifetime of 30 days. The token starts with mgp_pat_ and is shown only once. - Then ask me for the token. Prefer that I set it as the environment variable MGP_API_TOKEN in my terminal (PowerShell: $env:MGP_API_TOKEN). Security rules - The token is a secret like a password. Never repeat it in plain text and never write it into code, scripts, logs or files. Always use the variable MGP_API_TOKEN. - Remind me to revoke the token in the "API Tokens" tab when we are done. Order 1. GET /health (no token) to check that the API is reachable. 2. GET /account to check that the token works. 3. Then read-only requests, for example listing my Gameservers. 4. Anything that changes a Gameserver (start, stop, restart, kill, rename, console commands) only after I have explicitly confirmed it. Name the Gameserver (name and ID) and the action first. Errors - Errors are application/problem+json. Explain the "code" field to me. - 401: token missing, invalid, expired or paused (resume a paused token in "API Tokens"). - 403: the token lacks the scope for this request, or my account is locked or blocked for the API. - 429: too many requests. Wait the seconds given in the Retry-After header. Answer format - Ask whether I use Linux/macOS (curl) or Windows (PowerShell, Invoke-RestMethod) and give short commands for that system.
25 October 2026