Create a persistent volume
POST/volumes
Creates a durable block-device volume (formatted ext4 on first use). Returns 501 when volume storage is not enabled (set --volume-dir), 409 when the name already exists.
Request bodyapplication/json
CreateVolumeRequest
namestringsize_bytesintegerint64Responses
201 CreatedCreated
Volume
attached_tostringcreated_atstringdate-timehost_idstringnamestringsize_bytesintegerint64400 Bad requestBad Request
ErrorResponse
errorstring409 ConflictConflict
ErrorResponse
errorstring501 Not Implemented
ErrorResponse
errorstringAuthentication
bearerAuthHTTP bearer. Daemon API key. Omit on a keyless loopback daemon.Request
▍POST/volumes
curl '/volumes' \
-X POST \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch("/volumes", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: "{}",
});
const data = await response.json();import requests
response = requests.post(
"/volumes",
headers={
"Content-Type": "application/json",
},
data="{}",
)
data = response.json()Response
201 Created
{
"attached_to": "string",
"created_at": "2026-01-02T15:04:05Z",
"host_id": "string",
"name": "string",
"size_bytes": 0
}