curl --request POST \
--url https://api.devic.ai/v1/environments/{environmentId}/sandbox/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"timeoutMinutes": 10,
"tenantId": "<string>",
"force": true,
"forceUnsavedSnapshot": true
}
'import requests
url = "https://api.devic.ai/v1/environments/{environmentId}/sandbox/start"
payload = {
"timeoutMinutes": 10,
"tenantId": "<string>",
"force": True,
"forceUnsavedSnapshot": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
timeoutMinutes: 10,
tenantId: '<string>',
force: true,
forceUnsavedSnapshot: true
})
};
fetch('https://api.devic.ai/v1/environments/{environmentId}/sandbox/start', 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.devic.ai/v1/environments/{environmentId}/sandbox/start",
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([
'timeoutMinutes' => 10,
'tenantId' => '<string>',
'force' => true,
'forceUnsavedSnapshot' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.devic.ai/v1/environments/{environmentId}/sandbox/start"
payload := strings.NewReader("{\n \"timeoutMinutes\": 10,\n \"tenantId\": \"<string>\",\n \"force\": true,\n \"forceUnsavedSnapshot\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.devic.ai/v1/environments/{environmentId}/sandbox/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"timeoutMinutes\": 10,\n \"tenantId\": \"<string>\",\n \"force\": true,\n \"forceUnsavedSnapshot\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/environments/{environmentId}/sandbox/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timeoutMinutes\": 10,\n \"tenantId\": \"<string>\",\n \"force\": true,\n \"forceUnsavedSnapshot\": true\n}"
response = http.request(request)
puts response.read_bodyStart a sandbox session
Boots from the environment snapshot when it has one, otherwise creates a fresh machine and runs the init script — whose output comes back, which is the way to verify a script works. One session per environment (per tenant, where snapshots are per-tenant): a second concurrent start returns 409 SESSION_ACTIVE unless force is set.
curl --request POST \
--url https://api.devic.ai/v1/environments/{environmentId}/sandbox/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"timeoutMinutes": 10,
"tenantId": "<string>",
"force": true,
"forceUnsavedSnapshot": true
}
'import requests
url = "https://api.devic.ai/v1/environments/{environmentId}/sandbox/start"
payload = {
"timeoutMinutes": 10,
"tenantId": "<string>",
"force": True,
"forceUnsavedSnapshot": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
timeoutMinutes: 10,
tenantId: '<string>',
force: true,
forceUnsavedSnapshot: true
})
};
fetch('https://api.devic.ai/v1/environments/{environmentId}/sandbox/start', 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.devic.ai/v1/environments/{environmentId}/sandbox/start",
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([
'timeoutMinutes' => 10,
'tenantId' => '<string>',
'force' => true,
'forceUnsavedSnapshot' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.devic.ai/v1/environments/{environmentId}/sandbox/start"
payload := strings.NewReader("{\n \"timeoutMinutes\": 10,\n \"tenantId\": \"<string>\",\n \"force\": true,\n \"forceUnsavedSnapshot\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.devic.ai/v1/environments/{environmentId}/sandbox/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"timeoutMinutes\": 10,\n \"tenantId\": \"<string>\",\n \"force\": true,\n \"forceUnsavedSnapshot\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/environments/{environmentId}/sandbox/start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"timeoutMinutes\": 10,\n \"tenantId\": \"<string>\",\n \"force\": true,\n \"forceUnsavedSnapshot\": true\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Use JWT token for authentication
Path Parameters
Environment id
Body
Session length in minutes (1-30, default 10). autoExtend on the environment renews it while the session is in use.
10
Start from THIS tenant's snapshot. Only meaningful when the environment has per-tenant snapshots enabled.
Take over an already-active session, discarding its unsaved state. Without it a second concurrent session returns 409 SESSION_ACTIVE.
Start from the last saved version even though a snapshot save is still running. The session may be missing what that save commits.
Response
Session started. Returns sandboxId, runtime and expiresAt.