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

HeaderRequiredValue
AuthorizationYesBearer <key>: a private inference key (sk_live_...). See Authentication.
syntic-betaYes, while in previewagents-2026-11-01. Without it the call fails with 400 beta_required. See Versioning.
Content-TypeYesapplication/json

Path parameters

ParameterTypeDescription
environment_idstringThe environment id, starting with env_.

Body parameters

ParameterTypeRequiredNotes
namestringNoUnique in the workspace, up to 64 characters.
base_imagestringNosyntic/base (default), syntic/python:3.12, syntic/node:22 or syntic/full.
packagesobjectNoapt, pip and npm lists; up to 200 packages in total. Pin versions for repeatable builds.
setup_scriptstringNoShell run once at build time, up to 16 KB.
filesarrayNo{file_id, path} copied in under /workspace; up to 50 files, 500 MB.
networkobjectNomode: none (default), allowlist with allowed_hosts, or open.
resourcesobjectNocpu 1-8, memory_mb 512-16384, disk_mb 1024-51200.
timeoutsobjectNocommand_seconds (max 3600), idle_minutes, max_lifetime_minutes (max 1440).
env_varsobjectNoPlain variables, readable through the API. Never secrets.
vault_secretsarrayNo{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:

StatustypecodeWhen
400invalid_request_errorbeta_requiredThe syntic-beta header is missing.
400invalid_request_errorunknown_base_imagebase_image is not offered.
400invalid_request_errorresource_out_of_rangeA resource or timeout is outside its range.
400invalid_request_errorinvalid_host_patternAn allowed_hosts entry is not a host or *. wildcard.
404not_found_errorenvironment_not_foundNo environment with that id in this workspace.
401authentication_errorinvalid_api_keyThe key is missing, unknown, revoked or expired.
429rate_limit_errorrate_limitedToo many requests; wait for Retry-After. See Rate-limit headers.
Was this page helpful?