Instances
Create instance
Provisions a new instance.
x-api-key<token>
In: header
Query Parameters
regionstring
Region code where the resource exists (e.g., eu2).
Instance creation parameters.
namestring
Human-friendly name for the instance.
Length
1 <= length <= 255flavor_idstring
Flavor identifier from the /flavors endpoint defining CPU and RAM allocation.
image_idstring
Image identifier from the /images endpoint to boot from.
key_namearray<string>
Existing key pair names from the /keypairs endpoint to inject for SSH access.
Items
1 <= itemsvolume_sizeinteger
Root volume size in GB (minimum 8 GB).
Default
10Range
8 <= valuesg_namesarray<string>
Security groups to attach at boot. Available groups can be listed using the /security-groups endpoint.
Items
1 <= itemstags?array<string>
Key-value style tags applied to the instance.
assign_public_ip?boolean
Whether to assign a public IP to the instance. Defaults to true.
Default
trueResponse Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://cloud.huddleapis.com/api/v1/instances?region=eu2" \ -H "Content-Type: application/json" \ -d '{ "name": "live-streamer", "flavor_id": "c2-small", "image_id": "ubuntu-22-04-x64", "key_name": [ "prod-key" ], "volume_size": 20, "security_groups": [ "default", "allow-rtmp" ], "tags": [ "env:prod", "team:video" ] }'{
"id": "inst_12345",
"name": "video-node",
"vcpus": 2,
"ram": 4096,
"status": "BUILD",
"created_at": "2024-03-18T10:20:00Z",
"image": {
"id": "img-ubuntu-22-04",
"name": "Ubuntu 22.04 LTS"
},
"region": {
"name": "eu2"
}
}{
"message": "Bad request",
"error": {
"code": "BAD_REQUEST",
"message": "Invalid request body",
"type": "client"
},
"timestamp": "2024-03-18T10:22:00Z"
}{
"message": "Unauthorized",
"error": {
"code": "UNAUTHORIZED",
"message": "x-api-key header missing",
"type": "auth"
},
"timestamp": "2024-03-18T10:22:00Z"
}{
"message": "Resource conflict",
"error": {
"code": "CONFLICT",
"message": "Keypair with this name already exists",
"type": "conflict"
},
"timestamp": "2024-03-18T10:22:00Z"
}{
"message": "Internal server error",
"error": {
"code": "INTERNAL_ERROR",
"message": "Failed to create instance",
"type": "server"
},
"timestamp": "2024-03-18T10:22:00Z"
}