Skip to main content
Pause a sandbox that is in the running state. The sandbox will transition to paused and billing will stop. The sandbox state is preserved and can be resumed later.

Endpoint

POST /v1/sandboxes/{sandbox_id}/pause

Request

Headers

X-API-Key: your_api_key_here

Path Parameters

ParameterTypeDescription
sandbox_idstringThe ID of the sandbox to pause

Response

Success (200 OK)

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

Examples

cURL

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

Python

import os
import requests

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

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

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

if response.status_code == 200:
    result = response.json()
    print(f"Sandbox {result['id']} paused: {result['status']}")

JavaScript

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

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

if (response.ok) {
  const result = await response.json();
  console.log(`Sandbox ${result.id} paused: ${result.status}`);
}