Code Samples #
Copy
curl --request POST \
--url 'https://app.xcloud.host/api/v1/servers/{uuid}/sites/wordpress' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"mode": "live",
"domain": "example.com",
"title": "My Awesome Site",
"php_version": "8.2",
"ssl": {
"provider": "letsencrypt"
},
"wordpress_version": "6.7",
"multisite": {
"enabled": false,
"type": "subdirectory"
},
"blueprint_uuid": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"snapshot_uuid": "d4e5f6a7-b8c9-0123-defa-234567890123",
"cache": {
"full_page": false,
"object_cache": false
},
"cloudflare": false,
"additional_domains": [
"www.example.com",
"shop.example.com"
],
"deploy_script": "cd $SITE_PATH && wp plugin install woocommerce --activate",
"tags": [
"production",
"client-site"
]
}'
const response = await fetch('https://app.xcloud.host/api/v1/servers/{uuid}/sites/wordpress', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"mode": "live",
"domain": "example.com",
"title": "My Awesome Site",
"php_version": "8.2",
"ssl": {
"provider": "letsencrypt"
},
"wordpress_version": "6.7",
"multisite": {
"enabled": false,
"type": "subdirectory"
},
"blueprint_uuid": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"snapshot_uuid": "d4e5f6a7-b8c9-0123-defa-234567890123",
"cache": {
"full_page": false,
"object_cache": false
},
"cloudflare": false,
"additional_domains": [
"www.example.com",
"shop.example.com"
],
"deploy_script": "cd $SITE_PATH && wp plugin install woocommerce --activate",
"tags": [
"production",
"client-site"
]
})
});
const data = await response.json();
console.log(data);
import requests
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
payload = {
"mode": "live",
"domain": "example.com",
"title": "My Awesome Site",
"php_version": "8.2",
"ssl": {
"provider": "letsencrypt"
},
"wordpress_version": "6.7",
"multisite": {
"enabled": false,
"type": "subdirectory"
},
"blueprint_uuid": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"snapshot_uuid": "d4e5f6a7-b8c9-0123-defa-234567890123",
"cache": {
"full_page": false,
"object_cache": false
},
"cloudflare": false,
"additional_domains": [
"www.example.com",
"shop.example.com"
],
"deploy_script": "cd $SITE_PATH && wp plugin install woocommerce --activate",
"tags": [
"production",
"client-site"
]
}
response = requests.post("https://app.xcloud.host/api/v1/servers/{uuid}/sites/wordpress", headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://app.xcloud.host/api/v1/servers/{uuid}/sites/wordpress',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_TOKEN',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => '{
"mode": "live",
"domain": "example.com",
"title": "My Awesome Site",
"php_version": "8.2",
"ssl": {
"provider": "letsencrypt"
},
"wordpress_version": "6.7",
"multisite": {
"enabled": false,
"type": "subdirectory"
},
"blueprint_uuid": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"snapshot_uuid": "d4e5f6a7-b8c9-0123-defa-234567890123",
"cache": {
"full_page": false,
"object_cache": false
},
"cloudflare": false,
"additional_domains": [
"www.example.com",
"shop.example.com"
],
"deploy_script": "cd $SITE_PATH && wp plugin install woocommerce --activate",
"tags": [
"production",
"client-site"
]
}',
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
using System.Net.Http;
using System.Text;
var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://app.xcloud.host/api/v1/servers/{uuid}/sites/wordpress");
request.Headers.Add("Authorization", "Bearer YOUR_TOKEN");
request.Content = new StringContent(@"{
""mode"": ""live"",
""domain"": ""example.com"",
""title"": ""My Awesome Site"",
""php_version"": ""8.2"",
""ssl"": {
""provider"": ""letsencrypt""
},
""wordpress_version"": ""6.7"",
""multisite"": {
""enabled"": false,
""type"": ""subdirectory""
},
""blueprint_uuid"": ""b1c2d3e4-f5a6-7890-bcde-f12345678901"",
""snapshot_uuid"": ""d4e5f6a7-b8c9-0123-defa-234567890123"",
""cache"": {
""full_page"": false,
""object_cache"": false
},
""cloudflare"": false,
""additional_domains"": [
""www.example.com"",
""shop.example.com""
],
""deploy_script"": ""cd $SITE_PATH && wp plugin install woocommerce --activate"",
""tags"": [
""production"",
""client-site""
]
}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.xcloud.host/api/v1/servers/{uuid}/sites/wordpress"))
.header("Authorization", "Bearer YOUR_TOKEN")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"mode": "live",
"domain": "example.com",
"title": "My Awesome Site",
"php_version": "8.2",
"ssl": {
"provider": "letsencrypt"
},
"wordpress_version": "6.7",
"multisite": {
"enabled": false,
"type": "subdirectory"
},
"blueprint_uuid": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"snapshot_uuid": "d4e5f6a7-b8c9-0123-defa-234567890123",
"cache": {
"full_page": false,
"object_cache": false
},
"cloudflare": false,
"additional_domains": [
"www.example.com",
"shop.example.com"
],
"deploy_script": "cd $SITE_PATH && wp plugin install woocommerce --activate",
"tags": [
"production",
"client-site"
]
}
"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Response #
Copy
{
"success": true,
"message": "WordPress site provisioning started.",
"data": {
"uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"domain": "example.com",
"title": "My Awesome Site",
"type": "wordpress",
"mode": "live",
"status": "provisioning",
"server_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"auto_generated": {
"admin_password": "Xc!9pMnK2v#rT",
"database_password": "Db#7qWnZ4xA!p"
}
}
}
{
"success": false,
"message": "The given data was invalid.",
"data": null,
"errors": {
"domain": [
"The domain field is required when mode is live."
]
}
}
{
"success": false,
"message": "Unauthenticated.",
"data": null
}
{
"success": false,
"message": "This action is unauthorized. Your token is missing the required scope.",
"data": null
}
{
"success": false,
"message": "Not found.",
"data": null
}
{
"success": false,
"message": "The domain example.com is already in use on this server.",
"data": null
}
Provisions a New WordPress site on the specified Server. This is an asynchronous operation — the site will be in provisioning status until ready.
Notes: – domain is required when mode is live; omit for demo sites (a subdomain is auto-generated) – ssl.provider is required for live mode – If multisite.enabled is true, multisite.type defaults to subdirectory – Credentials (admin password, database password) are returned in auto_generated only once
Requires the write:servers scope.
Path Parameters #
| Name | Type | Required | Description |
|---|---|---|---|
uuid | string (uuid) | Required | UUID of the Server |
Request Body #
Content type: application/json — required
| Field | Type | Required | Description |
|---|---|---|---|
mode | string | Required | `live` creates a real production site with a custom domain. `demo` creates a temporary site with an auto-generated xcloud.host subdomain. Allowed: live, demo |
domain | string | Optional | Primary domain name. Required when `mode` is `live`. |
title | string | Required | WordPress site title. |
php_version | string | Optional | PHP version to use. If the version is not already installed on the Server, it will be installed automatically. Available versions depend on the Server type. When omitted, defaults to the Server's current PHP version. |
ssl | object | Optional | SSL configuration. Required when `mode` is `live`. |
ssl.provider | string | Optional | SSL provider. `xcloud` uses xCloud's shared SSL. `letsencrypt` issues a free Let's Encrypt cert. `cloudflare` proxies through Cloudflare. Allowed: xcloud, letsencrypt, cloudflare |
wordpress_version | string | Optional | WordPress version to install. Defaults to latest stable. |
multisite | object | Optional | |
multisite.enabled | boolean | Optional | |
multisite.type | string | Optional | Allowed: subdirectory, subdomain |
blueprint_uuid | string (uuid) | Optional | UUID of a blueprint to apply after installation. Get available blueprints from `GET /blueprints`. Mutually exclusive with `snapshot_uuid`. |
snapshot_uuid | string (uuid) | Optional | UUID of a site snapshot to restore from. |
cache | object | Optional | Cache configuration. On Nginx servers, full-page cache and Redis object cache are separate plugins. On OpenLiteSpeed servers, enabling full-page cache installs LiteSpeed Cache plugin which includes built-in object caching. |
cache.full_page | boolean | Optional | Enable full-page caching. Nginx: installs FastCGI cache. OpenLiteSpeed: installs LiteSpeed Cache plugin. |
cache.object_cache | boolean | Optional | Enable object caching. Nginx: installs Redis Object Cache plugin. OpenLiteSpeed: included with LiteSpeed Cache. |
cloudflare | boolean | Optional | Auto-discover and configure Cloudflare for the domain (requires a connected Cloudflare integration with the domain's zone). |
additional_domains | array of string | Optional | Additional domains to point to this site. |
deploy_script | string | Optional | Custom shell script to run after WordPress installation. |
tags | array of string | Optional | Tags to apply to the site for organization. |
Example request
Copy
{
"mode": "live",
"domain": "example.com",
"title": "My Awesome Site",
"php_version": "8.2",
"ssl": {
"provider": "letsencrypt"
},
"wordpress_version": "6.7",
"multisite": {
"enabled": false,
"type": "subdirectory"
},
"blueprint_uuid": "b1c2d3e4-f5a6-7890-bcde-f12345678901",
"snapshot_uuid": "d4e5f6a7-b8c9-0123-defa-234567890123",
"cache": {
"full_page": false,
"object_cache": false
},
"cloudflare": false,
"additional_domains": [
"www.example.com",
"shop.example.com"
],
"deploy_script": "cd $SITE_PATH && wp plugin install woocommerce --activate",
"tags": [
"production",
"client-site"
]
}
Responses #
202 — WordPress site provisioning started #
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | |
message | string | Optional | |
data | object | Optional | |
data | object | Optional | |
data.uuid | string (uuid) | Optional | |
data.domain | string | Optional | |
data.title | string | Optional | |
data.type | string | Optional | |
data.mode | string | Optional | Allowed: live, demo |
data.status | string | Optional | |
data.server_uuid | string (uuid) | Optional | |
data.auto_generated | object | Optional | Auto-generated credentials — shown only once, store securely. |
data.auto_generated.admin_password | string | Optional | |
data.auto_generated.database_password | string | Optional |
Example 202 response
Copy
{
"success": true,
"message": "WordPress site provisioning started.",
"data": {
"uuid": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"domain": "example.com",
"title": "My Awesome Site",
"type": "wordpress",
"mode": "live",
"status": "provisioning",
"server_uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"auto_generated": {
"admin_password": "Xc!9pMnK2v#rT",
"database_password": "Db#7qWnZ4xA!p"
}
}
}
400 — Request validation failed #
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | |
message | string | Optional | |
data | object | Optional | |
errors | object | Optional |
Example 400 response
Copy
{
"success": false,
"message": "The given data was invalid.",
"data": null,
"errors": {
"domain": [
"The domain field is required when mode is live."
]
}
}
401 — Missing or invalid authentication token #
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | |
message | string | Optional | |
data | object | Optional |
Example 401 response
Copy
{
"success": false,
"message": "Unauthenticated.",
"data": null
}
403 — Token lacks the required scope #
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | |
message | string | Optional | |
data | object | Optional |
Example 403 response
Copy
{
"success": false,
"message": "This action is unauthorized. Your token is missing the required scope.",
"data": null
}
404 — Resource not found or not accessible to your Team #
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | |
message | string | Optional | |
data | object | Optional |
Example 404 response
Copy
{
"success": false,
"message": "Not found.",
"data": null
}
422 — Business rule Violation (e.g. domain already in use) #
Example 422 response
Copy
{
"success": false,
"message": "The domain example.com is already in use on this server.",
"data": null
}
