What the API is for
With the API, your own programs work directly with the panel: a website, a shop, a script or a Discord bot can see your services, start a game server or create an email address, without you logging in.
Create a key
- Open My account → API.
- Give the key a name, for example the name of the program that will use it.
- Choose the access: Read only, or Full if the program needs to make changes.
- Optionally, write the IP of the server that will use the key. The key then works only from there.
- Press Create key and copy it right away. For safety, it is shown only once.
Use the key
Send the key in the Authorization header of every request:curl https://panel.masterhub.ltd/api/v1/accounts -H "Authorization: Bearer mh_live_…"
Every response is in JSON format. When something goes wrong, the response has "ok": false and the reason is in "error".
Good to know
- The full list of addresses is on the API page, under Documentation.
- The limit is 120 requests per minute.
- Each key only sees your own services.
- If a key is lost or reaches someone else, delete it from the API page: it stops working at that moment.