API Overview

The CloudNexus REST API enables you to programmatically manage your cloud infrastructure. Create, scale, and monitor instances, networks, databases, and storage resources with predictable, versioned endpoints.

💡
Interactive Explorer Use our API Playground to test endpoints directly in your browser. Requires a valid API key.

Base URL & Versions

All API requests are sent over HTTPS. Calls made without encryption will fail.

Base URL
https://api.cloudnexus.com/v2

The API is versioned via the URL path. The current stable version is v2. Breaking changes will only be introduced in major version updates.

Authentication

Authenticate your requests by including an API key in the Authorization header using the Bearer scheme.

Header
Authorization: Bearer <your_api_key>
⚠️
Keep your keys secure Never expose API keys in client-side code or public repositories. Use environment variables or secrets managers.

You can manage and rotate API keys in the CloudNexus Dashboard → Settings → API Keys.

Compute & Instances

Manage virtual machines, containers, and serverless functions. Provision resources in any of our 50+ global regions.

GET /instances

Retrieve a paginated list of all compute instances in your account.

Query Parameters

ParameterTypeRequiredDescription
regionstringNoFilter by region ID (e.g., us-east-1)
statusstringNoFilter by status: running, stopped, provisioning
limitintegerNoNumber of results (default: 20, max: 100)
cursorstringNoPagination cursor from previous response
Response 200
{
  "data": [
    {
      "id": "inst_8f9a2b3c4d",
      "name": "prod-api-01",
      "region": "us-east-1",
      "status": "running",
      "cpu": 4,
      "memory_gb": 16,
      "ipv4": "192.168.10.45",
      "created_at": "2025-01-15T08:30:00Z"
    }
  ],
  "pagination": {
    "next_cursor": "eyJpZCI6MTAwfQ==",
    "has_more": true
  }
}
POST /instances

Provision a new compute instance. Supports custom images, SSH keys, and network configurations.

Request Body

FieldTypeRequiredDescription
namestringYesHuman-readable identifier
regionstringYesTarget deployment region
planstringYesInstance type: micro, standard-4, memory-16
imagestringYesOS image slug or custom ID
ssh_keysarrayNoArray of SSH key IDs to attach
user_datastringNoBase64-encoded cloud-init script
PUT /instances/:id/restart

Gracefully restart a running instance. Returns immediately; instance status will transition to rebooting.

Response 202
{
  "id": "inst_8f9a2b3c4d",
  "status": "rebooting",
  "message": "Restart initiated successfully"
}

Networking & Firewalls

Configure VPCs, load balancers, private networks, and security rules. All traffic is isolated by default.

GET /networks

List all private networks and VPCs associated with your account.

ParameterTypeRequiredDescription
vpc_idstringNoFilter by parent VPC
environmentstringNoTag filter: production, staging

Storage & Volumes

Attach persistent block storage, manage snapshots, and configure lifecycle policies for automated backups.

GET /volumes

Retrieve all block storage volumes. Supports filtering by attachment state and region.

Error Handling

The API uses standard HTTP status codes and returns detailed error objects in JSON format.

CodeMeaningCommon Causes
400Bad RequestInvalid JSON, missing required fields, malformed query params
401UnauthorizedMissing/invalid API key, expired token
403ForbiddenInsufficient permissions, region access blocked
404Not FoundResource ID doesn't exist, endpoint typo
409ConflictDuplicate name, resource already in requested state
422UnprocessableValidation failed, invalid image slug, quota exceeded
429Too Many RequestsRate limit exceeded
500Internal ErrorUpstream service failure, infrastructure issue
Error Response
{
  "error": {
    "code": 422,
    "message": "Validation failed",
    "details": [
      {
        "field": "region",
        "message": "Invalid region identifier"
      }
    ]
  }
}

Rate Limiting

API requests are rate-limited to ensure fair usage and platform stability. Limits vary by plan and endpoint type.

Response Headers
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 582
X-RateLimit-Reset: 1737849600
Retry-After: 42 /* Only present on 429 responses */
⏱️
Standard Limits Free Tier: 60 requests/minute
Pro Tier: 600 requests/minute
Enterprise: 2,000+ requests/minute (custom)

Implement exponential backoff when receiving 429 responses. Respect the Retry-After header to avoid repeated failures.

SDKs & Tools

Accelerate development with our official client libraries and CLI tools.

🐍

Python

pip install cloudnexus

📦

Node.js

npm i @cloudnexus/sdk

🦀

Rust

cargo add cloudnexus

CLI

curl -sS | bash