Create or update a sandbox environment
curl --request PUT \
--url https://api.example.com/api/v1/sandbox-environments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {
"name": "<string>",
"description": "<string>",
"environment_variables": {},
"networking": {
"domain_allow_list": "<string>",
"network_block_all": true,
"secrets": [
{
"env": "<string>",
"hosts": [
"<string>"
],
"value": "<string>"
}
]
},
"resources": {
"cpu": 1,
"disk": 3,
"memory": 1
}
}
}
'import requests
url = "https://api.example.com/api/v1/sandbox-environments"
payload = { "manifest": {
"name": "<string>",
"description": "<string>",
"environment_variables": {},
"networking": {
"domain_allow_list": "<string>",
"network_block_all": True,
"secrets": [
{
"env": "<string>",
"hosts": ["<string>"],
"value": "<string>"
}
]
},
"resources": {
"cpu": 1,
"disk": 3,
"memory": 1
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
name: '<string>',
description: '<string>',
environment_variables: {},
networking: {
domain_allow_list: '<string>',
network_block_all: true,
secrets: [{env: '<string>', hosts: ['<string>'], value: '<string>'}]
},
resources: {cpu: 1, disk: 3, memory: 1}
}
})
};
fetch('https://api.example.com/api/v1/sandbox-environments', 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.example.com/api/v1/sandbox-environments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
'name' => '<string>',
'description' => '<string>',
'environment_variables' => [
],
'networking' => [
'domain_allow_list' => '<string>',
'network_block_all' => true,
'secrets' => [
[
'env' => '<string>',
'hosts' => [
'<string>'
],
'value' => '<string>'
]
]
],
'resources' => [
'cpu' => 1,
'disk' => 3,
'memory' => 1
]
]
]),
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.example.com/api/v1/sandbox-environments"
payload := strings.NewReader("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"environment_variables\": {},\n \"networking\": {\n \"domain_allow_list\": \"<string>\",\n \"network_block_all\": true,\n \"secrets\": [\n {\n \"env\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ],\n \"value\": \"<string>\"\n }\n ]\n },\n \"resources\": {\n \"cpu\": 1,\n \"disk\": 3,\n \"memory\": 1\n }\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/v1/sandbox-environments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"environment_variables\": {},\n \"networking\": {\n \"domain_allow_list\": \"<string>\",\n \"network_block_all\": true,\n \"secrets\": [\n {\n \"env\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ],\n \"value\": \"<string>\"\n }\n ]\n },\n \"resources\": {\n \"cpu\": 1,\n \"disk\": 3,\n \"memory\": 1\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/sandbox-environments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"environment_variables\": {},\n \"networking\": {\n \"domain_allow_list\": \"<string>\",\n \"network_block_all\": true,\n \"secrets\": [\n {\n \"env\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ],\n \"value\": \"<string>\"\n }\n ]\n },\n \"resources\": {\n \"cpu\": 1,\n \"disk\": 3,\n \"memory\": 1\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created_at": "2023-11-07T05:31:56Z",
"created_by_subject": {
"subject_display_name": "<string>",
"subject_id": "<string>",
"subject_type": "<string>"
},
"description": "<string>",
"id": "<string>",
"lifecycle_stage": "active",
"manifest": {
"name": "<string>",
"description": "<string>",
"environment_variables": {},
"image": {
"type": "build",
"build_script": "set -ex\npip install httpx\n"
},
"networking": {
"domain_allow_list": "<string>",
"network_block_all": true,
"secrets": [
{
"env": "<string>",
"hosts": [
"<string>"
],
"value": "<string>"
}
]
},
"resources": {
"cpu": 1,
"disk": 3,
"memory": 1
}
},
"name": "<string>",
"status": "pending",
"status_reason": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}Sandboxes
Create or update a sandbox environment
Create or replace by manifest.name. Requires a configured sandbox provider.
PUT
/
api
/
v1
/
sandbox-environments
Create or update a sandbox environment
curl --request PUT \
--url https://api.example.com/api/v1/sandbox-environments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"manifest": {
"name": "<string>",
"description": "<string>",
"environment_variables": {},
"networking": {
"domain_allow_list": "<string>",
"network_block_all": true,
"secrets": [
{
"env": "<string>",
"hosts": [
"<string>"
],
"value": "<string>"
}
]
},
"resources": {
"cpu": 1,
"disk": 3,
"memory": 1
}
}
}
'import requests
url = "https://api.example.com/api/v1/sandbox-environments"
payload = { "manifest": {
"name": "<string>",
"description": "<string>",
"environment_variables": {},
"networking": {
"domain_allow_list": "<string>",
"network_block_all": True,
"secrets": [
{
"env": "<string>",
"hosts": ["<string>"],
"value": "<string>"
}
]
},
"resources": {
"cpu": 1,
"disk": 3,
"memory": 1
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
manifest: {
name: '<string>',
description: '<string>',
environment_variables: {},
networking: {
domain_allow_list: '<string>',
network_block_all: true,
secrets: [{env: '<string>', hosts: ['<string>'], value: '<string>'}]
},
resources: {cpu: 1, disk: 3, memory: 1}
}
})
};
fetch('https://api.example.com/api/v1/sandbox-environments', 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.example.com/api/v1/sandbox-environments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'manifest' => [
'name' => '<string>',
'description' => '<string>',
'environment_variables' => [
],
'networking' => [
'domain_allow_list' => '<string>',
'network_block_all' => true,
'secrets' => [
[
'env' => '<string>',
'hosts' => [
'<string>'
],
'value' => '<string>'
]
]
],
'resources' => [
'cpu' => 1,
'disk' => 3,
'memory' => 1
]
]
]),
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.example.com/api/v1/sandbox-environments"
payload := strings.NewReader("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"environment_variables\": {},\n \"networking\": {\n \"domain_allow_list\": \"<string>\",\n \"network_block_all\": true,\n \"secrets\": [\n {\n \"env\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ],\n \"value\": \"<string>\"\n }\n ]\n },\n \"resources\": {\n \"cpu\": 1,\n \"disk\": 3,\n \"memory\": 1\n }\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/v1/sandbox-environments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"manifest\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"environment_variables\": {},\n \"networking\": {\n \"domain_allow_list\": \"<string>\",\n \"network_block_all\": true,\n \"secrets\": [\n {\n \"env\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ],\n \"value\": \"<string>\"\n }\n ]\n },\n \"resources\": {\n \"cpu\": 1,\n \"disk\": 3,\n \"memory\": 1\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/sandbox-environments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"manifest\": {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"environment_variables\": {},\n \"networking\": {\n \"domain_allow_list\": \"<string>\",\n \"network_block_all\": true,\n \"secrets\": [\n {\n \"env\": \"<string>\",\n \"hosts\": [\n \"<string>\"\n ],\n \"value\": \"<string>\"\n }\n ]\n },\n \"resources\": {\n \"cpu\": 1,\n \"disk\": 3,\n \"memory\": 1\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created_at": "2023-11-07T05:31:56Z",
"created_by_subject": {
"subject_display_name": "<string>",
"subject_id": "<string>",
"subject_type": "<string>"
},
"description": "<string>",
"id": "<string>",
"lifecycle_stage": "active",
"manifest": {
"name": "<string>",
"description": "<string>",
"environment_variables": {},
"image": {
"type": "build",
"build_script": "set -ex\npip install httpx\n"
},
"networking": {
"domain_allow_list": "<string>",
"network_block_all": true,
"secrets": [
{
"env": "<string>",
"hosts": [
"<string>"
],
"value": "<string>"
}
]
},
"resources": {
"cpu": 1,
"disk": 3,
"memory": 1
}
},
"name": "<string>",
"status": "pending",
"status_reason": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}{
"error": {
"message": "<string>",
"code": "<string>",
"param": "<string>",
"type": "<string>"
}
}Authorizations
Caller credential (Authorization: Bearer <token>). Required on protected routes when auth is enabled. Browser sessions may use the HttpOnly id_token or accessToken cookie instead.
Body
application/json
Show child attributes
Show child attributes
Response
The saved sandbox environment.
Show child attributes
Show child attributes