Plesk

How to create domain via REST API?

Question

How to create domain via REST API?

Answer

  1. Create plesk-domain.json file with the following content to store the request body:

    {
    "name": "example.com",
    "hosting_type": "virtual",
    "hosting_settings": {
    "ftp_login": "ftplogin",
    "ftp_password": "ftppassword"
    },
    "ipv4": ["212.XXX.XXX.XXX"],
    "plan": {
    "name": "Unlimited"
    }
    }

  2. Execute the following API request:

    # curl -k -u admin:'password' -X POST -d @plesk-domain.json "https://<plesk-host>:8443/api/v2/domains"  

 

Exit mobile version