Articles in this section

How to create domain via REST API?

kb: how-to Plesk Obsidian for Linux Plesk Onyx for Linux ABT: Group A

Applicable to:

  • Plesk Obsidian for Linux
  • Plesk Onyx for Linux

Question

How to create domain via REST API?

Answer

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

    CONFIG_TEXT: {
    "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"  

 

Was this article helpful?

Comments

1 comment
Date Votes
  • When I create  domain it say:

        "code": 1013,
        "message": "Specified Webspace does not exist"

    So the virtual hosting does not exists?

    0

Please sign in to leave a comment.