Code Samples #
Copy
curl --request GET \
--url 'https://app.xcloud.host/api/v1/sites/{uuid}/monitoring/history' \
--header 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://app.xcloud.host/api/v1/sites/{uuid}/monitoring/history', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_TOKEN'
}
});
const data = await response.json();
console.log(data);
import requests
headers = {
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.get("https://app.xcloud.host/api/v1/sites/{uuid}/monitoring/history", headers=headers)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://app.xcloud.host/api/v1/sites/{uuid}/monitoring/history',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
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("GET"), "https://app.xcloud.host/api/v1/sites/{uuid}/monitoring/history");
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}/monitoring/history"))
.header("Authorization", "Bearer YOUR_TOKEN")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Response #
Copy
{
"success": true,
"message": "Operation completed successfully.",
"data": {
"site": {
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"name": "string"
},
"range": "24h",
"samples": [
{
"ram_usage": 12.5,
"cpu_usage": 8.3,
"disk_usage": 25.1,
"time_at": "09:00 AM",
"sampled_at": "2024-01-15T09:30:00Z"
}
]
}
}
{
"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."
]
}
}
Returns a time-series of CPU, RAM, and disk usage for the site, sampled from the most recent Server monitor snapshots. Pass range=24h for the last 24 hours, or range=7d (default) for the last 7 days. Requires the read:sites scope and the site:manage-monitoring Team permission. Returns 403 on free plans — monitoring history is a paid feature.
Path Parameters #
| Name | Type | Required | Description |
|---|---|---|---|
uuid | string (uuid) | Required | UUID of the site |
Query Parameters #
| Name | Type | Required | Description |
|---|---|---|---|
range | string | Optional |
Responses #
200 — Monitoring history #
| 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 | |
data.range | string | Optional | Allowed: 24h, 7d |
data.samples | array of object | Optional |
Example 200 response
Copy
{
"success": true,
"message": "Operation completed successfully.",
"data": {
"site": {
"uuid": "123e4567-e89b-12d3-a456-426614174000",
"name": "string"
},
"range": "24h",
"samples": [
{
"ram_usage": 12.5,
"cpu_usage": 8.3,
"disk_usage": 25.1,
"time_at": "09:00 AM",
"sampled_at": "2024-01-15T09:30:00Z"
}
]
}
}
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."
]
}
}
