Suspend a sandbox
curl --request POST \
--url https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend', 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.tensorlake.ai/sandboxes/{sandbox_id}/suspend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tensorlake.ai/sandboxes/{sandbox_id}/suspend"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyLife Cycle Management
Suspend Sandbox
Suspend a named sandbox and control whether proxy traffic can wake it.
POST
/
sandboxes
/
{sandbox_id}
/
suspend
Suspend a sandbox
curl --request POST \
--url https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend', 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.tensorlake.ai/sandboxes/{sandbox_id}/suspend",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tensorlake.ai/sandboxes/{sandbox_id}/suspend"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tensorlake.ai/sandboxes/{sandbox_id}/suspend")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodySuspend a named running sandbox while preserving its state for resume. A paused VM may remain available; suspension does not require destroying it.
- This path accepts either the sandbox ID or the sandbox name.
- Only named sandboxes can be suspended. Ephemeral sandboxes return
400 Bad Request. - Tensorlake returns
202 Acceptedwhen suspension starts or is already in progress. - Tensorlake returns
200 OKwhen the sandbox is already suspended.
resume_failed does not clear the diagnosis or retry the sandbox. Use Resume Sandbox for recovery.
Suspension preserves auto_resume. With its default value, true, subsequent proxy traffic can wake the sandbox. Set it to false through Update Sandbox before suspension to keep the sandbox suspended until you explicitly resume it. You can also change this setting while already suspended without waking it.Was this page helpful?