Create a volume

Create a volume and attach it to a server. A new volume starts as creating and becomes attached. With auto_mount, the server mounts the volume once it's running.

POST https://{availability_zone}.betterstackcloud.com/v1/volumes
Authorization string required

Bearer $TOKEN

Content-Type string

application/json

name string required

The volume's name, unique among the organization's volumes. A deleted volume's name can be used again.

size_gb integer required

The volume's size in GiB, from 1 to 3072.

server_id string required

The ID of the server to attach the volume to. List your servers with betterstack server list. The server must be running or stopped. The volume belongs to the server's team and lives on its host. A server can have up to 10 volumes.

volume_type string default: nvme

The kind of storage. Possible values: nvme.

format string or null

The filesystem to create on the volume. The server must be running for it. Leave it out, or send null, for a volume without a filesystem. Possible values: ext4, xfs.

auto_mount boolean default: false

Whether the server mounts the volume automatically. Needs a format.

metadata object

Your own tags, as string keys and values, at most 10. Accepts any keys.

202 Accepted
{
  "id": "example",
  "name": "Example volume",
  "status": "creating",
  "volume_type": "nvme",
  "size_gb": 10,
  "server_id": "123456789",
  "format": "ext4",
  "auto_mount": false,
  "mount_path": "example",
  "device_path": "example",
  "failure_reason": "example",
  "lock": {
    "reason": "fraud",
    "details": "example",
    "locked_at": "2026-07-01T12:00:00.000Z"
  },
  "created_at": "2026-07-01T12:00:00.000Z",
  "updated_at": "2026-07-01T12:00:00.000Z",
  "team_id": "123456789",
  "metadata": {
    "example": "value"
  }
}

Returns the newly created volume.

id string

The volume's ID, a UUID.

name string

The volume's name.

status string

The volume's state. While a change to the volume is in progress, other changes to it are refused.
Valid values:
creating: We're creating the volume.
attaching: We're attaching the volume to a server.
attached: The volume is attached to a server.
detaching: We're detaching the volume.
available: The volume isn't attached to a server. A new volume that ends up available couldn't be attached, and failure_reason says why.
moving: We're copying the volume to the host of the server you're attaching it to.
resizing: We're growing the volume.
snapshotting: We're creating a snapshot of the volume.
deleting: We're deleting the volume.
failed: We couldn't create the volume. A failed volume stays in this state.
destroyed: The volume is deleted.

volume_type string

The kind of storage, always nvme. Possible values: nvme.

size_gb integer

The volume's size in GiB, from 1 to 3072.

server_id string or null

The ID of the server the volume is attached to, or null when the volume isn't attached.

format string or null

The filesystem we created on the volume, or null for a volume without a filesystem. Possible values: ext4, xfs.

auto_mount boolean

Whether the server mounts the volume automatically when it's attached.

mount_path string or null

Where the server mounts the volume, under /mnt, or null when the volume isn't mounted.

device_path string or null

The volume's device path on the server, under /dev/disk/by-id. Use the device path in /etc/fstab, since it doesn't change. Stays null while the volume isn't attached.

failure_reason string or null

Why the last change to the volume failed, such as an attach, detach or resize. The reason stays after the volume is back to available or attached.

lock object or null

Our lock on the volume, or null. A locked volume can't be changed. Every change is refused with the error code locked.

lock.reason string

Why we locked the volume. Possible values: fraud, non_payment, abuse, legal, security, maintenance, other.

lock.details string or null

More about the lock, or null.

lock.locked_at datetime

When we locked the volume. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

created_at datetime

When the volume was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

updated_at datetime

When the volume was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

team_id string

The ID of the team that owns the volume. A volume belongs to the team of the server you created it on.

metadata object

Your own tags, as string keys and values, at most 10.