Skip to main content
Kill a sandbox to forcefully terminate it immediately. This is similar to delete but may be used when a sandbox is unresponsive. The sandbox is destroyed and cannot be recovered.

Endpoint

POST /v1/sandboxes/:id/kill

Request

Headers

Authorization: Bearer $HOPX_API_KEY

Path Parameters

ParameterTypeDescription
idstringSandbox ID to kill

Example Request

curl -X POST https://api.hopx.dev/v1/sandboxes/sandbox_abc123xyz/kill \
  -H "Authorization: Bearer $HOPX_API_KEY"

Response

Success (200 OK)

{
  "id": "sandbox_abc123xyz",
  "status": "killed",
  "request_id": "req_abc123"
}

Response Fields

FieldTypeDescription
idstringSandbox ID
statusstringNew status (killed)
request_idstringRequest ID for debugging

Status Codes

CodeDescription
200Sandbox killed successfully
401Authentication required
404Sandbox not found

Errors

Sandbox Not Found (404)

{
  "error": "Sandbox not found",
  "code": "RESOURCE_NOT_FOUND",
  "request_id": "req_abc123"
}
Cause: The sandbox ID doesn’t exist or belongs to another organization. Fix: Verify the sandbox ID is correct. List your sandboxes using GET /v1/sandboxes to find valid IDs.

Important Notes

Killing a sandbox is permanent and irreversible. All data, files, and state in the sandbox will be lost. This action forcefully terminates the sandbox even if it’s unresponsive.
  • Immediate termination - The sandbox is forcefully terminated immediately
  • No graceful shutdown - Running processes are killed without cleanup
  • Resource cleanup - All allocated resources are freed
  • VM Agent API - The sandbox’s VM Agent API endpoint becomes unavailable immediately
  • No recovery - Killed sandboxes cannot be recovered

Use Cases

Kill Unresponsive Sandbox

# Kill a sandbox that's not responding
curl -X POST https://api.hopx.dev/v1/sandboxes/sandbox_abc123xyz/kill \
  -H "Authorization: Bearer $HOPX_API_KEY"

Force Cleanup

# Kill instead of delete when sandbox is stuck
curl -X POST https://api.hopx.dev/v1/sandboxes/sandbox_abc123xyz/kill \
  -H "Authorization: Bearer $HOPX_API_KEY"

Difference from Delete

  • Kill - Forcefully terminates the sandbox immediately, even if unresponsive
  • Delete - Gracefully deletes the sandbox (may fail if sandbox is stuck)
Use kill when a sandbox is unresponsive and delete doesn’t work.

Next Steps