Articles on: API Docs
This article is also available in:

How to use the Multiserver API

In this article, you'll learn how to use the Multiserver API to create, destroy, edit & manage your Multiserver service. You are able to use this API to create a Reseller hosting service! You could use the Pterodactyl API HERE to create your own front end panel and use WitherHosting's Quality Ryzen and Intel Hardware!

You have to have an API key to use the Multiserver API. You can obtain these by going into the game panel and selecting the API menu option.


Using the API to get Server Types



Getting the egg ID's is important to creating a service because it allows you to select what type of service you want. For example the ID for creating a PaperMC server is 4. We suggest using the website https://reqbin.com/post-online to test out the API.

The call to retrieve the server types is https://witherpanel.com/api/client/cloudservers/getoptions the response from the API on a successful use will look like this:

{
"id": 4,
"name": "Paper",
"status": "1",
"eggid": "65"
}


The only part that will matter is the "id": 4


🌍 Getting available locations using the API 🌍



Use this API call https://witherpanel.com/api/client/cloudservers/getlocationstock the response will look like this:

{
"id": 1,
"long": "New York City",
"oos": 0
}


There are two parts of this that matter, "id": 1 and "oos": 0

ID -> This is the ID of the location and is required when creating a server.
OOS -> This stands for Out Of Stock

0 Means In Stock
2 Means Low Stock (Low Stock means that there is a chance the server could fail to create due to size)
1 Means Out Of Stock


➕ Creating a server using the Mulitserver API ➕



The API Endpoint is https://witherpanel.com/api/client/cloudservers/create

Required Inputs



Name: Name of the server
memory: Amount of Ram on the server
cpu: Amount of CPU on the server
disk: Amount of STORAGE on the server
type: Server Type ID
location: Server Location ID

The content required to create a server for example would look like

{"name": "Multiserver API!!", "memory": "1024", "cpu": "200", "disk": "5000", "type": "4", "location": "1"}

In that we have created a server that will have, 1GB of ram 2vCores and 5GB of storage using the Java server software Paper in our NYC location

In the future we plan to add the ability to customize the number of backups for each plan! This will mean you can charge for backups per server and even control the amount of databases or other systems! Currently databases are automatically set to 3 and Backups are set to 5


✏️ Editing a server using the API ✏️



The API Endpoint is https://witherpanel.com/api/client/cloudservers/edit

Required Inputs



UUID: Servers UUID (Found in the settings page)
memory: New Ram Amount
cpu: New CPU amount
disk: New Disk amount

If you set the RAM, CPU or DISK to the same as it is set no change will be made to that setting.

The content required will look like:

{"uuid": "Your servers UUID", "memory": "1024", "cpu": "200", "disk": "5000"}

That will modify your servers setup!


➖ Deleting a server using the API ➖



Required Inputs



UUID: Servers UUID

Content required will look like this

{"uuid": "Your servers UUID"}

This will delete your server and give back your resources!

Updated on: 06/08/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!