Introduction

Welcome to the CloudNexus API. This RESTful API allows you to manage your cloud infrastructure programmatically. The base URL for all requests is https://api.cloudnexus.io/v1.

GET /health

Checks the status of the API service.

Response
{
  "status": "healthy",
  "version": "2.4.1",
  "uptime": 9999312,
  "region": "us-east-1"
}

Authentication

All API requests must include a valid API key in the Authorization header using the Bearer scheme.

🔑

API Key Management

Generate and rotate your keys from the CloudNexus Dashboard under Settings > API Keys. Keys are scoped to specific regions and permission sets.

POST /auth/token/refresh

Refreshes a short-lived OAuth2 access token.

Parameter Type Required Description
refresh_token string Required The refresh token obtained from the initial login.
client_id string Required Your application's client ID.

Create Instance

Provision a new virtual machine or container cluster. Supports custom images, SSH keys, and auto-scaling policies.

POST /instances New

Creates a new compute instance with the specified configuration.

Parameter Type Required Description
name string Required Human-readable name for the instance.
plan string Required Instance plan: starter, professional, enterprise.
region string Required Deployment region: us-east, eu-west, ap-south.
image_id string Optional OS Image ID. Defaults to Ubuntu 22.04 LTS.
ssh_keys array[string] Optional Array of SSH public keys to inject.
auto_scale object Optional Auto-scaling configuration policy.
cURL
Python
Node.js
Response
curl -X POST https://api.cloudnexus.io/v1/instances \ -H "Authorization: Bearer cn_live_sk_..." \ -H "Content-Type: application/json" \ -d '{ "name": "web-prod-primary", "plan": "professional", "region": "us-east", "ssh_keys": ["ssh-rsa AAAAB3..."], "auto_scale": { "min_instances": 2, "max_instances": 10, "cpu_threshold": 75 } }'
import requests response = requests.post( "https://api.cloudnexus.io/v1/instances", headers={ "Authorization": "Bearer cn_live_sk_...", "Content-Type": "application/json" }, json={ "name": "web-prod-primary", "plan": "professional", "region": "us-east", "auto_scale": {"min_instances": 2, "max_instances": 10} } ) print(response.json())
const axios = require('axios'); axios.post('https://api.cloudnexus.io/v1/instances', { name: 'web-prod-primary', plan: 'professional', region: 'us-east', auto_scale: { min_instances: 2, max_instances: 10 } }, { headers: { Authorization: 'Bearer cn_live_sk_...', 'Content-Type': 'application/json' } }) .then(res => console.log(res.data));
{ "id": "inst_8x92a1b3", "name": "web-prod-primary", "status": "provisioning", "plan": "professional", "region": "us-east", "ip": "10.4.2.15", "created_at": "2025-05-20T14:32:00Z", "links": { "self": "/instances/inst_8x92a1b3", "logs": "/instances/inst_8x92a1b3/logs" } }

List Buckets

Retrieve all object storage buckets associated with your account.

GET /storage/buckets

Returns a paginated list of storage buckets.

Response
{ "items": [ { "id": "bkt_1a2b3c", "name": "media-assets", "region": "us-east", "size_bytes": 4589231456, "object_count": 12450, "created_at": "2025-01-15T09:00:00Z" }, { "id": "bkt_4d5e6f", "name": "db-backups", "region": "eu-west", "size_bytes": 89012345678, "object_count": 365, "created_at": "2024-12-01T00:00:00Z" } ], "pagination": { "next_page": "/storage/buckets?cursor=eyJpZCI6ImJrdF80ZDVlNmYifQ==", "total_count": 24 } }

CDN Configuration

Manage your global content delivery network settings, cache rules, and edge locations.

PUT /cdn/config

Updates the global CDN configuration. Changes propagate to edge nodes within 60 seconds.

Parameter Type Required Description
cache_ttl integer Required Cache Time-To-Live in seconds. Max 31536000 (1 year).
ssl_enabled boolean Optional Enable automatic SSL/TLS termination. Defaults to true.
compression string Optional Compression strategy: brotli, gzip, none.