API documentation
Order, power, snapshot and delete your servers from scripts, CI pipelines and your own tools.
Getting started
The API is a plain REST interface over HTTPS with JSON bodies and bearer tokens. Everything you can do in the console, you can do here.
- Create a token in Settings → API.
- Grant it only the permissions the script needs: every token can read; power, servers, snapshots and ssh-keys are separate grants.
- Send it as a Bearer token in the Authorization header.
curl https://cloudlinux.ro/api/v1/servers \
-H "Authorization: Bearer cl_your_token" \
-H "Accept: application/json"
curl -X POST https://cloudlinux.ro/api/v1/servers/server-abc123/power \
-H "Authorization: Bearer cl_your_token" \
-H "Content-Type: application/json" \
-d '{"action":"reboot"}'- Base URL
- https://cloudlinux.ro/api/v1
- Format
- JSON in and out. Lists come under "data"; paginated lists add "links" and "meta".
- Permissions
- read (always), power, servers, snapshots, ssh-keys. A missing permission answers 403.
- Rate limit
- 120 requests per minute per token. Poll a provisioning server every 10-15 seconds, not faster.
Account
/mescope: readThe account behind the token, its credit and the token’s own scopes.
/billingscope: readCredit, hourly and monthly burn, days left, month-to-date spend and budget.
/billing/transactionsscope: readTransaction history, newest first, 50 per page (?page=).
Catalog
/locationsscope: readEvery location you can order in, with its plans (hourly and monthly prices) and operating-system images.
Use the plan, location and image ids from here when ordering.
/appsscope: readOne-click applications (installed on Ubuntu; pass app_id instead of image_id).
Servers
/serversscope: readYour servers. Filters: ?project_id=, ?status=.
/serversscope: serversOrder a server. Provisioning is asynchronous: poll the server until status is "running".
{ "plan_id": 12, "location_id": 3, "image_id": 7, "ssh_key_ids": [1], "display_name": "web-1", "project_id": null }Optional: app_id (replaces image_id), recipe_id, root_password (8-72 chars). Needs credit for at least one hour.
/servers/{id}scope: readOne server. {id} is the numeric id or the server name (server-xxxxxx).
/servers/{id}scope: serversRename or move to a project.
{ "display_name": "web-2", "project_id": 4 }/servers/{id}scope: serversDelete the server. The hour in progress is billed. Returns 204.
/servers/{id}/powerscope: powerPower action. Returns the server with its transient status (starting / stopping).
{ "action": "reboot" }Actions: on, shutdown (graceful), off (forced), reboot (graceful), reset (hard).
/servers/{id}/reinstallscope: serversRebuild with a fresh operating system. Everything on the disk is lost.
{ "image_id": 7 }/servers/{id}/rescale-optionsscope: readPlans the server can move to, with in_stock and disk_ok flags.
/servers/{id}/rescalescope: serversChange the plan. The server must be powered off.
{ "plan_id": 15, "upgrade_disk": false }/servers/{id}/metricsscope: readCPU, network and disk series. ?range=1h|6h|24h|7d.
Snapshots
/servers/{id}/snapshotsscope: readSnapshots of a server, newest first.
/servers/{id}/snapshotsscope: snapshotsTake a snapshot. Stored snapshots bill hourly by size.
{ "name": "before-upgrade", "include_memory": false }Names: 2-40 characters, letters, digits, dashes or underscores, starting with a letter. "auto-" is reserved.
/servers/{id}/snapshots/{snapshot}/restorescope: snapshotsRebuild the server from the snapshot.
/servers/{id}/snapshots/{snapshot}scope: snapshotsDelete a snapshot. Returns 202 with result "deleted" or "scheduled".
SSH keys
/ssh-keysscope: readYour public keys.
/ssh-keysscope: ssh-keysAdd a public key (OpenSSH format).
{ "name": "laptop", "public_key": "ssh-ed25519 AAAA... user@host" }/ssh-keys/{id}scope: ssh-keysRemove a key. Servers already created keep it.
Projects
/projectsscope: readYour projects (server folders) with server counts.
/projectsscope: serversCreate a project.
{ "name": "Client A" }/projects/{id}scope: serversRename a project.
{ "name": "Client B" }/projects/{id}scope: serversDelete a project. Its servers keep running, unassigned.
Responses and errors
Errors carry a human-readable "message" and, for validation, an "errors" map keyed by field. Messages follow the language set on your account.
200 / 201 / 204Success. 201 after creating a resource, 204 after deleting one.202Accepted: the work was queued (snapshot deletion).401Missing, unknown or expired token.403The token lacks the scope, the server is suspended, or the account is blocked.404No such resource on this account.409The server is busy with another operation: retry in a moment.422Validation failed. The body lists the fields under "errors".429Rate limit: 120 requests per minute per token.503The platform could not complete the action right now: retry in a moment.