API reference

CloudNx exposes a REST API split across three services. Every route returns JSON and authenticates with the same RS256 JWT.

Base URLs

ServicePublic base URLConcerns
authhttps://cloudnx.in/auth/Users, sessions, billing, IAM, teams, audit logs
computehttps://cloudnx.in/compute/Instances, ASGs, EIPs, firewalls, snapshots, volumes, LBs, VPCs
storagehttps://cloudnx.in/storage/Bucket lifecycle, presigned URLs, per-bucket access keys

Authentication

There are two ways to authenticate, both produce the same JWT internally:

1. Session cookie (browser)

After POST /auth/login, the browser receives cnx_access (15 min) and cnx_refresh (30 days) HttpOnly cookies. These are used automatically by the dashboard and any same-origin client.

2. Access keys + SigV4 (programmatic)

For CLI / SDK / CI use:

  1. Create an IAM user via /iam.
  2. Issue an access key (you’ll see the secret once).
  3. Sign requests with AWS SigV4 (region in-mum, service cloudnx) — or use POST /auth/iam/exchange-credentials with the secret in the body to get a 15-minute JWT and use that as a Bearer token.

Easiest path: install the cloudnx CLI, run cloudnx configure, and let it handle signing.

Request / response shape

Requests with bodies use Content-Type: application/json. Responses are always JSON with one of these shapes:

// Success — varies per route
{ "id": "…", "status": "running", "…": "…" }

// List
{ "instances": [ … ], "next_cursor": "…" }

// Error (any 4xx / 5xx)
{ "error": "human-readable explanation" }

Status codes

CodeMeaning
200Read or update successful
201Resource created
400Validation error (see error field)
401Missing or invalid credentials
403Authenticated but not authorised (IAM policy denies)
404Resource not found, or owned by another account
409Conflict — e.g. unique constraint, already-running instance
410Gone — used for expired invites and pending tokens
429Rate limit; retry after the seconds in Retry-After
5xxBug — please report

Idempotency

Mutating routes accept an optional Idempotency-Key header. Resending the same request with the same key returns the original response without a side-effect. Keys live for 24 hours.

Rate limits

Per-user soft limit of 30 requests / second across all services. Programmatic clients should back off on 429; the response includes a Retry-After header in seconds.

SDKs

First-party CLI shipped (cloudnx CLI); language SDKs are on the roadmap. For now you can:

  • Use any HTTP client + the SigV4 specification.
  • Use the AWS SDK for S3 against https://s3.cloudnx.in for object storage — fully compatible.
  • Wrap the CLI in your scripts with --output json.