Skip to content

Automation API

MyPanel has a REST API that primarily powers the UI. This page lists the stable endpoints useful for automation (CI/CD, ops scripts). Authenticate with an API token (Pro).

Every request includes the header:

Authorization: Bearer mpat_xxxxxxxx

The base URL is your panel address, e.g. https://panel.example.com. Examples below use two variables:

Terminal window
PANEL=https://panel.example.com
TOKEN=mpat_xxxxxxxx
Terminal window
# List websites
curl -H "Authorization: Bearer $TOKEN" $PANEL/api/sites
# Create a website (reverseproxy / static / nixpacks / dockerfile / image / wordpress)
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"domain":"app.example.com","buildKind":"reverseproxy","source":"http://127.0.0.1:3000"}' \
$PANEL/api/sites
# Deploy a website by id
curl -X POST -H "Authorization: Bearer $TOKEN" $PANEL/api/sites/1/deploy
# Get the latest deployment status
curl -H "Authorization: Bearer $TOKEN" $PANEL/api/sites/1/deployment
# Delete a website
curl -X DELETE -H "Authorization: Bearer $TOKEN" $PANEL/api/sites/1
Terminal window
# List databases
curl -H "Authorization: Bearer $TOKEN" $PANEL/api/databases
# Create a database
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"engine":"MySQL","name":"app_prod"}' $PANEL/api/databases
# Trigger a backup for a database by id
curl -X POST -H "Authorization: Bearer $TOKEN" $PANEL/api/databases/1/backups
Terminal window
# Server info (hostname, OS, uptime, load, version)
curl -H "Authorization: Bearer $TOKEN" $PANEL/api/system
# Update status (current / latest version)
curl -H "Authorization: Bearer $TOKEN" $PANEL/api/update
CodeMeaning
200 / 201 / 202 / 204Success
400Invalid request body
401Missing or invalid token
402Plan limit reached (includes {"upgrade":"pro"})
403Insufficient permissions
404Resource not found