DocsAPI ReferenceAPI Overview
API Reference 6 min read

API Overview

Introduction to the Cd hosting API for programmatic server management.

API Overview

The Cd hosting API allows you to programmatically manage your servers, plans, and account.

Authentication

All API requests require a Bearer token:

bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.cdhosting.com/v1/servers

Generate API keys from your dashboard under Account SettingsAPI Keys.

Base URL

https://api.cdhosting.com/v1

Rate Limits

PlanRequests/minRequests/day
Basic301,000
Pro6010,000
Enterprise12050,000
Ultimate300Unlimited

Common Endpoints

List Servers

bash
GET /v1/servers

# Response
{
  "servers": [
    {
      "id": "srv_abc123",
      "name": "production-web-01",
      "status": "running",
      "ip": "192.168.1.100",
      "plan": "pro",
      "location": "london",
      "created_at": "2025-01-15T10:30:00Z"
    }
  ]
}

Get Server Details

bash
GET /v1/servers/:id

# Response
{
  "id": "srv_abc123",
  "name": "production-web-01",
  "status": "running",
  "ip": "192.168.1.100",
  "plan": "pro",
  "specs": {
    "cpu_cores": 4,
    "ram_gb": 16,
    "storage_gb": 250,
    "storage_type": "nvme"
  },
  "location": {
    "city": "London",
    "country": "UK",
    "datacenter": "LON-01"
  },
  "network": {
    "bandwidth_tb": 10,
    "ipv4": "192.168.1.100",
    "ipv6": "2001:db8::1"
  }
}

Reboot Server

bash
POST /v1/servers/:id/reboot

# Response
{
  "status": "rebooting",
  "estimated_time": "30s"
}

Power Actions

bash
POST /v1/servers/:id/power
Content-Type: application/json

{
  "action": "shutdown" // or "start", "restart"
}

SDKs

Official SDKs are available for:

  • Node.js: npm install @cdhosting/sdk
  • Python: pip install cdhosting
  • Go: go get github.com/cdhosting/go-sdk
  • PHP: composer require cdhosting/sdk
Need help? Chat with us!