Skip to main content
Use this endpoint to permanently destroy a capsule and release all associated VM resources. The capsule’s filesystem is deleted and the ID cannot be reused. This works regardless of the capsule’s current status — running, paused, or stopped capsules can all be destroyed.
Destroying a capsule is permanent. All data on the capsule filesystem is lost. There is no confirmation step and no recovery path.

Endpoint

DELETE https://app.wrenn.dev/api/v1/capsules/{id}

Authentication

Pass your API key in the X-API-Key header.
X-API-Key: wrn_your_key

Path parameters

id
string
required
The ID of the capsule to destroy (e.g., cl-abc123).

Response

Returns 204 No Content on success. The response body is empty. If the capsule was running, the VM is terminated immediately before deletion. If the capsule was paused, the snapshot files are removed from disk.

curl

curl --request DELETE \
  --url https://app.wrenn.dev/api/v1/capsules/cl-abc123 \
  --header 'X-API-Key: wrn_your_key'

Python SDK

from wrenn import Capsule

# Destroy by ID (static method — no need to connect first)
Capsule.destroy("cl-abc123")

# Or destroy an existing instance
capsule = Capsule.connect("cl-abc123")
capsule.destroy()
The Capsule context manager calls destroy() automatically when the with block exits:
with Capsule(template="minimal", wait=True) as capsule:
    result = capsule.commands.run("echo done")
# capsule is destroyed here

Error responses

StatusDescription
401 UnauthorizedMissing or invalid X-API-Key.
404 Not FoundNo capsule with the given ID exists in your team.