Code Samples #
Copy
curl --request POST \
--url 'https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/refresh' \
--header 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/refresh', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
});
const data = await response.json();
console.log(data);
import requests
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.post("https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/refresh", headers=headers)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/refresh',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_TOKEN'
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
using System.Net.Http;
var client = new HttpClient();
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/refresh");
request.Headers.Add("Authorization", "Bearer YOUR_TOKEN");
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/sites/{uuid}/wordpress/refresh"))
.header("Authorization", "Bearer YOUR_TOKEN")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Response #
Copy
{
"success": true,
"message": "WordPress refresh queued.",
"data": {
"site": {
"uuid": "1a2b3c4d-5e6f-7890-abcd-1234567890ef",
"name": "my-wordpress-site"
}
}
}
{
"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 given data was invalid.",
"data": null,
"errors": {
"domain": [
"The domain field is required when mode is live."
]
}
}
Queues a background scan of the site that re-reads WordPress core, plugins, and themes from the Server. Use after manual changes outside xCloud. Returns 202 — completion is asynchronous; poll GET /sites/{uuid}/wordpress/updates afterwards. Requires the write:sites scope and the site:manage-update Team permission.
Path Parameters #
| Name | Type | Required | Description |
|---|---|---|---|
uuid | string (uuid) | Required | UUID of the site |
Responses #
202 — Refresh queued for asynchronous processing #
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | |
message | string | Optional | |
data | object | Optional | |
data | object | Optional | |
data.site | object | Optional | |
data.site.uuid | string (uuid) | Optional | |
data.site.name | string | Optional |
Example 202 response
Copy
{
"success": true,
"message": "WordPress refresh queued.",
"data": {
"site": {
"uuid": "1a2b3c4d-5e6f-7890-abcd-1234567890ef",
"name": "my-wordpress-site"
}
}
}
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 — Request validation failed #
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | |
message | string | Optional | |
data | object | Optional | |
errors | object | Optional |
Example 422 response
Copy
{
"success": false,
"message": "The given data was invalid.",
"data": null,
"errors": {
"domain": [
"The domain field is required when mode is live."
]
}
}
