Skip to main content
GET
/
health
Check the health of the service
curl --request GET \
  --url https://sandbox.{domain}/health \
  --header 'E2b-Sandbox-Id: <e2b-sandbox-id>' \
  --header 'E2b-Sandbox-Port: <e2b-sandbox-port>'
import requests

url = "https://sandbox.{domain}/health"

headers = {
    "E2b-Sandbox-Id": "<e2b-sandbox-id>",
    "E2b-Sandbox-Port": "<e2b-sandbox-port>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
  method: 'GET',
  headers: {'E2b-Sandbox-Id': '<e2b-sandbox-id>', 'E2b-Sandbox-Port': '<e2b-sandbox-port>'}
};

fetch('https://sandbox.{domain}/health', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://sandbox.{domain}/health",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "E2b-Sandbox-Id: <e2b-sandbox-id>",
    "E2b-Sandbox-Port: <e2b-sandbox-port>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://sandbox.{domain}/health"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("E2b-Sandbox-Id", "<e2b-sandbox-id>")
	req.Header.Add("E2b-Sandbox-Port", "<e2b-sandbox-port>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://sandbox.{domain}/health")
  .header("E2b-Sandbox-Id", "<e2b-sandbox-id>")
  .header("E2b-Sandbox-Port", "<e2b-sandbox-port>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://sandbox.{domain}/health")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["E2b-Sandbox-Id"] = '<e2b-sandbox-id>'
request["E2b-Sandbox-Port"] = '<e2b-sandbox-port>'

response = http.request(request)
puts response.read_body
{
  "message": "<string>",
  "code": 123,
  "sandboxID": "<string>"
}

Headers

E2b-Sandbox-Id
string
required

Identifier of the target sandbox. Routes the request to that sandbox's envd over the shared sandbox host.

E2b-Sandbox-Port
integer
default:49983
required

Port envd listens on inside the sandbox (default 49983).

Response

The service is healthy