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).
Authentication
Section titled “Authentication”Every request includes the header:
Authorization: Bearer mpat_xxxxxxxxThe base URL is your panel address, e.g. https://panel.example.com. Examples below
use two variables:
PANEL=https://panel.example.comTOKEN=mpat_xxxxxxxxWebsites
Section titled “Websites”# List websitescurl -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 idcurl -X POST -H "Authorization: Bearer $TOKEN" $PANEL/api/sites/1/deploy
# Get the latest deployment statuscurl -H "Authorization: Bearer $TOKEN" $PANEL/api/sites/1/deployment
# Delete a websitecurl -X DELETE -H "Authorization: Bearer $TOKEN" $PANEL/api/sites/1Databases
Section titled “Databases”# List databasescurl -H "Authorization: Bearer $TOKEN" $PANEL/api/databases
# Create a databasecurl -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 idcurl -X POST -H "Authorization: Bearer $TOKEN" $PANEL/api/databases/1/backupsSystem
Section titled “System”# 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/updateStatus codes
Section titled “Status codes”| Code | Meaning |
|---|---|
200 / 201 / 202 / 204 | Success |
400 | Invalid request body |
401 | Missing or invalid token |
402 | Plan limit reached (includes {"upgrade":"pro"}) |
403 | Insufficient permissions |
404 | Resource not found |