Droplet API

Droplet API

Request schemas and lifecycle endpoints for virtual machines.

The Droplet API creates, reads, updates, and removes virtual machines in a project. All endpoint paths are relative to the API base URL.

Create a droplet

POST/organizations/{organization_id}/projects/{project_id}/droplets
Scope
droplets:write
Auth
Bearer API key
Repeat calls
Reuse Idempotency-Key with the identical path and body for 24 hours.

Creates a droplet and starts provisioning. The caller must also have permission to use the referenced image, network, and storage policy.

Request body
namestringrequired
Display name. Leading and trailing whitespace is removed; an empty result is rejected.
rule1–128 characters
region_idstringrequired
Permitted region ID. Cannot change after creation.
image_idstringrequired
Ready image available in the region.
vcpusintegerrequired
Requested cores. Must match a size supported by the pool.
ruleAt least 1
memory_mibintegerrequired
Requested memory. Must match a supported size and satisfy the image minimum.
ruleAt least 512 MiB
root_volumeobjectrequired
Contains positive integer size_gib and storage_policy_id. Size must satisfy the image minimum.
interfacesarrayrequired
Each entry contains network_id and an optional available address in that network.
ruleAt least one interface
ssh_key_idsstring[]optional
Project public keys installed through supported guest initialization.
default[]
user_datastringoptional
UTF-8 guest initialization data, up to 65536 bytes.
defaultEmpty
labelsobjectoptional
String keys and string values used by resource selectors.
default{}
deletion_protectionbooleanoptional
Blocks delete requests while enabled.
defaultfalse
spotbooleanoptional
Requests preemptible capacity; no automatic standard-capacity fallback.
defaultfalse
startbooleanoptional
When false, provisions the disks and configuration without starting guest execution.
defaulttrue

Unknown fields and invalid references return 422. A quota or policy rejection before admission creates no droplet. Execution failures after admission are reported on the operation and can leave retained resources for inspection.

202Provisioning accepted

An accepted creation returns the droplet and its operation:

JSON
{
  "data": { "id": "drp_web01", "state": "provisioning" },
  "operation": { "id": "op_create01", "state": "queued" },
  "request_id": "req_deploy01"
}

The following request requires a ready image, private network, and replicated storage policy in the same region. The API token needs droplets:write and the corresponding project role.

To create the droplet with an inline JSON request, send:

Shell
curl --fail-with-body --request POST \
  --header "Authorization: Bearer ${INFRA_API_TOKEN}" \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: payments-web-01-create-v1' \
  --data '{
    "name": "web-01",
    "region_id": "reg_euwest",
    "image_id": "img_ubuntu",
    "vcpus": 2,
    "memory_mib": 4096,
    "root_volume": {"size_gib": 30, "storage_policy_id": "sp_replicated"},
    "interfaces": [{"network_id": "net_production"}],
    "labels": {"service": "web", "environment": "production"}
  }' \
  "${INFRA_API_URL}/organizations/org_main/projects/prj_payments/droplets"

Read and list

GET/organizations/{organization_id}/projects/{project_id}/droplets/{droplet_id}
Scope
droplets:read
Auth
Bearer API key

Returns the full resource with its ETag header. Requires droplets:read.

The resource separates requested configuration from observed execution:

Response fieldTypeMeaning
idStringImmutable droplet ID
revisionIntegerConfiguration revision used by the ETag
stateStringprovisioning, running, stopped, preempting, preempted, deleting, or error
healthObjectNamed health conditions and their observation time
placementObjectObserved region, zone, node, and CPU profile
interfacesArrayInterface IDs, networks, and assigned addresses
volume_attachmentsArrayRoot and data-volume attachment references
active_operation_idString or nullCurrent conflicting lifecycle operation

The desired size fields are distinct from observed hypervisor values while an update is pending. Guest initialization and application health are not implied by state=running.

GET/organizations/{organization_id}/projects/{project_id}/droplets
Scope
droplets:read
Auth
Bearer API key

Lists droplets in the permitted project scope.

List the collection with the same scope. Filters include region_id, state, and label in key=value form, plus standard pagination parameters.

Update configuration

PATCH/organizations/{organization_id}/projects/{project_id}/droplets/{droplet_id}
Scope
droplets:write
Auth
Bearer API key

Updates mutable droplet configuration.

Requires droplets:write and the current If-Match header. Writable fields are name, labels, and deletion_protection. Omitted fields remain unchanged. labels replaces the complete label map; an empty object removes all labels. null is rejected for these fields.

Region, image, CPU, memory, and attachments cannot be changed through this patch. Use the corresponding action or volume endpoint. A stale revision returns 412 without applying the patch.

Lifecycle actions

POST/organizations/{organization_id}/projects/{project_id}/droplets/{droplet_id}/actions
Scope
droplets:write
Auth
Bearer API key

Requests a droplet lifecycle action.

Requires droplets:write. Send an object containing type and the fields for that action. Actions return 202 and support idempotency keys.

Each action accepts the following fields and lifecycle conditions:

typeAdditional fieldsRequirement
startNoneDroplet stopped or preempted; eligible capacity required
shutdownOptional grace_period_seconds, default 120, integer 1–3600Running guest; timeout fails without forced power-off
restartNoneRunning guest
force_stopNoneRunning or unresponsive guest
resizeRequired vcpus, memory_mibStopped droplet and supported target size
migrateOptional destination_node_idEligible running droplet; omitted destination invokes scheduling
change_capacity_typeRequired boolean spotStopped or preempted guest; requested capacity type offered by the region

Invalid states or an active conflicting operation return 409. Unsupported sizes and destinations return 422. See Lifecycle and Live migration for execution and persistence rules.

Delete

DELETE/organizations/{organization_id}/projects/{project_id}/droplets/{droplet_id}
Scope
droplets:write
Auth
Bearer API key

Deletes a droplet and the selected root volume while retaining independent resources.

Requires droplets:write and If-Match. The optional delete_root_volume query parameter is boolean and defaults to true. Separately managed data volumes, reserved public addresses, and backups are retained.

Deletion protection returns 409 deletion_protected. Accepted deletion returns 202 with an operation reference. The resource can remain visible as deleting until cleanup completes. A later read returns 404 after removal.

Migration transfer options

The migrate action also accepts max_bandwidth_bytes_per_second, convergence_timeout_seconds, and max_pause_ms. Omitted bandwidth inherits the regional ceiling; a supplied value must be a positive integer. Convergence timeout defaults to 1800 seconds, inclusive range 60–86400. Pause budget defaults to 500 milliseconds, inclusive range 50–5000.

Unsupported values return 422 invalid_migration_policy. These options cannot make passthrough or scratch-backed guests eligible for live migration. A transfer that cannot converge fails before commit rather than silently forcing a stop. See migration controls for contention and cancellation.

Hardware policy, scratch devices, and NUMA requirements use the separate Hardware policy API. Console and rescue access use Guest Access API; public SSH-key registration uses SSH key API.