Start a new WordPress installation on a domain
Changed onThis function starts a new WordPress installation on a domain that the caller owns. The installation runs in the background, so the function returns as soon as it queues the task.
Note:
- Poll progress with get_task_progress and the returned install_id value. That works with a cPanel API token, unlike the sse_url stream, which needs an interactive cPanel session.
- A domain that already has a WordPress installation is not an error. The call succeeds with the status field set to collision and lists the existing installations, and it queues nothing. To replace the existing site, call remove_installation for each entry in the existing_installations field, then call this function again.
- The data.status field reports the outcome of this call. Do not confuse it with the result.status field, which reports whether the call itself succeeded.
- This function needs the redirects and mysql features in addition to the wp-toolkit feature that the whole module needs. It also refuses the call when the account has too little free disk space, or when the account already holds as many WordPress websites as its plan allows.
- The background task can still fail after this function returns, for example when a feature is revoked in the meantime. Read the outcome from get_task_progress.
Request
- Base URLhttps://cpanel-server.tld:2083/execute
- AuthHTTP basic
Request body application/x-www-form-urlencoded
Example request
{
"domain": "example.com",
"title": "My Blog"
}Response
The HTTP request was successful.
Example response
{
"apiversion": 3,
"func": "create_website",
"module": "WPX",
"result": {
"data": {
"blocked_by": [
"system_default"
],
"domain": "example.com",
"domain_package": "ea-php73",
"domain_version": "7.3",
"domain_version_source": "domain",
"domain_version_vhost": "example.com",
"effective_version": "7.3",
"existing_installations": [
{
"id": 17,
"url": "https://example.com"
}
],
"install_id": "1784237244-988110-12345",
"required_version": "7.4",
"sse_url": "/sse/UserTasks/00000000_63d7f020927f8f/wpx_install_1784237244-988110-12345.log",
"status": "running",
"system_default_package": "ea-php73",
"system_default_version": "7.3",
"task_id": "00000000/63d7f020927f8f"
},
"metadata": {
"transformed": 1
},
"status": 1
}
}Changes
- warning
added the new
unsupported_phpenum value to the//response property for the response status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status
- warning
- info
endpoint added
- info