Start website setup
Starts a website setup on a Web or Cloud hosting order and returns the created setup right away; the website itself is provisioned asynchronously.
Starts a website setup on a Web or Cloud hosting order and returns the created setup
right away; the website itself is provisioned asynchronously. Poll the list website
setups endpoint (hosting_websites_list-setups) with the domain filter every 10 to 15
seconds and wait for status: completed before uploading files, deploying or creating
databases.
Omit type for an empty website. type: wordpress installs WordPress in the website
root with the admin user, email and password from wordpress, the domain as the site
title, and en_US when wordpress.language is omitted. The headless types
(headless_empty, headless_wordpress, headless_ecommerce, headless_pocketbase)
create a headless website; headless_wordpress additionally installs WordPress into the
cms directory of the website root with generated credentials. headless_pocketbase
marks the website as a headless PocketBase website but installs nothing: create its
PocketBase backend with Create PocketBase backend
(POST /api/hosting/v1/accounts/{username}/websites/{domain}/pocketbase) once the setup
is completed. headless_empty installs nothing either: WordPress can be added later
through POST /api/hosting/v1/accounts/{username}/wordpress/installations
(wordpress_installations_install) with type: headless, or a PocketBase backend through
the same PocketBase endpoint.
Omit domain to set the website up on a generated temporary free subdomain; the created
setup returns it as domain. REST clients that need to know the free subdomain before the
call, so a timed-out call can be looked up and retried on the same domain, can generate
one through POST /api/hosting/v1/domains/free-subdomains and send it as domain. It is
accepted for 24 hours, only from the client that generated it.
When the order has no hosting account yet, the setup creates one first, in the datacenter
given by datacenter_code or the order's default datacenter when it is omitted.
Returns 404 when the order does not exist or is not accessible to the authenticated
client, and 409 with a Retry-After header while a setup for the same domain is still
running.
API Token authentication
Hosting order ID. List orders to find available IDs.
12345Website type, domain and WordPress settings for a new website setup
Website type. Omit or null for an empty website. wordpress installs WordPress in the website root and requires wordpress. The headless types (headless_empty, headless_wordpress, headless_ecommerce, headless_pocketbase) create a headless website; headless_wordpress additionally installs WordPress into the cms directory with generated credentials. headless_pocketbase only marks the website as a headless PocketBase website: create the backend afterwards with Create PocketBase backend (POST /api/hosting/v1/accounts/{username}/websites/{domain}/pocketbase). headless_empty installs nothing, so WordPress can be added later through POST /api/hosting/v1/accounts/{username}/wordpress/installations (wordpress_installations_install) with type: headless, or a PocketBase backend through the PocketBase endpoint.
wordpressPossible values: Customer-owned domain. Omit or null to set the website up on a generated temporary free subdomain. Cannot start with "www." and can have at most one subdomain level, e.g. blog.example.com. A free subdomain generated through POST /api/hosting/v1/domains/free-subdomains in the last 24 hours is also accepted.
example.comDatacenter for the hosting account when the order does not have one yet. Omit to use the order's default datacenter. Ignored when the order already has a hosting account. List available datacenters to find valid codes.
us-east-1Created response
Domain of the website being set up.
example.comHosting account username.
u123456789Website type requested for the setup: wordpress, headless_empty, headless_wordpress, headless_ecommerce or headless_pocketbase. null for an empty website. Setups started outside this API may report other legacy types.
wordpressrunning while the website is still being set up, completed once the setup has finished, failed when it stopped before finishing or has not reported progress for over an hour.
runningPossible values: When the setup was requested.
2024-01-15T10:30:00.000000ZWhen the setup last reported progress.
2024-01-15T10:32:00.000000ZUnauthenticated response
Error response
Conflict response. Retry-After, when present, is the number of seconds to wait before retrying.
Validation error response
Error response
POST /api/hosting/v1/orders/{order_id}/onboardings HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 213
{
"type": "wordpress",
"domain": "example.com",
"datacenter_code": "us-east-1",
"wordpress": {
"language": "en_US",
"is_ai_builder": false,
"admin": {
"user": "site_admin",
"password": "S3curePass123",
"email": "admin@example.com"
}
}
}{
"domain": "example.com",
"username": "u123456789",
"type": "wordpress",
"status": "running",
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-15T10:32:00.000000Z"
}Last updated
Was this helpful?