Code Samples #
Copy
curl --request POST \
--url 'https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/activate' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"type": "plugin",
"slugs": [
"woocommerce",
"akismet"
],
"backup_before_action": false
}'
const response = await fetch('https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/activate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "plugin",
"slugs": [
"woocommerce",
"akismet"
],
"backup_before_action": false
})
});
const data = await response.json();
console.log(data);
import requests
headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
payload = {
"type": "plugin",
"slugs": [
"woocommerce",
"akismet"
],
"backup_before_action": false
}
response = requests.post("https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/activate", headers=headers, json=payload)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://app.xcloud.host/api/v1/sites/{uuid}/wordpress/activate',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_TOKEN',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => '{
"type": "plugin",
"slugs": [
"woocommerce",
"akismet"
],
"backup_before_action": false
}',
]);
$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/sites/{uuid}/wordpress/activate");
request.Headers.Add("Authorization", "Bearer YOUR_TOKEN");
request.Content = new StringContent(@"{
""type"": ""plugin"",
""slugs"": [
""woocommerce"",
""akismet""
],
""backup_before_action"": false
}", 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/sites/{uuid}/wordpress/activate"))
.header("Authorization", "Bearer YOUR_TOKEN")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"type": "plugin",
"slugs": [
"woocommerce",
"akismet"
],
"backup_before_action": false
}
"""))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Response #
Copy
{
"success": true,
"message": "WordPress activation queued.",
"data": {
"operation": {
"uuid": "8c5d7e8a-1234-4abc-9def-1234567890ab",
"status": "queued",
"operation_type": "toggle",
"action": "activate"
},
"queued_items": [
{
"slug": "woocommerce",
"title": "WooCommerce",
"type": "plugin"
}
],
"skipped_items": [
{
"slug": "akismet",
"reason": "already_active"
}
],
"backup_before_action": false
}
}
{
"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 an activate operation for one or more WordPress plugins or themes on the specified site. Asynchronous — returns 202 with an operation UUID. Items that cannot be activated (already active, must-use, or dropin) are reported under skipped_items. 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 |
Request Body #
Content type: application/json — required
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Required | Allowed: plugin, theme |
slugs | array of string | Required | List of `item_name` values to activate (required). |
backup_before_action | boolean | Optional | When true and the site has backup settings configured, a pre-action backup is taken before the activation runs. |
Example request
Copy
{
"type": "plugin",
"slugs": [
"woocommerce",
"akismet"
],
"backup_before_action": false
}
Responses #
202 — Activate queued for asynchronous processing #
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | Optional | |
message | string | Optional | |
data | object | Optional | |
data | object | Optional | |
data.operation | object | Required | |
data.operation.uuid | string (uuid) | Required | |
data.operation.status | string | Required | Allowed: queued, running, completed, failed |
data.operation.operation_type | string | Required | |
data.operation.action | string | Required | Allowed: activate, deactivate |
data.queued_items | array of object | Required | |
data.skipped_items | array of object | Required | |
data.backup_before_action | boolean | Required |
Example 202 response
Copy
{
"success": true,
"message": "WordPress activation queued.",
"data": {
"operation": {
"uuid": "8c5d7e8a-1234-4abc-9def-1234567890ab",
"status": "queued",
"operation_type": "toggle",
"action": "activate"
},
"queued_items": [
{
"slug": "woocommerce",
"title": "WooCommerce",
"type": "plugin"
}
],
"skipped_items": [
{
"slug": "akismet",
"reason": "already_active"
}
],
"backup_before_action": false
}
}
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."
]
}
}
