List sandboxes
curl --request GET \
--url https://api.e2b.app/sandboxes \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.e2b.app/sandboxes"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.e2b.app/sandboxes', 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://api.e2b.app/sandboxes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.e2b.app/sandboxes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.e2b.app/sandboxes")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.e2b.app/sandboxes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"templateID": "<string>",
"sandboxID": "<string>",
"clientID": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"cpuCount": 2,
"memoryMB": 129,
"diskSizeMB": 1,
"state": "running",
"envdVersion": "<string>",
"alias": "<string>",
"metadata": {},
"volumeMounts": [
{
"name": "<string>",
"path": "<string>"
}
]
}
]{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Sandboxes
List sandboxes
deprecated
List all running sandboxes. Use GET /v2/sandboxes instead.
GET
/
sandboxes
List sandboxes
curl --request GET \
--url https://api.e2b.app/sandboxes \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.e2b.app/sandboxes"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.e2b.app/sandboxes', 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://api.e2b.app/sandboxes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://api.e2b.app/sandboxes"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.e2b.app/sandboxes")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.e2b.app/sandboxes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"templateID": "<string>",
"sandboxID": "<string>",
"clientID": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"endAt": "2023-11-07T05:31:56Z",
"cpuCount": 2,
"memoryMB": 129,
"diskSizeMB": 1,
"state": "running",
"envdVersion": "<string>",
"alias": "<string>",
"metadata": {},
"volumeMounts": [
{
"name": "<string>",
"path": "<string>"
}
]
}
]{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}{
"code": 123,
"message": "<string>",
"error_code": "<string>"
}Authorizations
Query Parameters
Metadata query used to filter the sandboxes (e.g. "user=abc&app=prod"). Each key and values must be URL encoded.
Response
Successfully returned all running sandboxes
Identifier of the template from which is the sandbox created
Identifier of the sandbox
Identifier of the client
Time when the sandbox was started
Time when the sandbox will expire
CPU cores for the sandbox
Required range:
x >= 1Memory for the sandbox in MiB
Required range:
x >= 128Disk size for the sandbox in MiB
Required range:
x >= 0State of the sandbox
Available options:
running, paused Version of the envd running in the sandbox
Alias of the template
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?