Skip to Content
APIComputeCreate Instance

Create instance

Create a new compute instance using existing cloud resources.


Endpoint

POST /v1/instances

Request body

{ "name": "web-production-01", "image_id": "IMAGE_ID_FROM_IMAGES", "flavor_id": "FLAVOR_ID_FROM_FLAVORS", "network_id": "NETWORK_ID_FROM_NETWORKS", "keypair_name": "KEYPAIR_NAME", "security_group_ids": ["SECURITY_GROUP_ID"], "security_group_names": ["default"], "volume": { "name": "additional-vol", "size": 10 }, "port": "3000", "dname": "my-instance-site", "user_data": "#cloud-config\npackages:\n - nginx", "imageName": "Ubuntu 24.04" }

Required fields

FieldTypeDescription
namestringInstance name
image_idstringImage ID used to boot the instance
flavor_idstringFlavor ID or name
network_idstringPrivate network ID
keypair_namestringSSH keypair name

Optional fields

FieldTypeDescription
security_group_idsstring[]Security group IDs. If omitted, the default security group is used
security_group_namesstring[]Security group names. If omitted, the default security group is used
volumeobjectCreates and attaches a volume (name, size in GB)
portstringApplication port. Defaults to "3000"
dnamestringCustom subdomain prefix without .redu.cloud
user_datastringCloud-init or shell script for first boot
imageNamestringOptional display name for UI

Field sources

FieldWhere to get it
image_idList Images
flavor_idFlavors
network_idList Networks
security_group_idsSecurity Groups
keypair_nameSSH Keypairs

Example

curl https://api.redu.cloud/v1/instances \ -X POST \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "test-instance-01", "image_id": "2f9aee80-2584-4a0c-84ea-23c8d1ae93c9", "flavor_id": "m1.small", "network_id": "02cb27f9-b120-43ac-8f5c-fd1540a67121", "security_group_ids": ["fb4da13a-be96-4649-8635-d464b8dfa6d3"], "keypair_name": "keynt", "port": "3000" }'

Successful response

{ "id": "e89e9424-3382-44b8-b75d-a3206f03f80d", "name": "web-production-01", "status": "building", "image_id": "ffe84dc7-2496-42fc-8837-1189069ed0fb", "flavor_id": "1", "network_id": "81db9cf8-6368-4063-9fa4-3ca8eb9ea1c9", "created_at": "2026-04-28T13:08:00Z" }

Notes

  • Instance creation is asynchronous
  • Instances start in the building state
  • If no security groups are provided, the default security group is used
  • If port is omitted, 3000 is used
  • If dname is omitted, it is generated automatically
  • Use List Instances to check status

Errors

400 Bad Request

{ "error": { "code": "bad_request", "message": "Missing required field: image_id" } }

401 Unauthorized

{ "error": { "code": "unauthorized", "message": "Invalid API key" } }

403 Forbidden

The API key does not have access to the requested resource.

Last updated on