Install WordPress
Install WordPress on an existing website.
Install WordPress on an existing website.
The website must already exist before calling this endpoint. To create a new website first, use POST /api/hosting/v1/websites and poll GET /api/hosting/v1/websites until it appears.
Call GET /api/hosting/v1/wordpress/installations filtered by username and
domain before proceeding to check whether WordPress is already installed on
the target domain/path. If WordPress already exists and overwrite is false
(the default), the async job will fail.
This operation is asynchronous: a successful response only means the install job has been queued, not that WordPress is ready. Installation typically takes 1-2 minutes. Poll GET /api/hosting/v1/wordpress/installations filtered by username and domain to track progress. When the installation appears in that list, WordPress is ready.
API Token authentication
u123456789Domain of the existing website where WordPress will be installed
example.comTitle of the WordPress site
My siteWordPress locale. Defaults to en_US when omitted.
en_USRelative directory to install WordPress into. Defaults to the website root when omitted.
public_htmlWhen false (default), does not replace an existing installation. If WordPress is already installed on the domain/path, the async install job fails unless true.
falseWordPress core auto-update policy
minorPossible values: WordPress core version to install. If omitted, the latest core version compatible with the account vhost PHP version is selected.
6.5.2Success empty response
Request acceptedUnauthenticated response
Validation error response
Error response
POST /api/hosting/v1/accounts/{username}/wordpress/installations HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 282
{
"domain": "example.com",
"site_title": "My site",
"language": "en_US",
"directory": "public_html",
"overwrite": false,
"auto_updates": "minor",
"version": "6.5.2",
"credentials": {
"email": "owner@example.com",
"login": "admin",
"password": "********"
},
"database": {
"name": "mydb",
"password": "********"
}
}{
"message": "Request accepted"
}Last updated
Was this helpful?