curl --request POST \
--url https://compute.{region}.basaltic.sh/v1/instances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "web-01",
"flavor": "550e8400-e29b-41d4-a716-446655440000",
"networks": [
{
"subnet": "9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60",
"mac": "02:1a:2b:3c:4d:5e",
"security_groups": [
"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
],
"floating_ip_assignment": "none",
"addresses": [
{
"address": "<string>"
}
]
}
],
"description": "Primary web server",
"architecture": "amd64",
"image": "debian-13",
"volumes": [
{
"volume": "crn:storage:sa-saopaulo-1:my-account:volume/data",
"delete_on_termination": false,
"boot": false,
"size_gb": 20,
"performance": {
"iops": 6000,
"throughput_mib_s": 250
},
"mount_path": "/data",
"fstype": "ext4",
"snapshot_schedules": [
{
"name": "<string>",
"interval_minutes": 1440,
"retention_count": 7,
"description": "<string>",
"retention_days": 30,
"enabled": true,
"tags": {
"environment": "production",
"team": "backend"
}
}
]
}
],
"metadata": {
"environment": "production",
"team": "backend"
},
"tags": {
"environment": "production",
"team": "backend"
},
"user_data": "I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==",
"iam_role": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
'import requests
url = "https://compute.{region}.basaltic.sh/v1/instances"
payload = {
"name": "web-01",
"flavor": "550e8400-e29b-41d4-a716-446655440000",
"networks": [
{
"subnet": "9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60",
"mac": "02:1a:2b:3c:4d:5e",
"security_groups": ["c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"],
"floating_ip_assignment": "none",
"addresses": [{ "address": "<string>" }]
}
],
"description": "Primary web server",
"architecture": "amd64",
"image": "debian-13",
"volumes": [
{
"volume": "crn:storage:sa-saopaulo-1:my-account:volume/data",
"delete_on_termination": False,
"boot": False,
"size_gb": 20,
"performance": {
"iops": 6000,
"throughput_mib_s": 250
},
"mount_path": "/data",
"fstype": "ext4",
"snapshot_schedules": [
{
"name": "<string>",
"interval_minutes": 1440,
"retention_count": 7,
"description": "<string>",
"retention_days": 30,
"enabled": True,
"tags": {
"environment": "production",
"team": "backend"
}
}
]
}
],
"metadata": {
"environment": "production",
"team": "backend"
},
"tags": {
"environment": "production",
"team": "backend"
},
"user_data": "I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==",
"iam_role": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'web-01',
flavor: '550e8400-e29b-41d4-a716-446655440000',
networks: [
{
subnet: '9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60',
mac: '02:1a:2b:3c:4d:5e',
security_groups: ['c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f'],
floating_ip_assignment: 'none',
addresses: [{address: '<string>'}]
}
],
description: 'Primary web server',
architecture: 'amd64',
image: 'debian-13',
volumes: [
{
volume: 'crn:storage:sa-saopaulo-1:my-account:volume/data',
delete_on_termination: false,
boot: false,
size_gb: 20,
performance: {iops: 6000, throughput_mib_s: 250},
mount_path: '/data',
fstype: 'ext4',
snapshot_schedules: [
{
name: '<string>',
interval_minutes: 1440,
retention_count: 7,
description: '<string>',
retention_days: 30,
enabled: true,
tags: {environment: 'production', team: 'backend'}
}
]
}
],
metadata: {environment: 'production', team: 'backend'},
tags: {environment: 'production', team: 'backend'},
user_data: 'I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==',
iam_role: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
})
};
fetch('https://compute.{region}.basaltic.sh/v1/instances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://compute.{region}.basaltic.sh/v1/instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'web-01',
'flavor' => '550e8400-e29b-41d4-a716-446655440000',
'networks' => [
[
'subnet' => '9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60',
'mac' => '02:1a:2b:3c:4d:5e',
'security_groups' => [
'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f'
],
'floating_ip_assignment' => 'none',
'addresses' => [
[
'address' => '<string>'
]
]
]
],
'description' => 'Primary web server',
'architecture' => 'amd64',
'image' => 'debian-13',
'volumes' => [
[
'volume' => 'crn:storage:sa-saopaulo-1:my-account:volume/data',
'delete_on_termination' => false,
'boot' => false,
'size_gb' => 20,
'performance' => [
'iops' => 6000,
'throughput_mib_s' => 250
],
'mount_path' => '/data',
'fstype' => 'ext4',
'snapshot_schedules' => [
[
'name' => '<string>',
'interval_minutes' => 1440,
'retention_count' => 7,
'description' => '<string>',
'retention_days' => 30,
'enabled' => true,
'tags' => [
'environment' => 'production',
'team' => 'backend'
]
]
]
]
],
'metadata' => [
'environment' => 'production',
'team' => 'backend'
],
'tags' => [
'environment' => 'production',
'team' => 'backend'
],
'user_data' => 'I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==',
'iam_role' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://compute.{region}.basaltic.sh/v1/instances"
payload := strings.NewReader("{\n \"name\": \"web-01\",\n \"flavor\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"networks\": [\n {\n \"subnet\": \"9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60\",\n \"mac\": \"02:1a:2b:3c:4d:5e\",\n \"security_groups\": [\n \"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"floating_ip_assignment\": \"none\",\n \"addresses\": [\n {\n \"address\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"Primary web server\",\n \"architecture\": \"amd64\",\n \"image\": \"debian-13\",\n \"volumes\": [\n {\n \"volume\": \"crn:storage:sa-saopaulo-1:my-account:volume/data\",\n \"delete_on_termination\": false,\n \"boot\": false,\n \"size_gb\": 20,\n \"performance\": {\n \"iops\": 6000,\n \"throughput_mib_s\": 250\n },\n \"mount_path\": \"/data\",\n \"fstype\": \"ext4\",\n \"snapshot_schedules\": [\n {\n \"name\": \"<string>\",\n \"interval_minutes\": 1440,\n \"retention_count\": 7,\n \"description\": \"<string>\",\n \"retention_days\": 30,\n \"enabled\": true,\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"user_data\": \"I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==\",\n \"iam_role\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://compute.{region}.basaltic.sh/v1/instances")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"web-01\",\n \"flavor\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"networks\": [\n {\n \"subnet\": \"9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60\",\n \"mac\": \"02:1a:2b:3c:4d:5e\",\n \"security_groups\": [\n \"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"floating_ip_assignment\": \"none\",\n \"addresses\": [\n {\n \"address\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"Primary web server\",\n \"architecture\": \"amd64\",\n \"image\": \"debian-13\",\n \"volumes\": [\n {\n \"volume\": \"crn:storage:sa-saopaulo-1:my-account:volume/data\",\n \"delete_on_termination\": false,\n \"boot\": false,\n \"size_gb\": 20,\n \"performance\": {\n \"iops\": 6000,\n \"throughput_mib_s\": 250\n },\n \"mount_path\": \"/data\",\n \"fstype\": \"ext4\",\n \"snapshot_schedules\": [\n {\n \"name\": \"<string>\",\n \"interval_minutes\": 1440,\n \"retention_count\": 7,\n \"description\": \"<string>\",\n \"retention_days\": 30,\n \"enabled\": true,\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"user_data\": \"I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==\",\n \"iam_role\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.{region}.basaltic.sh/v1/instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"web-01\",\n \"flavor\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"networks\": [\n {\n \"subnet\": \"9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60\",\n \"mac\": \"02:1a:2b:3c:4d:5e\",\n \"security_groups\": [\n \"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"floating_ip_assignment\": \"none\",\n \"addresses\": [\n {\n \"address\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"Primary web server\",\n \"architecture\": \"amd64\",\n \"image\": \"debian-13\",\n \"volumes\": [\n {\n \"volume\": \"crn:storage:sa-saopaulo-1:my-account:volume/data\",\n \"delete_on_termination\": false,\n \"boot\": false,\n \"size_gb\": 20,\n \"performance\": {\n \"iops\": 6000,\n \"throughput_mib_s\": 250\n },\n \"mount_path\": \"/data\",\n \"fstype\": \"ext4\",\n \"snapshot_schedules\": [\n {\n \"name\": \"<string>\",\n \"interval_minutes\": 1440,\n \"retention_count\": 7,\n \"description\": \"<string>\",\n \"retention_days\": 30,\n \"enabled\": true,\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"user_data\": \"I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==\",\n \"iam_role\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}"
response = http.request(request)
puts response.read_body{
"instance": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"crn": "crn:compute:sa-saopaulo-1:my-account:instance/web-01",
"name": "web-server-01",
"flavor": {
"id": "550e8400-e29b-41d4-a716-446655440003",
"crn": "crn:compute:sa-saopaulo-1:platform:flavor/s1.small",
"name": "s1.small"
},
"image": {
"id": "550e8400-e29b-41d4-a716-446655440004",
"crn": "crn:compute:sa-saopaulo-1:platform:image/ubuntu/architecture/amd64/version/24.04",
"name": "ubuntu"
},
"iam_role": {
"id": "550e8400-e29b-41d4-a716-446655440005",
"crn": "crn:iam:::role/550e8400-e29b-41d4-a716-446655440005",
"name": "instance-role"
},
"faults": [
{
"code": "BACKUP_FAILED",
"severity": "error",
"message": "Backup upload failed.",
"details": {},
"first_at": "2023-11-07T05:31:56Z",
"last_at": "2023-11-07T05:31:56Z",
"occurrences": 1
}
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"desired_state": "running",
"current_state": "running",
"description": "Primary web server",
"task_state": null,
"user_data": "<string>",
"metadata": {
"environment": "production",
"team": "backend"
},
"tags": {
"environment": "production",
"team": "backend"
},
"launched_at": "2026-01-15T09:31:12Z",
"terminated_at": null
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "ACCESS_DENIED",
"message": "You don't have permission to perform this action",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "CONFLICT",
"message": "Resource with this name already exists",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "IDEMPOTENCY_KEY_REUSED",
"message": "This Idempotency-Key was already used with a different request payload",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Create instance
Create a new compute instance
curl --request POST \
--url https://compute.{region}.basaltic.sh/v1/instances \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "web-01",
"flavor": "550e8400-e29b-41d4-a716-446655440000",
"networks": [
{
"subnet": "9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60",
"mac": "02:1a:2b:3c:4d:5e",
"security_groups": [
"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"
],
"floating_ip_assignment": "none",
"addresses": [
{
"address": "<string>"
}
]
}
],
"description": "Primary web server",
"architecture": "amd64",
"image": "debian-13",
"volumes": [
{
"volume": "crn:storage:sa-saopaulo-1:my-account:volume/data",
"delete_on_termination": false,
"boot": false,
"size_gb": 20,
"performance": {
"iops": 6000,
"throughput_mib_s": 250
},
"mount_path": "/data",
"fstype": "ext4",
"snapshot_schedules": [
{
"name": "<string>",
"interval_minutes": 1440,
"retention_count": 7,
"description": "<string>",
"retention_days": 30,
"enabled": true,
"tags": {
"environment": "production",
"team": "backend"
}
}
]
}
],
"metadata": {
"environment": "production",
"team": "backend"
},
"tags": {
"environment": "production",
"team": "backend"
},
"user_data": "I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==",
"iam_role": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
'import requests
url = "https://compute.{region}.basaltic.sh/v1/instances"
payload = {
"name": "web-01",
"flavor": "550e8400-e29b-41d4-a716-446655440000",
"networks": [
{
"subnet": "9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60",
"mac": "02:1a:2b:3c:4d:5e",
"security_groups": ["c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f"],
"floating_ip_assignment": "none",
"addresses": [{ "address": "<string>" }]
}
],
"description": "Primary web server",
"architecture": "amd64",
"image": "debian-13",
"volumes": [
{
"volume": "crn:storage:sa-saopaulo-1:my-account:volume/data",
"delete_on_termination": False,
"boot": False,
"size_gb": 20,
"performance": {
"iops": 6000,
"throughput_mib_s": 250
},
"mount_path": "/data",
"fstype": "ext4",
"snapshot_schedules": [
{
"name": "<string>",
"interval_minutes": 1440,
"retention_count": 7,
"description": "<string>",
"retention_days": 30,
"enabled": True,
"tags": {
"environment": "production",
"team": "backend"
}
}
]
}
],
"metadata": {
"environment": "production",
"team": "backend"
},
"tags": {
"environment": "production",
"team": "backend"
},
"user_data": "I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==",
"iam_role": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'web-01',
flavor: '550e8400-e29b-41d4-a716-446655440000',
networks: [
{
subnet: '9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60',
mac: '02:1a:2b:3c:4d:5e',
security_groups: ['c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f'],
floating_ip_assignment: 'none',
addresses: [{address: '<string>'}]
}
],
description: 'Primary web server',
architecture: 'amd64',
image: 'debian-13',
volumes: [
{
volume: 'crn:storage:sa-saopaulo-1:my-account:volume/data',
delete_on_termination: false,
boot: false,
size_gb: 20,
performance: {iops: 6000, throughput_mib_s: 250},
mount_path: '/data',
fstype: 'ext4',
snapshot_schedules: [
{
name: '<string>',
interval_minutes: 1440,
retention_count: 7,
description: '<string>',
retention_days: 30,
enabled: true,
tags: {environment: 'production', team: 'backend'}
}
]
}
],
metadata: {environment: 'production', team: 'backend'},
tags: {environment: 'production', team: 'backend'},
user_data: 'I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==',
iam_role: 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
})
};
fetch('https://compute.{region}.basaltic.sh/v1/instances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://compute.{region}.basaltic.sh/v1/instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'web-01',
'flavor' => '550e8400-e29b-41d4-a716-446655440000',
'networks' => [
[
'subnet' => '9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60',
'mac' => '02:1a:2b:3c:4d:5e',
'security_groups' => [
'c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f'
],
'floating_ip_assignment' => 'none',
'addresses' => [
[
'address' => '<string>'
]
]
]
],
'description' => 'Primary web server',
'architecture' => 'amd64',
'image' => 'debian-13',
'volumes' => [
[
'volume' => 'crn:storage:sa-saopaulo-1:my-account:volume/data',
'delete_on_termination' => false,
'boot' => false,
'size_gb' => 20,
'performance' => [
'iops' => 6000,
'throughput_mib_s' => 250
],
'mount_path' => '/data',
'fstype' => 'ext4',
'snapshot_schedules' => [
[
'name' => '<string>',
'interval_minutes' => 1440,
'retention_count' => 7,
'description' => '<string>',
'retention_days' => 30,
'enabled' => true,
'tags' => [
'environment' => 'production',
'team' => 'backend'
]
]
]
]
],
'metadata' => [
'environment' => 'production',
'team' => 'backend'
],
'tags' => [
'environment' => 'production',
'team' => 'backend'
],
'user_data' => 'I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==',
'iam_role' => 'f47ac10b-58cc-4372-a567-0e02b2c3d479'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://compute.{region}.basaltic.sh/v1/instances"
payload := strings.NewReader("{\n \"name\": \"web-01\",\n \"flavor\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"networks\": [\n {\n \"subnet\": \"9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60\",\n \"mac\": \"02:1a:2b:3c:4d:5e\",\n \"security_groups\": [\n \"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"floating_ip_assignment\": \"none\",\n \"addresses\": [\n {\n \"address\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"Primary web server\",\n \"architecture\": \"amd64\",\n \"image\": \"debian-13\",\n \"volumes\": [\n {\n \"volume\": \"crn:storage:sa-saopaulo-1:my-account:volume/data\",\n \"delete_on_termination\": false,\n \"boot\": false,\n \"size_gb\": 20,\n \"performance\": {\n \"iops\": 6000,\n \"throughput_mib_s\": 250\n },\n \"mount_path\": \"/data\",\n \"fstype\": \"ext4\",\n \"snapshot_schedules\": [\n {\n \"name\": \"<string>\",\n \"interval_minutes\": 1440,\n \"retention_count\": 7,\n \"description\": \"<string>\",\n \"retention_days\": 30,\n \"enabled\": true,\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"user_data\": \"I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==\",\n \"iam_role\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://compute.{region}.basaltic.sh/v1/instances")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"web-01\",\n \"flavor\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"networks\": [\n {\n \"subnet\": \"9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60\",\n \"mac\": \"02:1a:2b:3c:4d:5e\",\n \"security_groups\": [\n \"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"floating_ip_assignment\": \"none\",\n \"addresses\": [\n {\n \"address\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"Primary web server\",\n \"architecture\": \"amd64\",\n \"image\": \"debian-13\",\n \"volumes\": [\n {\n \"volume\": \"crn:storage:sa-saopaulo-1:my-account:volume/data\",\n \"delete_on_termination\": false,\n \"boot\": false,\n \"size_gb\": 20,\n \"performance\": {\n \"iops\": 6000,\n \"throughput_mib_s\": 250\n },\n \"mount_path\": \"/data\",\n \"fstype\": \"ext4\",\n \"snapshot_schedules\": [\n {\n \"name\": \"<string>\",\n \"interval_minutes\": 1440,\n \"retention_count\": 7,\n \"description\": \"<string>\",\n \"retention_days\": 30,\n \"enabled\": true,\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"user_data\": \"I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==\",\n \"iam_role\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://compute.{region}.basaltic.sh/v1/instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"web-01\",\n \"flavor\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"networks\": [\n {\n \"subnet\": \"9b2e4f1a-3c5d-4e6f-8a90-1b2c3d4e5f60\",\n \"mac\": \"02:1a:2b:3c:4d:5e\",\n \"security_groups\": [\n \"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f\"\n ],\n \"floating_ip_assignment\": \"none\",\n \"addresses\": [\n {\n \"address\": \"<string>\"\n }\n ]\n }\n ],\n \"description\": \"Primary web server\",\n \"architecture\": \"amd64\",\n \"image\": \"debian-13\",\n \"volumes\": [\n {\n \"volume\": \"crn:storage:sa-saopaulo-1:my-account:volume/data\",\n \"delete_on_termination\": false,\n \"boot\": false,\n \"size_gb\": 20,\n \"performance\": {\n \"iops\": 6000,\n \"throughput_mib_s\": 250\n },\n \"mount_path\": \"/data\",\n \"fstype\": \"ext4\",\n \"snapshot_schedules\": [\n {\n \"name\": \"<string>\",\n \"interval_minutes\": 1440,\n \"retention_count\": 7,\n \"description\": \"<string>\",\n \"retention_days\": 30,\n \"enabled\": true,\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n }\n }\n ]\n }\n ],\n \"metadata\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"tags\": {\n \"environment\": \"production\",\n \"team\": \"backend\"\n },\n \"user_data\": \"I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg==\",\n \"iam_role\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n}"
response = http.request(request)
puts response.read_body{
"instance": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"crn": "crn:compute:sa-saopaulo-1:my-account:instance/web-01",
"name": "web-server-01",
"flavor": {
"id": "550e8400-e29b-41d4-a716-446655440003",
"crn": "crn:compute:sa-saopaulo-1:platform:flavor/s1.small",
"name": "s1.small"
},
"image": {
"id": "550e8400-e29b-41d4-a716-446655440004",
"crn": "crn:compute:sa-saopaulo-1:platform:image/ubuntu/architecture/amd64/version/24.04",
"name": "ubuntu"
},
"iam_role": {
"id": "550e8400-e29b-41d4-a716-446655440005",
"crn": "crn:iam:::role/550e8400-e29b-41d4-a716-446655440005",
"name": "instance-role"
},
"faults": [
{
"code": "BACKUP_FAILED",
"severity": "error",
"message": "Backup upload failed.",
"details": {},
"first_at": "2023-11-07T05:31:56Z",
"last_at": "2023-11-07T05:31:56Z",
"occurrences": 1
}
],
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"desired_state": "running",
"current_state": "running",
"description": "Primary web server",
"task_state": null,
"user_data": "<string>",
"metadata": {
"environment": "production",
"team": "backend"
},
"tags": {
"environment": "production",
"team": "backend"
},
"launched_at": "2026-01-15T09:31:12Z",
"terminated_at": null
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "ACCESS_DENIED",
"message": "You don't have permission to perform this action",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "CONFLICT",
"message": "Resource with this name already exists",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "IDEMPOTENCY_KEY_REUSED",
"message": "This Idempotency-Key was already used with a different request payload",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}compute:CreateInstance. See COMPUTE permissions for the full list, what each one covers, and an example policy.Authorizations
An OAuth 2.0 bearer token, sent as Authorization: Bearer <token>.
This is the recommended way to authenticate.
Get one by exchanging a service account's access key pair at
POST /v1/oauth/token with grant_type=client_credentials. It is the
standard client-credentials grant, so any OAuth-aware library will
obtain and refresh it for you.
curl -s -u "$KEY_ID:$SECRET" -d grant_type=client_credentials \ https://iam.basaltic.sh/v1/oauth/token
Tokens last an hour by default. The same access key pair is separately your AWS SigV4 credential for the S3-compatible object endpoint, which speaks nothing else.
Headers
Optional client-generated key that makes a create replay-safe. Retrying a request with the same key returns the original outcome verbatim instead of creating a duplicate resource. Reusing a key with a different request body is rejected (422); a request whose key is still being processed returns 409. Records are honored for 24 hours. Use a UUID or similarly unique token.
255Body
Resource names must not start with the literal crn: prefix or be UUIDs (canonical, compact, braced, or urn:uuid: forms, in either case).
1 - 255"web-01"
Regional flavor reference (UUID, CRN or exact name)
"550e8400-e29b-41d4-a716-446655440000"
Interfaces to attach, at least one. index 0 is the primary NIC.
Required because an instance with no interface boots with no network at all, and nothing inside it can add one afterwards.
1Show child attributes
Show child attributes
1000"Primary web server"
Architecture for image names and name:version tags (default amd64); a CRN pins its own architecture and version.
Image to clone the boot disk from. Required unless volumes contains an
existing boot volume; cannot be combined with an existing boot volume. Four forms are accepted: a complete image/name/architecture/arch/version/version CRN; an image id; name:version,
which pins one build and is how you opt out of the tag moving
under you; or a bare name, which follows the tag to whichever
build is current when the instance is created. Names prefer a usable caller-owned
build over a tagged platform catalog build for the requested architecture (default amd64).
A CRN pins owner, name, architecture and version. Resolution never retries another
reference kind; responses and stored templates retain the resolved image UUID.
"debian-13"
New or existing disks bound with the instance, the boot disk included —
mark it with boot: true. At most one entry may.
Omit the boot entry to take the image's minimum size and the region's default tier.
Create a new disk, optionally with provisioned performance, or attach an
existing available volume in this account and region using volume.
Existing volumes keep their contents, performance, and snapshot schedules;
they are retained after failed launch or instance deletion. Requires
compute:AttachVolume for existing disks. A volume may only occur once.
An existing boot disk must be bootable and replaces the top-level image.
- Option 1
- Option 2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
{ "environment": "production", "team": "backend" }
Show child attributes
Show child attributes
{ "environment": "production", "team": "backend" }
Base64-encoded user data (cloud-init)
"I2Nsb3VkLWNvbmZpZwpwYWNrYWdlczoKICAtIG5naW54Cg=="
Attach an IAM role from the same account by UUID, CRN or exact name. The role's trust
policy must permit crn:compute:*:*:instance/* (or the
specific instance CRN). The instance's IMDS endpoint
(169.254.169.254) mints short-lived STS credentials for
this role from inside the VM.
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
Response
Instance creation initiated
Show child attributes
Show child attributes

