curl --request POST \
--url https://api.recoupable.dev/api/sandbox \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"repoUrl": "<string>",
"sessionId": "<string>"
}
'import requests
url = "https://api.recoupable.dev/api/sandbox"
payload = {
"repoUrl": "<string>",
"sessionId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({repoUrl: '<string>', sessionId: '<string>'})
};
fetch('https://api.recoupable.dev/api/sandbox', 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.recoupable.dev/api/sandbox",
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([
'repoUrl' => '<string>',
'sessionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.dev/api/sandbox"
payload := strings.NewReader("{\n \"repoUrl\": \"<string>\",\n \"sessionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://api.recoupable.dev/api/sandbox")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"repoUrl\": \"<string>\",\n \"sessionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/sandbox")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"repoUrl\": \"<string>\",\n \"sessionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": 123,
"timeout": 123,
"currentBranch": "<string>",
"mode": "vercel",
"timing": {
"readyMs": 123
}
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}Create or restore session sandbox
Provisions a Sandbox for the given session. If a per-org base snapshot exists, the sandbox boots from it (skipping the full repo clone, ~75s saved). Otherwise the sandbox boots from the default base snapshot and a background workflow builds an org-specific snapshot for next time. When the session has prior runtime state (a paused or running sandbox under the same sandboxName), the call resumes it instead of creating a new one. On success, the session row is updated with the new sandboxState and lifecycle is bumped to active; the lifecycle workflow is kicked to manage hibernation and expiry from there.
curl --request POST \
--url https://api.recoupable.dev/api/sandbox \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"repoUrl": "<string>",
"sessionId": "<string>"
}
'import requests
url = "https://api.recoupable.dev/api/sandbox"
payload = {
"repoUrl": "<string>",
"sessionId": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({repoUrl: '<string>', sessionId: '<string>'})
};
fetch('https://api.recoupable.dev/api/sandbox', 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.recoupable.dev/api/sandbox",
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([
'repoUrl' => '<string>',
'sessionId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.recoupable.dev/api/sandbox"
payload := strings.NewReader("{\n \"repoUrl\": \"<string>\",\n \"sessionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://api.recoupable.dev/api/sandbox")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"repoUrl\": \"<string>\",\n \"sessionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recoupable.dev/api/sandbox")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"repoUrl\": \"<string>\",\n \"sessionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"createdAt": 123,
"timeout": 123,
"currentBranch": "<string>",
"mode": "vercel",
"timing": {
"readyMs": 123
}
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}{
"status": "error",
"error": "<string>"
}Authorizations
Body
GitHub repository URL the sandbox should clone (e.g. https://github.com/owner/repo). Validated against GitHub URL rules; private repos require the service GitHub token configured server-side.
Owning session id. Required for the chat UX flow — the sandbox is named deterministically from the session id, enabling resume across reconnects. When omitted, a one-shot ephemeral sandbox is created (legacy).
Response
Sandbox provisioned and bound to the session.
Epoch milliseconds when the sandbox handle was returned.
Sandbox idle-timeout in milliseconds. The lifecycle workflow uses this to schedule hibernation.
Branch the sandbox checked out.
Sandbox provider. Currently always vercel.
vercel Show child attributes
Show child attributes
Was this page helpful?
