xCloud Public API
xCloud Public API
A self-service REST API for all xCloud customers. Use this API to programmatically manage your servers, sites, databases, backups, cron jobs, and more — directly from your own scripts, CI/CD pipelines, or integrations.
Authentication
All API requests (except GET /health) require a Sanctum Personal Access Token
passed as a Bearer token in the Authorization header.
Creating a Token
- Log in to app.xcloud.host
- Navigate to Account → API Tokens (
/user/api-tokens) - Click Create New Token
- Select the required scopes for your use case
- Copy the token — it is shown only once
Available Scopes
| Scope | Access |
|---|---|
read:servers |
List and view servers, databases, cron jobs, PHP versions, monitoring, sudo users |
write:servers |
Reboot servers, create WordPress sites, manage sudo users |
read:sites |
List and view sites, backups, SSL, domain, git, deployment logs, SSH config |
write:sites |
Trigger backups, rescue sites, purge cache, update SSH/SFTP config |
* |
Full access to all endpoints |
Required Headers
Authorization: Bearer <your-token>
Accept: application/json
Content-Type: application/json
Response Format
All responses follow a consistent envelope:
{
"success": true,
"message": "Operation completed successfully.",
"data": { ... }
}
For paginated lists, data contains:
{
"data": [ ... ],
"meta": {
"current_page": 1,
"last_page": 5,
"per_page": 15,
"total": 72
}
}
HTTP Status Codes
| Code | Meaning |
|---|---|
200 OK |
Request successful |
202 Accepted |
Async operation queued (e.g. reboot, backup) |
400 Bad Request |
Validation error — check errors in response body |
401 Unauthorized |
Missing or invalid token |
403 Forbidden |
Token lacks the required scope |
404 Not Found |
Resource not found or not accessible to your team |
422 Unprocessable Entity |
Business logic validation failure |
429 Too Many Requests |
Rate limit exceeded |
500 Internal Server Error |
Server error — contact support |
Rate Limits
| Type | Limit |
|---|---|
| Authenticated requests | 60 requests / minute |
| Unauthenticated requests | 10 requests / minute |
Rate limit headers are included in every response:
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1710000060
When you exceed the limit, the API returns 429 Too Many Requests with a
Retry-After header indicating how many seconds to wait.