Skip to content

Delete a snapshot

DELETE/v1/snapshots/{snapshot_uid}

Deletes a snapshot by UID. Unlike Delete a VM snapshot, this works for detached snapshots whose source VM has been deleted. The snapshot shows deleting until the operation finishes.

This is asynchronous. It returns 202 Accepted with an operation_id. See Get an operation. Send an X-Idempotency key to make retries safe: a retry with the same key for the same snapshot returns the original operation with 200, even after the snapshot is gone. On that replay vm_uid is empty.

Authentication

Send your API key as Authorization: Bearer <token>. The request is scoped to the workspace in X-Workspace-Slug.

Path parameters

snapshot_uidstringRequired

The snapshot's uid.

Headers

X-Workspace-SlugstringRequired

Slug of the workspace the request acts on. You can also pass it as the workspace_slug query parameter.

X-Idempotencystring

Optional unique key for this request, such as a UUID. Leading and trailing spaces are ignored. If you send a key you already used for the same snapshot action, the original operation is returned with 200 OK and X-Idempotency-Replay: true, and nothing new is queued. Reusing a key for a different action or snapshot returns 409 with action: idempotency_key_reused. Keys are shared across the workspace. Without a key, every request is treated as new.

Response

202

The delete operation was queued. Here name is the snapshot's name and vm_uid is the source VM's UID.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
operation_idstringRequired

UID of the queued operation. Poll it with Get an operation. The snapshot is the operation's resource_uid.

vm_uidstringRequired

UID of the VM from the request path. For Delete a snapshot, the snapshot's source VM, or empty on a replay.

namestringRequired

Name of the VM for VM-scoped requests (empty on a replay if the VM is gone). Name of the snapshot for Delete a snapshot.

actionstringRequired

The action that was queued.

One ofvm_snapshot.createvm_snapshot.restorevm_snapshot.delete

statusstringRequired

Status of the operation.

One ofqueuedrunningsucceededfailed

events_urlstringRequired

Path of the server-sent events stream with the operation's progress.

is_replaybooleanRequired

true when an existing operation was returned for a reused X-Idempotency key.

is_completedbooleanRequired

true when a returned existing operation has already finished.

Response

200

Replay. The X-Idempotency key was already used for this snapshot action, so the existing operation is returned and nothing is queued. vm_uid is the VM from the request path and name is that VM's current name (empty if it is gone). For Delete a snapshot, vm_uid is empty and name is the snapshot's name.

successbooleanRequired

true when the request succeeded.

messagestringRequired

Human-readable status message.

dataobject
Show attributes
operation_idstringRequired

UID of the queued operation. Poll it with Get an operation. The snapshot is the operation's resource_uid.

vm_uidstringRequired

UID of the VM from the request path. For Delete a snapshot, the snapshot's source VM, or empty on a replay.

namestringRequired

Name of the VM for VM-scoped requests (empty on a replay if the VM is gone). Name of the snapshot for Delete a snapshot.

actionstringRequired

The action that was queued.

One ofvm_snapshot.createvm_snapshot.restorevm_snapshot.delete

statusstringRequired

Status of the operation.

One ofqueuedrunningsucceededfailed

events_urlstringRequired

Path of the server-sent events stream with the operation's progress.

is_replaybooleanRequired

true when an existing operation was returned for a reused X-Idempotency key.

is_completedbooleanRequired

true when a returned existing operation has already finished.

Errors

StatusMeaning
400The request was malformed or failed validation.
401The API key is missing, invalid, expired or revoked.
403You cannot access the workspace, your role does not allow this action, or the account is suspended.
404The resource does not exist or you cannot access it.
409The snapshot is already being deleted (snapshot is already being deleted), or the X-Idempotency key was used for a different operation (action: idempotency_key_reused).

Errors use the standard error format.