API tokens
API tokens let scripts, CI/CD or external tools call the MyPanel API without a password or 2FA. This is a Pro feature.
Create a token
Section titled “Create a token”Go to Settings → Account → API token:
- Enter a memorable name (e.g.
ci-deploy). - Click Create token.
- Copy the token shown — it looks like
mpat_….
Send the token in the Authorization header:
curl -H "Authorization: Bearer mpat_xxxxxxxx" https://panel.example.com/api/sitesSee the Automation API page for the endpoint list.
Security
Section titled “Security”- A token has full admin rights — treat it like a root password.
- Do not commit tokens to git; keep them in environment variables / CI secrets.
- Revoke unused tokens immediately under Settings → Account → API token (delete button).
- Each token shows its last-used time so you can spot forgotten tokens.