API Reference

REST API for programmatic access to ServersCamp infrastructure. Manage VMs, storage, networks, and more.

Overview

The ServersCamp API is a RESTful API that allows you to manage your cloud infrastructure programmatically.

Base URL

URL
https://platform.serverscamp.com/api/v1

Request Format

All requests should include:

  • Content-Type: application/json for requests with body
  • Authorization: Bearer <token> header

Response Format

All responses are JSON. Successful responses return the requested data directly. Errors return an object with detail field.

Authentication

All API requests require authentication using an API token. Tokens are prefixed with sc_.

Getting an API Token

Generate API tokens in the Platform Settings.

Using Your Token

Include the token in the Authorization header:

cURL
curl -X GET "https://platform.serverscamp.com/api/v1/vms" \
  -H "Authorization: Bearer sc_your_token_here"
Python
import requests

API_TOKEN = "sc_your_token_here"
BASE_URL = "https://platform.serverscamp.com/api/v1"

headers = {"Authorization": f"Bearer {API_TOKEN}"}
response = requests.get(f"{BASE_URL}/vms", headers=headers)
vms = response.json()

Error Handling

The API uses standard HTTP status codes:

CodeMeaning
200Success
201Created
400Bad Request — Invalid parameters
401Unauthorized — Invalid or missing token
403Forbidden — Insufficient permissions
404Not Found — Resource doesn't exist
422Validation Error — Check request body
500Server Error — Contact support

Error Response

JSON
{"detail": "VM not found"}

Virtual Machines

Create and manage virtual machine instances.

List VMs

GET /vms
cURL
curl -X GET "https://platform.serverscamp.com/api/v1/vms" \
  -H "Authorization: Bearer $API_TOKEN"

Response

JSON
[
  {
    "uuid": "06837545-c878-443b-a114-ddab3b8c6e90",
    "display_name": "web-server-01",
    "state": "running",
    "vm_class": {"name": "burst-xs", "cpu_cores": 1, "ram_mb": 1024},
    "disk_gb": 20,
    "internal_ip": "172.31.106.70",
    "public_ipv4": "194.110.174.102"
  }
]

Create VM

POST /vms
ParameterTypeDescription
display_namestringOptional. Human-readable name
vm_class_idstringRequired. VM class (CPU/RAM config)
vm_template_idstringRequired. OS template ID
storage_class_idstringRequired. Storage performance tier
network_class_idstringRequired. Network speed tier
network_uuidstringRequired. VPC network UUID
disk_gbintegerRequired. Disk size in GB
ssh_key_idstringOptional. SSH key for access
assign_public_ipsbooleanOptional. Assign public IPv4/IPv6
cURL
curl -X POST "https://platform.serverscamp.com/api/v1/vms" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "display_name": "web-server",
    "vm_class_id": "burst-xs",
    "vm_template_id": "ubuntu-25.04",
    "storage_class_id": "standard-storage",
    "network_class_id": "baseline-network",
    "network_uuid": "net-abc123",
    "disk_gb": 20,
    "ssh_key_id": "key-xyz789",
    "assign_public_ips": true
  }'

Get VM Details

GET /vms/{vm_uuid}

Delete VM

DELETE /vms/{vm_uuid}

VM Actions

POST /vms/{vm_uuid}/actions/{action}

Available actions: start, stop, reboot, reset

VPCs & Networking

List Networks

GET /networks

Create Network

POST /networks
ParameterTypeDescription
display_namestringOptional. Network name
cidrstringRequired. IP range (e.g., 10.0.0.0/24)

List Routers

GET /routers

Create Router

POST /routers

Attach Network to Router

POST /routers/{router_uuid}/networks/{network_uuid}

Databases

List Databases

GET /databases

Create Database

POST /databases
ParameterTypeDescription
display_namestringOptional. Database name
enginestringRequired. postgresql, mysql, or redis
versionstringOptional. Engine version
sizestringRequired. Instance size

Storage

List Buckets

GET /buckets

Create Bucket

POST /buckets
ParameterTypeDescription
namestringRequired. Globally unique bucket name

Get Bucket Credentials

GET /buckets/{bucket_name}/credentials

Response

JSON
{
  "endpoint": "s3.serverscamp.net",
  "access_key_id": "AKIAIOSFODNN7EXAMPLE",
  "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}

SSH Keys

List SSH Keys

GET /ssh-keys

Create SSH Key

POST /ssh-keys
ParameterTypeDescription
namestringRequired. Key name
public_keystringRequired. SSH public key content

Delete SSH Key

DELETE /ssh-keys/{key_id}

Resource Classes

List VM Classes

GET /vm-classes

List Storage Classes

GET /storage-classes

List Network Classes

GET /network-classes

List OS Templates

GET /vm-templates