Skip to main content
Permanently delete a sandbox. This action cannot be undone. All data in the sandbox will be lost.
Deleting a sandbox is permanent and cannot be undone. All files, data, and state will be lost.

Endpoint

DELETE /v1/sandboxes/{sandbox_id}

Request

Headers

X-API-Key: your_api_key_here

Path Parameters

ParameterTypeDescription
sandbox_idstringThe ID of the sandbox to delete

Response

Success (200 OK)

{
  "status": "deleted",
  "id": "1761048129dsaqav4n"
}

Error Responses

404 Not Found:
{
  "error": "Sandbox not found",
  "code": "NOT_FOUND"
}
403 Forbidden:
{
  "error": "Forbidden",
  "code": "PERMISSION_DENIED"
}

Examples

cURL

curl -X DELETE \
     -H "X-API-Key: your_api_key_here" \
     https://api.hopx.dev/v1/sandboxes/1761048129dsaqav4n

Python

import os
import requests

api_key = os.environ.get("HOPX_API_KEY")
sandbox_id = "1761048129dsaqav4n"

headers = {
    "X-API-Key": api_key
}

response = requests.delete(
    f"https://api.hopx.dev/v1/sandboxes/{sandbox_id}",
    headers=headers
)

if response.status_code == 200:
    result = response.json()
    print(f"Sandbox {result['id']} deleted successfully")
else:
    print(f"Error: {response.status_code}")
    print(response.json())

JavaScript

const apiKey = process.env.HOPX_API_KEY;
const sandboxId = '1761048129dsaqav4n';

const response = await fetch(
  `https://api.hopx.dev/v1/sandboxes/${sandboxId}`,
  {
    method: 'DELETE',
    headers: {
      'X-API-Key': apiKey
    }
  }
);

if (response.ok) {
  const result = await response.json();
  console.log(`Sandbox ${result.id} deleted successfully`);
} else {
  const error = await response.json();
  console.error('Error:', error);
}