Skip to main content

Overview

The Servers API allows you to programmatically create, manage, and control game servers. All server operations use class=servers in the API request.

Available Actions

  • create / createserver - Create a new game server
  • delete / terminate / terminateserver - Delete a game server
  • restart - Restart a game server
  • stop - Stop a game server
  • suspend / 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

POST /api/api.php?class=servers&action=create

Parameters

key
string
required
Your API authentication key
class
string
required
Must be servers
action
string
required
Must be create or createserver
username
string
required
Username for the server owner. If the user doesn’t exist, a new account will be created.
game
string
required
Internal name of the game (e.g., csgo, tf2, minecraft)
slots
integer
required
Number of player slots for the server
port
integer
Preferred port number for the server. If not specified or unavailable, an available port will be assigned automatically.
password
string
Password for the user account (required if creating a new user)
email
string
Email address for the user account (required if creating a new user)
first_name
string
First name of the user (required if creating a new user)
last_name
string
Last name of the user (required if creating a new user)
rcon_password
string
RCON password for remote server administration
is_private
string
Set to 1 if the server should be private, 0 for public
private_password
string
Password for private server access (required if is_private=1)

Example Request

curl -X POST https://your-domain.com/api/api.php \
  -d "key=YOUR_API_KEY" \
  -d "class=servers" \
  -d "action=create" \
  -d "username=john_doe" \
  -d "game=csgo" \
  -d "slots=32" \
  -d "port=27015" \
  -d "password=secure_password" \
  -d "[email protected]" \
  -d "first_name=John" \
  -d "last_name=Doe" \
  -d "rcon_password=rcon123" \
  -d "is_private=0"

Response

success
string
Returns the server ID on successful creation, or an error message if creation failed
Success Example:
42
Error Examples:
Invalid game specified!
Sorry, no available ip/port combinations available to handle this request!
Failed to create user: [error message]

Delete Server

Deletes (terminates) a game server permanently.
This action is irreversible. All server data will be permanently deleted.

Endpoint

POST /api/api.php?class=servers&action=delete

Parameters

key
string
required
Your API authentication key
class
string
required
Must be servers
action
string
required
Must be delete, terminate, or terminateserver
id
integer
required
The server ID to delete

Example Request

curl -X POST https://your-domain.com/api/api.php \
  -d "key=YOUR_API_KEY" \
  -d "class=servers" \
  -d "action=delete" \
  -d "id=42"

Response

success
string
Returns a success message or error
Error Example:
No server ID provided

Restart Server

Restarts a running game server instance.

Endpoint

POST /api/api.php?class=servers&action=restart

Parameters

key
string
required
Your API authentication key
class
string
required
Must be servers
action
string
required
Must be restart
id
integer
required
The server ID to restart

Example Request

curl -X POST https://your-domain.com/api/api.php \
  -d "key=YOUR_API_KEY" \
  -d "class=servers" \
  -d "action=restart" \
  -d "id=42"

Response

success
string
Returns a success message or error
Error Example:
No server ID provided

Stop Server

Stops a running game server instance.

Endpoint

POST /api/api.php?class=servers&action=stop

Parameters

key
string
required
Your API authentication key
class
string
required
Must be servers
action
string
required
Must be stop
id
integer
required
The server ID to stop

Example Request

curl -X POST https://your-domain.com/api/api.php \
  -d "key=YOUR_API_KEY" \
  -d "class=servers" \
  -d "action=stop" \
  -d "id=42"

Response

success
string
Returns a success message or error
Error Example:
No server ID provided

Suspend / Unsuspend Server

The suspend and unsuspend actions are not yet implemented in GamePanelX V3.

Endpoint

POST /api/api.php?class=servers&action=suspend

Response

Suspend/UnSuspend have not been implemented yet, sorry

Common Errors

Error MessageCauseSolution
No server ID providedMissing id parameterInclude the server ID in your request
Invalid game specified!Unknown game internal nameUse a valid game name configured in GamePanelX
Sorry, no available ip/port combinations availableNo free IP/port combinationsFree up resources or add more IP addresses
Failed to create user: [error]User creation failedCheck 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 the port 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.

User API

Manage user accounts

Authentication

API authentication guide

Build docs developers (and LLMs) love