API access: control your server from scripts, bots and AI tools
API access lets your own scripts, Discord bots and AI tools start, stop, back up and send commands to your server with a personal key, so you never hand out your password.
13 min read · Updated Nov 26, 2026 · By GuavaHost Team
An API (application programming interface) is a way for a program to press the same buttons you press in the panel. Instead of clicking Restart, a script sends a short web request that says "restart this server". The GuavaHost API covers the everyday jobs: power, the console, files, backups and live status.
You do not need this to run a server. It is for people who want to automate something, and it is entirely optional.
What people use it for
- A Discord bot with a command that restarts the server or shows who has it running.
- A script on your own computer that takes a backup before you update mods.
- A status page or a stream overlay that shows whether the server is up and how much memory it is using.
- An AI assistant or agent that you let look after the server for you.
If all you want is a restart at the same time every day, you do not need the API at all. Scheduled restarts do that from the panel in two minutes.
Create an API key
An API key is a long secret string that proves a request comes from you. Anyone who has it can control your servers, so treat it exactly like a password.
- Sign in at customer.guavahost.com and open Account settings.
- Find the API access card and press Manage keys.
- Press Create key.
- Fill in Key name with what will use the key, such as
Discord botorHome backup script. You will thank yourself later when you need to work out which key to remove. A name can use letters, numbers, spaces and these symbols:. _ - : ( ) # @ + , /. Apostrophes and quote marks are not allowed, so writeZachs bot, notZach's bot. - Press Create key in the form. A Verify it's you box opens, the same one you see when you change your password. Confirm with the code we email you, or with your authenticator app if you have one set up.
- Your new key appears in a green box, hidden behind dots. Press Copy and keep the key somewhere safe, such as a password manager. The eye button shows the key if you want to read it. This is the only time you can copy it, and the page removes it again after a few minutes. If you lose it, you make a new one.
- Press Done.
You can have up to 24 keys. Each one is listed on the page with its name, when it was created and when it was last used.
How a request works
Every request goes to an address that starts with:
https://panel.guavahost.com/api/client
Every request carries two headers. The first is your key, the second asks for the answer as JSON (a plain text data format every programming language can read):
Authorization: Bearer EXAMPLE_KEY_replace_with_your_own
Accept: application/json
The address and the header are both on the API access page under How to use it, each with a Copy button.
The examples below use curl, a command line tool that is already on macOS, Linux and current versions of Windows. They use a made-up key, EXAMPLE_KEY_replace_with_your_own, and a made-up server ID, 1a2b3c4d. Swap in your own before you run them.
On Windows, run the examples in Command Prompt, put each one on a single line without the trailing backslashes, and write the JSON part with escaped quotes, like -d "{\"signal\":\"restart\"}".
Find your server ID
Each server has a short ID of eight letters and numbers, such as 1a2b3c4d. Every request about a server needs it.
The easy way: open Account settings, then API access, then Manage keys, and look at Your server IDs under How to use it. Every server you can use is listed there by name with its ID beside it. Press the copy button next to the one you want. The two examples on that page already have one of your server IDs filled in, and the note under them says which server that is.
You can also ask the API for your server list:
curl "https://panel.guavahost.com/api/client" \
-H "Authorization: Bearer EXAMPLE_KEY_replace_with_your_own" \
-H "Accept: application/json"
Each server in the answer has an identifier. That is the server ID:
{
"object": "list",
"data": [
{
"object": "server",
"attributes": {
"identifier": "1a2b3c4d",
"name": "My Survival World",
"is_suspended": false
}
}
]
}
The real answer has more in it than this, including the server's memory and disk limits.
A third way: the ID is also the part after the dot in your SFTP username, which is on your server's Settings tab under Connection details. A username of steve.1a2b3c4d means the server ID is 1a2b3c4d.
The number in the address bar of your control panel is a different thing and will not work as a server ID.
Examples you can copy
List your servers
curl "https://panel.guavahost.com/api/client" \
-H "Authorization: Bearer EXAMPLE_KEY_replace_with_your_own" \
-H "Accept: application/json"
This lists every server you own, plus any server someone has shared with you.
Read live status and resource use
curl "https://panel.guavahost.com/api/client/servers/1a2b3c4d/resources" \
-H "Authorization: Bearer EXAMPLE_KEY_replace_with_your_own" \
-H "Accept: application/json"
The answer looks like this:
{
"object": "stats",
"attributes": {
"current_state": "running",
"is_suspended": false,
"resources": {
"memory_bytes": 2147483648,
"cpu_absolute": 34.5,
"disk_bytes": 5368709120,
"network_rx_bytes": 1048576,
"network_tx_bytes": 2097152,
"uptime": 3600000
}
}
}
current_state is running, starting, stopping or offline. Memory, disk and network figures are in bytes, cpu_absolute is a percentage where 100 means one full CPU core, and uptime is in milliseconds.
Start, stop or restart
curl -X POST "https://panel.guavahost.com/api/client/servers/1a2b3c4d/power" \
-H "Authorization: Bearer EXAMPLE_KEY_replace_with_your_own" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"signal": "restart"}'
The signal can be start, stop, restart or kill. Use stop to shut down properly so the world saves. kill is the same as Force stop in the panel: it ends the server instantly without saving, so keep it for a server that is truly frozen.
A power request that worked sends back an empty answer. Add -i to the command if you want to see the status line, which reads 204 on success.
Send a console command
curl -X POST "https://panel.guavahost.com/api/client/servers/1a2b3c4d/command" \
-H "Authorization: Bearer EXAMPLE_KEY_replace_with_your_own" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"command": "say Restarting in five minutes"}'
Write the command the way you would type it in the console command box, which for most games means no leading slash. The server has to be running, and the request does not send back what the game printed in reply. It only tells you the command was delivered.
List files
curl "https://panel.guavahost.com/api/client/servers/1a2b3c4d/files/list?directory=%2F" \
-H "Authorization: Bearer EXAMPLE_KEY_replace_with_your_own" \
-H "Accept: application/json"
%2F is how a forward slash is written inside a web address, so directory=%2F is the top folder of your server and directory=%2Fplugins is the plugins folder. Each entry comes back with its name, its size in bytes, whether it is a file or a folder (is_file) and when it was last changed (modified_at).
Create a backup
curl -X POST "https://panel.guavahost.com/api/client/servers/1a2b3c4d/backups" \
-H "Authorization: Bearer EXAMPLE_KEY_replace_with_your_own" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name": "Before mod update"}'
The name is optional. The answer comes back straight away with the new backup's details while the backup itself carries on in the background, so completed_at is empty at first. To check on it, list your backups:
curl "https://panel.guavahost.com/api/client/servers/1a2b3c4d/backups" \
-H "Authorization: Bearer EXAMPLE_KEY_replace_with_your_own" \
-H "Accept: application/json"
A backup made this way is an ordinary backup. It uses one of your backup slots and appears on the Backups page like any other. Backups: creating, restoring and scheduling explains slots and restoring.
Using a key with scripts, bots and AI tools safely
A key can do real damage in the wrong hands, or in the hands of a tool that gets something wrong. A few habits keep that risk small.
- Only give a key to tools you trust. A key lets a tool stop your server, delete files and restore over your world. Before you paste a key into a website, a bot somebody else runs or an AI service, ask who operates it and where the key will be stored.
- One key per tool. Make a separate key for each script, bot or AI tool, and name each after what uses it. When one tool misbehaves or you stop using it, you revoke that one key and nothing else breaks.
- Revoke a key the moment it leaks. If a key ends up in a screenshot, a Discord message, a public code repository or a chat with an AI model, assume it is compromised and follow the steps under "If a key leaks" further down this page.
- Keep keys out of your code. Put the key in an environment variable or the tool's own secrets setting instead of writing it into a script, and never commit it to GitHub. The advice in keeping your Discord bot token safe applies word for word.
- GuavaHost staff will never ask for your key. Anyone who asks for it in a DM is not staff.
AI tools deserve one extra note. An AI assistant or agent can misunderstand a request, and it acts on whatever it decided you meant. Start it off with safe jobs such as reading status, take a backup before you let it change files, and look at what it did afterwards. Power actions, console commands, backups and file changes made with a key are recorded on your server's Activity page under your name, the same as if you had clicked the button yourself.
What a key can and cannot do
A key can do the things you do on your server's pages in the panel: power, console commands, files, backups, databases, scheduled tasks, ports, startup settings and the people you have shared the server with. That includes the destructive ones, such as deleting files and reinstalling the server.
A key can also manage API access itself. It can create more API keys, revoke keys, and add an SSH key that signs in to SFTP on your servers. That is why a leaked key needs more than one click to clean up.
The API does not have the panel's safety nets:
- A file deleted through the API is gone for good. The panel moves deleted files to a recycle bin for seven days. The API does not.
- A reinstall through the API starts straight away. The panel asks you to type a word first. The API does not ask.
A key cannot:
- Touch billing. It cannot see or pay invoices, see your payment methods, order a server or cancel one.
- Change your plan. RAM, plan, billing cycle and location changes are made in your control panel, not through the API.
- Reach anything outside your own servers. A key works on the servers you own and on servers that have been shared with you, and nothing else.
- Do more than you can. On a server someone shared with you, a key has exactly the permissions they gave you (see giving a friend access with sub-users). Limits such as your backup slots apply to the API the same way they apply in the panel.
Request limits
The API limits how many requests your account can send each minute. The limit is counted across all of your keys together, not per key, and the panel pages you have open count toward it too. A script that sends requests as fast as it can will make your own panel start failing.
Normal use is nowhere near the limit. A status check every 10 to 30 seconds is plenty for a bot or a status page. If you go over, the API answers with a 429 error until the minute is up, so have your script wait and try again instead of retrying in a tight loop.
Backups have a limit of their own on how often a new one can be started. If a backup request is refused with a 429 error, wait a few minutes before you try again.
When a request fails
The status code tells you what went wrong:
| Code | What it means |
|---|---|
| 401 | The key is missing, mistyped or has been revoked. Check the Authorization header says Bearer, then a space, then the whole key. |
| 403 | You do not have permission for that action, usually on a server that was shared with you. |
| 404 | The server ID is wrong, or it is not a server your account can use. |
| 429 | Too many requests. Wait a minute and slow down. |
| 502 | The server is offline, so it could not take the console command. Start it first. |
Revoke a key
- Sign in at customer.guavahost.com and open Account settings.
- Find the API access card and press Manage keys.
- Find the key by its name under Your keys and press Revoke.
- Press Revoke key to confirm.
It stops working immediately, and any tool still using it starts getting 401 errors. Revoking a key does not affect your password, your other keys or your servers.
To remove every key in one go, press Revoke all keys under the list.
Revoke keys you no longer use as well. A key for a bot you shut down months ago is a risk with no benefit.
If a key leaks
Revoking the leaked key is the first step, not the only one. Whoever had the key could have used it to leave themselves another way in.
- Open Account settings, then API access, then Manage keys.
- Revoke the leaked key, and every other key you do not recognise. If you are not sure which keys are yours, press Revoke all keys and create fresh ones for the tools you still use. If keys you did not make keep coming back, contact support straight away.
- Look for a card called SSH keys on your account on the same page. It only appears when there is one. Press Remove on any you do not recognise.
- On each server, open People and remove anyone you did not invite.
- On each server, open Scheduled tasks and delete any task you did not create.
- Check the server's Activity page to see what was done with the key.
Changing your account password does not revoke API keys. A key keeps working until you revoke it.
Common questions
Can an API key see or change my billing?
No. A key only works on your servers: power, console, files, backups and settings. Invoices, payment methods, plan changes and cancellations are not part of the API, so a key cannot reach them even if it leaks.
I lost my API key. Can I see it again?
No. A key is shown once, when you create it. Revoke the lost key in Account settings under API access, create a new one, and put the new key into whatever was using the old one.
Why am I asked to verify before a key is created?
Because a key is as powerful as your password and keeps working until you revoke it. Asking for an emailed code or your authenticator means someone who finds your browser signed in cannot quietly make a key for themselves.
Does a key work on a server someone shared with me?
Yes. Your key covers the servers you own and the servers you have been added to as a sub-user. On a shared server it can only do what the owner allowed you to do, so an action you cannot do in the panel is refused through the API too.
Is it safe to give my key to an AI tool?
Only if you trust the tool and the company behind it, because the key lets it do everything you can do to your server, including deleting files. Give each AI tool its own key, take a backup before letting it change anything, and revoke the key when you stop using the tool.
What should I do if my key leaks?
Revoke it straight away, then revoke every other key you do not recognise, because a key can be used to create more keys. On the same page, remove any SSH key you did not add, and check the People and Scheduled tasks pages of each server for anything you did not set up.
How many requests can I send?
There is a limit on requests per minute for your whole account. It is shared by all of your keys and by the panel pages you have open. Checking status every 10 to 30 seconds is well inside it. If you go over, requests are refused with a 429 error until the minute passes.
Still stuck? Jump into our Discord at discord.gg/GuavaHost and the team will help you out.
- api
- api key
- automation
- scripts
- bots
- ai
- curl
Still need help? Our team is online 24/7 to answer questions.