Update an environment
⚠️
Preview — this feature is being built; the design below is the spec.
PATCH https://app.syntic.ai/v1/environments/{environment_id}Change an environment’s settings. Changes to base_image, packages, setup_script or files start a rebuild; other changes apply to containers started afterwards.
For how this fits into a full workflow, see Environments.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <key>: a private inference key (sk_live_...). See Authentication. |
syntic-beta | Yes, while in preview | agents-2026-11-01. Without it the call fails with 400 beta_required. See Versioning. |
Content-Type | Yes | application/json |
Path parameters
| Parameter | Type | Description |
|---|---|---|
environment_id | string | The environment id, starting with env_. |
Body parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
name | string | No | Unique in the workspace, up to 64 characters. |
base_image | string | No | syntic/base (default), syntic/python:3.12, syntic/node:22 or syntic/full. |
packages | object | No | apt, pip and npm lists; up to 200 packages in total. Pin versions for repeatable builds. |
setup_script | string | No | Shell run once at build time, up to 16 KB. |
files | array | No | {file_id, path} copied in under /workspace; up to 50 files, 500 MB. |
network | object | No | mode: none (default), allowlist with allowed_hosts, or open. |
resources | object | No | cpu 1-8, memory_mb 512-16384, disk_mb 1024-51200. |
timeouts | object | No | command_seconds (max 3600), idle_minutes, max_lifetime_minutes (max 1440). |
env_vars | object | No | Plain variables, readable through the API. Never secrets. |
vault_secrets | array | No | {vault_id, name} injected as environment variables at container start. |
Response
200 OK, Content-Type: application/json
{
"id": "env_01JC5B2D4F6H8K0M2P4R",
"type": "environment",
"name": "data-analysis",
"base_image": "syntic/python:3.12",
"packages": {
"apt": [
"git"
],
"pip": [
"pandas==2.2.3",
"matplotlib"
],
"npm": []
},
"setup_script": "mkdir -p /workspace/out",
"files": [],
"network": {
"mode": "allowlist",
"allowed_hosts": [
"api.internal.example.com"
]
},
"resources": {
"cpu": 2,
"memory_mb": 4096,
"disk_mb": 10240
},
"timeouts": {
"command_seconds": 300,
"idle_minutes": 15,
"max_lifetime_minutes": 240
},
"env_vars": {
"TZ": "UTC"
},
"vault_secrets": [],
"build": {
"status": "ready",
"image_digest": "sha256:9f2c...",
"finished_at": "2026-11-04T08:12:40Z",
"error": null
},
"created_at": "2026-11-04T08:10:02Z",
"updated_at": "2026-11-04T08:10:02Z"
}Examples
curl -sS -X PATCH https://app.syntic.ai/v1/environments/env_01JC5B2D4F6H8K0M2P4R \
-H "Authorization: Bearer $SYNTIC_API_KEY" \
-H "syntic-beta: agents-2026-11-01" \
-H "Content-Type: application/json" \
-d '{
"network": {
"mode": "allowlist",
"allowed_hosts": [
"api.internal.example.com"
]
}
}'Errors
Errors use the error envelope and carry a request_id. Codes specific to this operation:
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request_error | beta_required | The syntic-beta header is missing. |
| 400 | invalid_request_error | unknown_base_image | base_image is not offered. |
| 400 | invalid_request_error | resource_out_of_range | A resource or timeout is outside its range. |
| 400 | invalid_request_error | invalid_host_pattern | An allowed_hosts entry is not a host or *. wildcard. |
| 404 | not_found_error | environment_not_found | No environment with that id in this workspace. |
| 401 | authentication_error | invalid_api_key | The key is missing, unknown, revoked or expired. |
| 429 | rate_limit_error | rate_limited | Too many requests; wait for Retry-After. See Rate-limit headers. |
Related
Was this page helpful?