Set Sandbox Timeouts
Replaces one or both sandbox timeout settings. Updating timeout while
the sandbox is running resets its hard expiration deadline to that many
seconds from now, capped at 24 hours after the current session started.
Updating idle_ttl_seconds resets the idle
countdown when no direct process connection is active; zero disables
idle expiry. Omitted settings remain unchanged. Updates are retained
across later stops and starts. For an inactive sandbox, they apply to
the next powered-on session. Sandboxes that are starting or shutting
down, or whose timeout changes concurrently, return 409.
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"timeout": 43230,
"idle_ttl_seconds": 43200
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout"
payload = {
"timeout": 43230,
"idle_ttl_seconds": 43200
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({timeout: 43230, idle_ttl_seconds: 43200})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout', 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://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'timeout' => 43230,
'idle_ttl_seconds' => 43200
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout"
payload := strings.NewReader("{\n \"timeout\": 43230,\n \"idle_ttl_seconds\": 43200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"timeout\": 43230,\n \"idle_ttl_seconds\": 43200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timeout\": 43230,\n \"idle_ttl_seconds\": 43200\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"sandbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "pending",
"vcpu_count": 123,
"mem_size_mib": 123,
"max_ttl_seconds": 123,
"idle_ttl_seconds": 123,
"max_concurrent_execs": 123,
"base_image": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_active_at": "2023-11-07T05:31:56Z",
"image_digest": "<string>",
"platform": "arm64",
"endpoints": [
{
"port": 32768,
"hostname": "<string>"
}
],
"enable_service_ingress": false,
"mounts": [
{
"disk_id": "<string>",
"path": "<string>",
"subdirectory": "<string>",
"read_only": false,
"conditional": false,
"queue_ms": 2
}
],
"running_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"exit_reason": "<string>",
"checkpoint": "<string>"
}
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}Authorizations
API key
Path Parameters
Sandbox UUID
Body
Seconds from now until a running sandbox pauses, capped at 24 hours after its current session started. Also sets the lifetime budget for its next powered-on session.
60 <= x <= 86400Seconds without a direct process connection before the sandbox pauses. Zero disables idle expiry.
0 <= x <= 86400Was this page helpful?
curl --request POST \
--url https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"timeout": 43230,
"idle_ttl_seconds": 43200
}
'import requests
url = "https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout"
payload = {
"timeout": 43230,
"idle_ttl_seconds": 43200
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({timeout: 43230, idle_ttl_seconds: 43200})
};
fetch('https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout', 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://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'timeout' => 43230,
'idle_ttl_seconds' => 43200
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout"
payload := strings.NewReader("{\n \"timeout\": 43230,\n \"idle_ttl_seconds\": 43200\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"timeout\": 43230,\n \"idle_ttl_seconds\": 43200\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://control.green.us-east-1.aws.prod.archil.com/api/sandboxes/{sid}/timeout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timeout\": 43230,\n \"idle_ttl_seconds\": 43200\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"sandbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "pending",
"vcpu_count": 123,
"mem_size_mib": 123,
"max_ttl_seconds": 123,
"idle_ttl_seconds": 123,
"max_concurrent_execs": 123,
"base_image": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"last_active_at": "2023-11-07T05:31:56Z",
"image_digest": "<string>",
"platform": "arm64",
"endpoints": [
{
"port": 32768,
"hostname": "<string>"
}
],
"enable_service_ingress": false,
"mounts": [
{
"disk_id": "<string>",
"path": "<string>",
"subdirectory": "<string>",
"read_only": false,
"conditional": false,
"queue_ms": 2
}
],
"running_at": "2023-11-07T05:31:56Z",
"finished_at": "2023-11-07T05:31:56Z",
"exit_reason": "<string>",
"checkpoint": "<string>"
}
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}{
"success": false,
"error": "Invalid request parameters",
"code": "<string>"
}