1. Getting started
my.host API
  • Getting started
    • Introduction
    • Base url
    • Authentication
    • Response codes
    • Changelog
  • Domains
    • Domains
      • DNS
        • Zone
          • Get DNS zonefile
          • Import DNS zonefile
        • Dynamic DNS
          • List Dynamic DNS credentials
          • Create Dynamic DNS credential
          • Delete Dynamic DNS credential
          • Reset Dynamic DNS password
        • Get DNS records
        • Update DNS records
        • Update single DNS record
        • Delete single DNS record
        • Add single DNS record
        • Get DNS history
      • List domains
      • Get domain
      • Update domain
      • Cancel domain
      • Cancel domain deletion
      • Get auth code
      • Retry registration or transfer
      • Resend owner verification
    • Contacts
      • List profiles
      • Get profile
      • Create profile
      • Update profile
      • Delete profile
      • Get profile
      • Update profile
    • Nameservers
      • List profiles
      • Get profile
      • Create profile
      • Update profile
      • Delete profile
    • DNS templates
      • List templates
      • Get template
      • Create template
      • Update template
      • Delete template
    • Availability
      • Check domain availability
      • Check availability of several domains
    • Order
      • Order domain
    • Extensions
      • List domain extensions
      • Get domain extension
  • Web hosting
    • Domains
      • List domains
      • Add domain
      • Delete domain
      • Add pointer or alias
      • Delete pointer or alias
      • List subdomains
      • Add subdomain
      • Delete subdomain
      • HTTPS redirect
      • Turn HTTPS redirect on or off
      • List DNS records
      • Add DNS record
      • Delete DNS record
      • Rename domain
      • List redirects
      • Add redirect
      • Delete redirect
      • Hotlink protection
      • Change hotlink protection
    • SSL
      • SSL status of all domains
      • SSL status of a domain
      • Install own certificate
      • Create CSR
      • Request free certificate
    • PHP
      • PHP settings
      • Change PHP settings
    • E-mail
      • List forwarders
      • Create forwarder
      • Change forwarder
      • Delete forwarder
      • List mailboxes
      • Create mailbox
      • Get mailbox
      • Change mailbox
      • Delete mailbox
      • Get autoreply
      • Set autoreply
      • Delete autoreply
      • Get catch-all
      • Set catch-all
      • Get mail settings
      • Change mail settings
    • Databases
      • List databases
      • Create database
      • Delete database
      • Change database password
      • List database users
      • Create database user
      • Delete database user
      • Database privileges
      • Change database privileges
      • List database access hosts
      • Add database access host
      • Delete database access host
    • FTP
      • List FTP accounts
      • Create FTP account
      • Change FTP account
      • Delete FTP account
    • Cron jobs
      • List cron jobs
      • Create cron job
      • Change cron job
      • Delete cron job
    • WordPress
      • List WordPress sites
      • Install WordPress
      • Rescan WordPress sites
      • Get WordPress site
      • Delete WordPress site
      • Purge cache
      • Clone WordPress site
      • List plugins
      • Install plugin
      • Activate or deactivate plugin
      • Delete plugin
      • Push staging to live
      • Change WordPress settings
      • Create staging site
      • List themes
      • Install theme
      • Activate theme
      • Delete theme
      • Update WordPress
    • Reseller
      • List reseller packages
      • Create reseller package
      • Change reseller package
      • Delete reseller package
      • List reseller users
      • Create reseller user
      • Delete reseller user
    • Orders
      • Order a hosting package
      • Quote a hosting package
      • Order extra disk space
      • Reduce extra disk space
      • Quote extra disk space
      • Change package
      • Quote a package change
    • Backups
      • List backups
      • Get backup
      • Restore backup
      • List files in backup
    • Apps
      • List apps
      • Create app
      • Change app
      • Delete app
      • Restart app
      • Install app modules
    • Files
      • List files
      • Delete file or folder
      • Get file content
      • Write file
      • Create folder
      • Move or rename
      • Copy
      • Change permissions
      • Extract archive
      • Create archive
      • Get folder protection
      • Set folder protection
      • Remove protection user
    • Git
      • List Git repositories
      • Create Git repository
      • Get Git repository
      • Change Git repository
      • Delete Git repository
      • Deploy Git repository
      • Fetch Git repository
      • List Git commits
    • List hosting packages
      GET
    • List hosting products
      GET
    • Get hosting package
      GET
    • Cancel hosting package
      DELETE
    • Withdraw cancellation
      PUT
    • Web server logs
      GET
    • Reset account password
      POST
    • SSH access
      GET
    • Turn SSH access on or off
      PUT
    • Usage history
      GET
    • Create login link
      POST
    • Resource usage
      GET
    • Malware found
      GET
    • List SSH keys
      GET
    • Add SSH key
      POST
    • Delete SSH key
      DELETE
    • Redis
      GET
    • Turn Redis on or off
      PUT
  • Virtual Private Servers
    • Backups
      • List backups
      • Create backup
      • Restore backup
      • Delete backup
    • SSH keys
      • List SSH keys
      • Delete SSH key
      • Add SSH key
    • Firewall
      • Get VPS firewall
      • Update VPS firewall
    • VPC
      • Get VPS VPC
      • Create VPS VPC
      • Add VPC subnet
      • Attach VPC subnet
    • Order
      • List VPS products
      • Order VPS
    • Floating IPs
      • List floating IPs
      • Reserve floating IP
      • Attach floating IP
      • Detach floating IP
      • Delete floating IP
    • Volumes
      • List volumes
      • Create volume
      • Attach volume
      • Detach volume
      • Resize volume
      • Delete volume
    • List VPS instances
    • VPS details
    • Update VPS
    • Restart VPS
    • Enable or disable rescue mode
    • Cancel VPS
    • Cancel VPS deletion
    • List available OS images
    • Reinstall VPS
    • Start VPS
    • Stop VPS
    • Power off VPS
    • Reset VPS root password
    • Change VPS hostname
    • Get VPS statistics
    • List VPS licenses
    • Create console link
  • Certificates
    • List certificates
    • Get certificate
    • List certificate products
    • Order certificate
    • Generate CSR
    • Request certificate
  • Orders
    • List orders
    • Get order
    • Update order
  • Affiliate
    • Commissions
      • List affiliate commissions
      • Get affiliate commission
    • Payments
      • List affiliate payments
      • Get affiliate payment
  • Account
    • Profile
      • Get account profile
      • Update account profile
    • Payment methods
      • List payment methods
      • Update default payment method
    • Invoices
      • List invoices
      • Get invoice
      • Download invoice PDF
    • Users
      • List account users
      • Get account user
      • Create account user
      • Update account user
    • Tickets
      • List support tickets
      • Get support ticket
      • Create support ticket
      • Reply to support ticket
  • Tools
    • Get your IP and customer number
  • Tasks
    • Get task
  1. Getting started

Authentication

Every request to the my.host API needs one credential: a personal access token. Create one in the control panel under My account → API access. API keys are deprecated: new ones can no longer be created, and existing keys keep working.
CredentialHeaderCan do
Personal access tokenAuthorization: Bearer mh_pat_…Only the permissions chosen for the token, and never more than the user who created it. Expires after the period you choose (7 days to a year), or has no expiry date. Optionally limited to IP addresses or subnets.
API key (deprecated)API-Key: <key>Everything the user who created it may do. Optionally limited to IP addresses.
A token without an expiry date suits integrations that run unattended, such as WHMCS or automatic certificate renewal. Such a token is revoked after 12 months without use; the user who created it gets an e-mail 30 days before. Using the token again keeps it.
To replace an API key, create a token and put it where the key was: a token also works in the API-Key header.
Send one of the two, not both. Clients that can only send a bearer credential may also send an API key as Authorization: Bearer <key>. Clients that can only send an API-Key header, such as older versions of our WHMCS module, may send a token there: API-Key: mh_pat_….
A credential belongs to the user who created it. When the main user of the account changes that user's permissions, the change applies at once to that user's API keys and tokens.

API key (deprecated)#

Personal access token#

A token is shown once, when you create it: we only store a fingerprint (hash) of it. You can revoke a token at any time in the control panel; it stops working immediately.

Token permissions (scopes)#

When you create a token you choose, per section, what it may do. In the API these are scopes of the form <section>:<level>, for example domains:read or vps:write. Every level includes read for the same section.
LevelIn the control panelAllows
readViewViewing data.
writeChangeChanges that cost nothing but take effect at once, such as DNS records, starting or restarting a VPS, firewall rules, replying to a ticket.
purchaseOrderAnything that costs money: orders, renewals, upgrades, reserving a floating IP.
criticalHigh impactActions you cannot undo and confidential data: deleting or cancelling, reinstalling, restoring a backup, changing the owner of a domain name, auth codes, root and rescue passwords, managing users.
The sections are domains, domains-profiles, domains-nameservers, domains-dns-templates, vps, vps-ssh-keys, vps-floating-ips, hosting, hosting-email, hosting-wordpress, hosting-files, certificates, order, account-profile, account-paymethods, account-invoices, account-tickets, account-users and account-affiliate.
hosting covers web hosting packages, their domains with DNS records, SSL, PHP, databases, FTP, cron jobs, SSH, Redis, Git repositories, Node.js and Python apps, backups and orders; hosting-email their mailboxes, forwarders and autoreplies and the mail settings of a domain; hosting-wordpress their WordPress sites; hosting-files the files and folders of the package. Each hosting endpoint names its scope in its description.
The write level of hosting, hosting-files and hosting-wordpress can run code on the package: through cron jobs, FTP accounts, SSH access and keys, Git repositories and Node.js and Python apps, by placing a file in a website, or through a WordPress plugin or theme. Code on a package runs as its hosting account and reaches everything the account has. So a credential with one of these scopes can in effect read and change everything in that package, including its mail, whatever its other scopes and levels. Give write only to an integration you trust with the whole package.
A credential with only read scopes cannot do this. The file endpoints do not open the folders that hold e-mail or the file with the account's password, so hosting-files:read gives no access to mail.

Errors#

StatusMeaning
401 UnauthorizedNo credential, an unknown or expired credential, a revoked token, or a key or token used from an IP address outside its whitelist.
403 ForbiddenThe credential is valid but may not call this endpoint: the user lacks the permission, or the token lacks the scope.
With 401 and 403 the response has a WWW-Authenticate header as described in RFC 6750. For a missing scope it names the scope:

Security best practices#

Keep credentials confidential. Treat API keys and tokens as passwords. Do not share them or put them in client-side code.
Give a token only what it needs. Choose the fewest sections and levels, and a short lifetime. Only give High impact when the integration really needs it.
Revoke what you no longer use. Revoke a token or deactivate an API key in the control panel as soon as you suspect it has leaked.
Modified at 2026-12-03 10:33:05
Previous
Base url
Next
Response codes
Built with