Overview
The Servers API allows you to programmatically create, manage, and control game servers. All server operations useclass=servers in the API request.
Available Actions
create/createserver- Create a new game serverdelete/terminate/terminateserver- Delete a game serverrestart- Restart a game serverstop- Stop a game serversuspend/unsuspend- Suspend or unsuspend a server (not yet implemented)
Create Server
Creates a new game server instance. If the specified username doesn’t exist, a new user account will be automatically created.When creating a server for a new user, the system waits 4 seconds after user creation to allow the remote server to create the system user account.
Endpoint
Parameters
Your API authentication key
Must be
serversMust be
create or createserverUsername for the server owner. If the user doesn’t exist, a new account will be created.
Internal name of the game (e.g.,
csgo, tf2, minecraft)Number of player slots for the server
Preferred port number for the server. If not specified or unavailable, an available port will be assigned automatically.
Password for the user account (required if creating a new user)
Email address for the user account (required if creating a new user)
First name of the user (required if creating a new user)
Last name of the user (required if creating a new user)
RCON password for remote server administration
Set to
1 if the server should be private, 0 for publicPassword for private server access (required if
is_private=1)Example Request
Response
Returns the server ID on successful creation, or an error message if creation failed
Delete Server
Deletes (terminates) a game server permanently.Endpoint
Parameters
Your API authentication key
Must be
serversMust be
delete, terminate, or terminateserverThe server ID to delete
Example Request
Response
Returns a success message or error
Restart Server
Restarts a running game server instance.Endpoint
Parameters
Your API authentication key
Must be
serversMust be
restartThe server ID to restart
Example Request
Response
Returns a success message or error
Stop Server
Stops a running game server instance.Endpoint
Parameters
Your API authentication key
Must be
serversMust be
stopThe server ID to stop
Example Request
Response
Returns a success message or error
Suspend / Unsuspend Server
Endpoint
Response
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
No server ID provided | Missing id parameter | Include the server ID in your request |
Invalid game specified! | Unknown game internal name | Use a valid game name configured in GamePanelX |
Sorry, no available ip/port combinations available | No free IP/port combinations | Free up resources or add more IP addresses |
Failed to create user: [error] | User creation failed | Check the error message for details |
Best Practices
1. Check Server Creation Status
Server creation can take time. The API will wait and return once the server is created or if an error occurs.2. Use Unique Usernames
When creating servers with new users, ensure usernames are unique to avoid conflicts.3. Specify Ports When Possible
If you have specific port requirements, specify theport parameter to avoid automatic port assignment.
4. Store Server IDs
When a server is created successfully, the API returns the server ID. Store this ID for future operations (restart, stop, delete).5. Handle Automatic User Creation
When creating a server with a non-existent username, the API automatically creates the user account. Make sure to provide all required user parameters:
password, email, first_name, and last_name.Related Resources
User API
Manage user accounts
Authentication
API authentication guide