curl --request PATCH \
--url https://api.devic.ai/v1/environments/{environmentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Reporting box",
"description": "<string>",
"projectId": "<string>",
"imgUrl": "<string>",
"availableToolsGroupsUids": [
"<string>"
],
"knowledgeDocumentIds": [
"<string>"
],
"knowledgeFolderIds": [
"<string>"
],
"knowledgeSkills": [
{
"id": "<string>",
"enabled": true,
"preloadContent": true
}
],
"envVars": {
"REPORT_RECIPIENT": "ops@example.com"
},
"sandboxConfig": {
"runtime": "node24",
"initScript": "apt-get install -y postgresql-client",
"envVars": {
"DATABASE_URL": "postgres://…",
"SSH_PRIVATE_KEY": "-----BEGIN…"
},
"snapshotEnabled": true,
"replaceSnapshotOnStop": true,
"perTenantSnapshots": true,
"persistAfterSessionClose": true,
"autoExtend": true,
"autoRestart": true,
"publicSlug": "my-app",
"startCommand": "cd /workspace && npm start",
"memoryMib": 2048
}
}
'import requests
url = "https://api.devic.ai/v1/environments/{environmentId}"
payload = {
"name": "Reporting box",
"description": "<string>",
"projectId": "<string>",
"imgUrl": "<string>",
"availableToolsGroupsUids": ["<string>"],
"knowledgeDocumentIds": ["<string>"],
"knowledgeFolderIds": ["<string>"],
"knowledgeSkills": [
{
"id": "<string>",
"enabled": True,
"preloadContent": True
}
],
"envVars": { "REPORT_RECIPIENT": "ops@example.com" },
"sandboxConfig": {
"runtime": "node24",
"initScript": "apt-get install -y postgresql-client",
"envVars": {
"DATABASE_URL": "postgres://…",
"SSH_PRIVATE_KEY": "-----BEGIN…"
},
"snapshotEnabled": True,
"replaceSnapshotOnStop": True,
"perTenantSnapshots": True,
"persistAfterSessionClose": True,
"autoExtend": True,
"autoRestart": True,
"publicSlug": "my-app",
"startCommand": "cd /workspace && npm start",
"memoryMib": 2048
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Reporting box',
description: '<string>',
projectId: '<string>',
imgUrl: '<string>',
availableToolsGroupsUids: ['<string>'],
knowledgeDocumentIds: ['<string>'],
knowledgeFolderIds: ['<string>'],
knowledgeSkills: [{id: '<string>', enabled: true, preloadContent: true}],
envVars: {REPORT_RECIPIENT: 'ops@example.com'},
sandboxConfig: {
runtime: 'node24',
initScript: 'apt-get install -y postgresql-client',
envVars: {DATABASE_URL: 'postgres://…', SSH_PRIVATE_KEY: '-----BEGIN…'},
snapshotEnabled: true,
replaceSnapshotOnStop: true,
perTenantSnapshots: true,
persistAfterSessionClose: true,
autoExtend: true,
autoRestart: true,
publicSlug: 'my-app',
startCommand: 'cd /workspace && npm start',
memoryMib: 2048
}
})
};
fetch('https://api.devic.ai/v1/environments/{environmentId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Reporting box',
'description' => '<string>',
'projectId' => '<string>',
'imgUrl' => '<string>',
'availableToolsGroupsUids' => [
'<string>'
],
'knowledgeDocumentIds' => [
'<string>'
],
'knowledgeFolderIds' => [
'<string>'
],
'knowledgeSkills' => [
[
'id' => '<string>',
'enabled' => true,
'preloadContent' => true
]
],
'envVars' => [
'REPORT_RECIPIENT' => 'ops@example.com'
],
'sandboxConfig' => [
'runtime' => 'node24',
'initScript' => 'apt-get install -y postgresql-client',
'envVars' => [
'DATABASE_URL' => 'postgres://…',
'SSH_PRIVATE_KEY' => '-----BEGIN…'
],
'snapshotEnabled' => true,
'replaceSnapshotOnStop' => true,
'perTenantSnapshots' => true,
'persistAfterSessionClose' => true,
'autoExtend' => true,
'autoRestart' => true,
'publicSlug' => 'my-app',
'startCommand' => 'cd /workspace && npm start',
'memoryMib' => 2048
]
]),
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}"
payload := strings.NewReader("{\n \"name\": \"Reporting box\",\n \"description\": \"<string>\",\n \"projectId\": \"<string>\",\n \"imgUrl\": \"<string>\",\n \"availableToolsGroupsUids\": [\n \"<string>\"\n ],\n \"knowledgeDocumentIds\": [\n \"<string>\"\n ],\n \"knowledgeFolderIds\": [\n \"<string>\"\n ],\n \"knowledgeSkills\": [\n {\n \"id\": \"<string>\",\n \"enabled\": true,\n \"preloadContent\": true\n }\n ],\n \"envVars\": {\n \"REPORT_RECIPIENT\": \"ops@example.com\"\n },\n \"sandboxConfig\": {\n \"runtime\": \"node24\",\n \"initScript\": \"apt-get install -y postgresql-client\",\n \"envVars\": {\n \"DATABASE_URL\": \"postgres://…\",\n \"SSH_PRIVATE_KEY\": \"-----BEGIN…\"\n },\n \"snapshotEnabled\": true,\n \"replaceSnapshotOnStop\": true,\n \"perTenantSnapshots\": true,\n \"persistAfterSessionClose\": true,\n \"autoExtend\": true,\n \"autoRestart\": true,\n \"publicSlug\": \"my-app\",\n \"startCommand\": \"cd /workspace && npm start\",\n \"memoryMib\": 2048\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.devic.ai/v1/environments/{environmentId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Reporting box\",\n \"description\": \"<string>\",\n \"projectId\": \"<string>\",\n \"imgUrl\": \"<string>\",\n \"availableToolsGroupsUids\": [\n \"<string>\"\n ],\n \"knowledgeDocumentIds\": [\n \"<string>\"\n ],\n \"knowledgeFolderIds\": [\n \"<string>\"\n ],\n \"knowledgeSkills\": [\n {\n \"id\": \"<string>\",\n \"enabled\": true,\n \"preloadContent\": true\n }\n ],\n \"envVars\": {\n \"REPORT_RECIPIENT\": \"ops@example.com\"\n },\n \"sandboxConfig\": {\n \"runtime\": \"node24\",\n \"initScript\": \"apt-get install -y postgresql-client\",\n \"envVars\": {\n \"DATABASE_URL\": \"postgres://…\",\n \"SSH_PRIVATE_KEY\": \"-----BEGIN…\"\n },\n \"snapshotEnabled\": true,\n \"replaceSnapshotOnStop\": true,\n \"perTenantSnapshots\": true,\n \"persistAfterSessionClose\": true,\n \"autoExtend\": true,\n \"autoRestart\": true,\n \"publicSlug\": \"my-app\",\n \"startCommand\": \"cd /workspace && npm start\",\n \"memoryMib\": 2048\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/environments/{environmentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Reporting box\",\n \"description\": \"<string>\",\n \"projectId\": \"<string>\",\n \"imgUrl\": \"<string>\",\n \"availableToolsGroupsUids\": [\n \"<string>\"\n ],\n \"knowledgeDocumentIds\": [\n \"<string>\"\n ],\n \"knowledgeFolderIds\": [\n \"<string>\"\n ],\n \"knowledgeSkills\": [\n {\n \"id\": \"<string>\",\n \"enabled\": true,\n \"preloadContent\": true\n }\n ],\n \"envVars\": {\n \"REPORT_RECIPIENT\": \"ops@example.com\"\n },\n \"sandboxConfig\": {\n \"runtime\": \"node24\",\n \"initScript\": \"apt-get install -y postgresql-client\",\n \"envVars\": {\n \"DATABASE_URL\": \"postgres://…\",\n \"SSH_PRIVATE_KEY\": \"-----BEGIN…\"\n },\n \"snapshotEnabled\": true,\n \"replaceSnapshotOnStop\": true,\n \"perTenantSnapshots\": true,\n \"persistAfterSessionClose\": true,\n \"autoExtend\": true,\n \"autoRestart\": true,\n \"publicSlug\": \"my-app\",\n \"startCommand\": \"cd /workspace && npm start\",\n \"memoryMib\": 2048\n }\n}"
response = http.request(request)
puts response.read_bodyUpdate an environment
envVars replaces the whole map when present. Values read back masked and sent again unchanged keep their stored secret, so a read-modify-write of the map does not destroy the secrets it did not touch.
curl --request PATCH \
--url https://api.devic.ai/v1/environments/{environmentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Reporting box",
"description": "<string>",
"projectId": "<string>",
"imgUrl": "<string>",
"availableToolsGroupsUids": [
"<string>"
],
"knowledgeDocumentIds": [
"<string>"
],
"knowledgeFolderIds": [
"<string>"
],
"knowledgeSkills": [
{
"id": "<string>",
"enabled": true,
"preloadContent": true
}
],
"envVars": {
"REPORT_RECIPIENT": "ops@example.com"
},
"sandboxConfig": {
"runtime": "node24",
"initScript": "apt-get install -y postgresql-client",
"envVars": {
"DATABASE_URL": "postgres://…",
"SSH_PRIVATE_KEY": "-----BEGIN…"
},
"snapshotEnabled": true,
"replaceSnapshotOnStop": true,
"perTenantSnapshots": true,
"persistAfterSessionClose": true,
"autoExtend": true,
"autoRestart": true,
"publicSlug": "my-app",
"startCommand": "cd /workspace && npm start",
"memoryMib": 2048
}
}
'import requests
url = "https://api.devic.ai/v1/environments/{environmentId}"
payload = {
"name": "Reporting box",
"description": "<string>",
"projectId": "<string>",
"imgUrl": "<string>",
"availableToolsGroupsUids": ["<string>"],
"knowledgeDocumentIds": ["<string>"],
"knowledgeFolderIds": ["<string>"],
"knowledgeSkills": [
{
"id": "<string>",
"enabled": True,
"preloadContent": True
}
],
"envVars": { "REPORT_RECIPIENT": "ops@example.com" },
"sandboxConfig": {
"runtime": "node24",
"initScript": "apt-get install -y postgresql-client",
"envVars": {
"DATABASE_URL": "postgres://…",
"SSH_PRIVATE_KEY": "-----BEGIN…"
},
"snapshotEnabled": True,
"replaceSnapshotOnStop": True,
"perTenantSnapshots": True,
"persistAfterSessionClose": True,
"autoExtend": True,
"autoRestart": True,
"publicSlug": "my-app",
"startCommand": "cd /workspace && npm start",
"memoryMib": 2048
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Reporting box',
description: '<string>',
projectId: '<string>',
imgUrl: '<string>',
availableToolsGroupsUids: ['<string>'],
knowledgeDocumentIds: ['<string>'],
knowledgeFolderIds: ['<string>'],
knowledgeSkills: [{id: '<string>', enabled: true, preloadContent: true}],
envVars: {REPORT_RECIPIENT: 'ops@example.com'},
sandboxConfig: {
runtime: 'node24',
initScript: 'apt-get install -y postgresql-client',
envVars: {DATABASE_URL: 'postgres://…', SSH_PRIVATE_KEY: '-----BEGIN…'},
snapshotEnabled: true,
replaceSnapshotOnStop: true,
perTenantSnapshots: true,
persistAfterSessionClose: true,
autoExtend: true,
autoRestart: true,
publicSlug: 'my-app',
startCommand: 'cd /workspace && npm start',
memoryMib: 2048
}
})
};
fetch('https://api.devic.ai/v1/environments/{environmentId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Reporting box',
'description' => '<string>',
'projectId' => '<string>',
'imgUrl' => '<string>',
'availableToolsGroupsUids' => [
'<string>'
],
'knowledgeDocumentIds' => [
'<string>'
],
'knowledgeFolderIds' => [
'<string>'
],
'knowledgeSkills' => [
[
'id' => '<string>',
'enabled' => true,
'preloadContent' => true
]
],
'envVars' => [
'REPORT_RECIPIENT' => 'ops@example.com'
],
'sandboxConfig' => [
'runtime' => 'node24',
'initScript' => 'apt-get install -y postgresql-client',
'envVars' => [
'DATABASE_URL' => 'postgres://…',
'SSH_PRIVATE_KEY' => '-----BEGIN…'
],
'snapshotEnabled' => true,
'replaceSnapshotOnStop' => true,
'perTenantSnapshots' => true,
'persistAfterSessionClose' => true,
'autoExtend' => true,
'autoRestart' => true,
'publicSlug' => 'my-app',
'startCommand' => 'cd /workspace && npm start',
'memoryMib' => 2048
]
]),
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}"
payload := strings.NewReader("{\n \"name\": \"Reporting box\",\n \"description\": \"<string>\",\n \"projectId\": \"<string>\",\n \"imgUrl\": \"<string>\",\n \"availableToolsGroupsUids\": [\n \"<string>\"\n ],\n \"knowledgeDocumentIds\": [\n \"<string>\"\n ],\n \"knowledgeFolderIds\": [\n \"<string>\"\n ],\n \"knowledgeSkills\": [\n {\n \"id\": \"<string>\",\n \"enabled\": true,\n \"preloadContent\": true\n }\n ],\n \"envVars\": {\n \"REPORT_RECIPIENT\": \"ops@example.com\"\n },\n \"sandboxConfig\": {\n \"runtime\": \"node24\",\n \"initScript\": \"apt-get install -y postgresql-client\",\n \"envVars\": {\n \"DATABASE_URL\": \"postgres://…\",\n \"SSH_PRIVATE_KEY\": \"-----BEGIN…\"\n },\n \"snapshotEnabled\": true,\n \"replaceSnapshotOnStop\": true,\n \"perTenantSnapshots\": true,\n \"persistAfterSessionClose\": true,\n \"autoExtend\": true,\n \"autoRestart\": true,\n \"publicSlug\": \"my-app\",\n \"startCommand\": \"cd /workspace && npm start\",\n \"memoryMib\": 2048\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.devic.ai/v1/environments/{environmentId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Reporting box\",\n \"description\": \"<string>\",\n \"projectId\": \"<string>\",\n \"imgUrl\": \"<string>\",\n \"availableToolsGroupsUids\": [\n \"<string>\"\n ],\n \"knowledgeDocumentIds\": [\n \"<string>\"\n ],\n \"knowledgeFolderIds\": [\n \"<string>\"\n ],\n \"knowledgeSkills\": [\n {\n \"id\": \"<string>\",\n \"enabled\": true,\n \"preloadContent\": true\n }\n ],\n \"envVars\": {\n \"REPORT_RECIPIENT\": \"ops@example.com\"\n },\n \"sandboxConfig\": {\n \"runtime\": \"node24\",\n \"initScript\": \"apt-get install -y postgresql-client\",\n \"envVars\": {\n \"DATABASE_URL\": \"postgres://…\",\n \"SSH_PRIVATE_KEY\": \"-----BEGIN…\"\n },\n \"snapshotEnabled\": true,\n \"replaceSnapshotOnStop\": true,\n \"perTenantSnapshots\": true,\n \"persistAfterSessionClose\": true,\n \"autoExtend\": true,\n \"autoRestart\": true,\n \"publicSlug\": \"my-app\",\n \"startCommand\": \"cd /workspace && npm start\",\n \"memoryMib\": 2048\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devic.ai/v1/environments/{environmentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Reporting box\",\n \"description\": \"<string>\",\n \"projectId\": \"<string>\",\n \"imgUrl\": \"<string>\",\n \"availableToolsGroupsUids\": [\n \"<string>\"\n ],\n \"knowledgeDocumentIds\": [\n \"<string>\"\n ],\n \"knowledgeFolderIds\": [\n \"<string>\"\n ],\n \"knowledgeSkills\": [\n {\n \"id\": \"<string>\",\n \"enabled\": true,\n \"preloadContent\": true\n }\n ],\n \"envVars\": {\n \"REPORT_RECIPIENT\": \"ops@example.com\"\n },\n \"sandboxConfig\": {\n \"runtime\": \"node24\",\n \"initScript\": \"apt-get install -y postgresql-client\",\n \"envVars\": {\n \"DATABASE_URL\": \"postgres://…\",\n \"SSH_PRIVATE_KEY\": \"-----BEGIN…\"\n },\n \"snapshotEnabled\": true,\n \"replaceSnapshotOnStop\": true,\n \"perTenantSnapshots\": true,\n \"persistAfterSessionClose\": true,\n \"autoExtend\": true,\n \"autoRestart\": true,\n \"publicSlug\": \"my-app\",\n \"startCommand\": \"cd /workspace && npm start\",\n \"memoryMib\": 2048\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
An API key from your Devic console, sent as Authorization: Bearer <key>. An embedded front end sends a tenant-session token instead, so no API key reaches the browser, and an OAuth integration sends its access token. Missing, invalid or expired credentials get a 401. See Authentication.
Path Parameters
Environment id
Body
Environment name
"Reporting box"
What this environment is for
Project id, or null to unassign the environment from its project.
Image URL for the environment
Tool groups (MCPs and built-in tools) available on this environment
Knowledge documents attached
Knowledge folders attached
Knowledge skills attached
Show child attributes
Show child attributes
Environment-level variables, encrypted at rest and returned masked. Available to every agent and assistant connected to this environment.
{ "REPORT_RECIPIENT": "ops@example.com" }
Sandbox configuration
Show child attributes
Show child attributes
Response
Success