API Reference
Interact with the CloudNexus infrastructure programmatically. Our RESTful API supports JSON and provides comprehensive control over your cloud resources.
https://api.cloudnexus.com/v1
Response Format
All responses are returned in JSON format. Successful responses use standard HTTP 2xx status codes.
{
"status": "success",
"data": { ... },
"meta": {
"request_id": "req_8f3k29d...",
"timestamp": "2025-05-22T10:42:00Z"
}
}
Authentication
The CloudNexus API uses API Keys for authentication. You can generate keys from the Dashboard. Include your API key in the Authorization header as a Bearer token.
curl https://api.cloudnexus.com/v1/servers \\
-H "Authorization: Bearer cn_live_sk_4f29..."
const { CloudNexus } = require('cloudnexus-sdk');
const cn = new CloudNexus({
apiKey: process.env.CLOUDNEXUS_API_KEY
});
const servers = await cn.servers.list();
import cloudnexus
client = cloudnexus.Client(api_key=os.environ["CN_API_KEY"])
servers = client.servers.list()
Servers
Manage your VPS instances, create deployments, and monitor resources.
Creates a new VPS instance in the specified region. The server will be provisioned asynchronously.
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | Required | Human-readable name for the server. |
plan |
string | Required | Server plan identifier (e.g., starter, pro, enterprise). |
region |
string | Required | Data center region code (e.g., us-east-1, eu-west-2). |
image |
string | Optional | OS image slug. Defaults to ubuntu-22.04. |
ssh_keys |
string[] | Optional | Array of SSH key IDs to add to the server. |
Example Request
{
"name": "production-web-01",
"plan": "pro",
"region": "us-east-1",
"image": "ubuntu-22.04",
"ssh_keys": ["key_8f3k29", "key_9d2m41"]
}
Example Response
{
"status": "success",
"data": {
"id": "srv_3k29f8d",
"name": "production-web-01",
"plan": "pro",
"region": "us-east-1",
"status": "provisioning",
"ipv4": "192.168.10.42",
"created_at": "2025-05-22T10:42:00Z"
}
}
Returns a paginated list of servers associated with your account.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page |
integer | Page number for pagination. Default: 1. |
per_page |
integer | Number of items per page. Default: 20, Max: 100. |
status |
string | Filter by status: active, provisioning, suspended. |
Managed Databases
Provision and manage PostgreSQL, MySQL, Redis, and MongoDB instances.
curl -X POST https://api.cloudnexus.com/v1/databases \\
-H "Authorization: Bearer cn_live_sk_..." \\
-H "Content-Type: application/json" \\
-d '{
"engine": "postgresql",
"version": "15.4",
"plan": "standard",
"name": "app-db-prod",
"region": "us-east-1"
}'
Error Codes
The CloudNexus API uses conventional HTTP status codes to indicate the success or failure of a request.
| Code | Meaning | Description |
|---|---|---|
400 |
Bad Request | Missing or invalid parameters. |
401 |
Unauthorized | Invalid or missing API key. |
403 |
Forbidden | Insufficient permissions for this action. |
404 |
Not Found | The requested resource does not exist. |
429 |
Too Many Requests | Rate limit exceeded. Back off and retry. |
500 |
Server Error | Something went wrong on CloudNexus's end. |