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
https://platform.serverscamp.com/api/v1
Request format
All requests should include:
Content-Type: application/jsonfor requests with bodyAuthorization: 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 -X GET "https://platform.serverscamp.com/api/v1/vms" \
-H "Authorization: Bearer sc_your_token_here"
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:
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing token |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn't exist |
422 | Validation Error - Check request body |
500 | Server Error - Contact support |
Error response
{"detail": "VM not found"}
Virtual machines
Create and manage virtual machine instances.
List VMs
curl -X GET "https://platform.serverscamp.com/api/v1/vms" \
-H "Authorization: Bearer $API_TOKEN"
Response
[
{
"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
| Parameter | Type | Description |
|---|---|---|
display_name | string | Optional. Human-readable name |
vm_class_id | integer | Required. VM class ID from GET /vm-classes (hardware generation, profile, vCPU, RAM) |
storage_class_id | integer | Required. Disk class ID from GET /storage-classes |
vm_template_id | integer | Required. OS template from GET /vm-templates |
network_uuid | string | Required. Network UUID to attach the VM to |
disk_gb | integer | Required. Root disk size in GB (bounds depend on the disk class) |
ssh_key_id | integer | Optional. SSH key for access |
assign_public_ips | boolean | Optional. Assign public IPv4/IPv6 |
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": 2,
"vm_template_id": 1,
"storage_class_id": 12,
"network_uuid": "8f14e45f-...-net",
"disk_gb": 25,
"ssh_key_id": 7,
"assign_public_ips": true
}'
Get VM details
Delete VM
Control VM power
Body: {"action": "start"}. Available actions: start, shutdown, destroy, reboot, reset
Networking
List networks
Create network
| Parameter | Type | Description |
|---|---|---|
display_name | string | Optional. Network name |
cidr | string | Required. IP range (e.g., 10.0.0.0/24) |
List routers
Create router
Attach network to router
Body: {"router_uuid": "..."}. Detach with DELETE /network/{network_uuid}/detach.
SSH keys
List SSH keys
Create SSH key
| Parameter | Type | Description |
|---|---|---|
name | string | Required. Key name |
public_key | string | Required. SSH public key content |