Rebuild an environment

⚠️
Preview — this feature is being built; the design below is the spec.
POST https://app.syntic.ai/v1/environments/{environment_id}/rebuild

Build the environment’s image again from its current definition. Use it to pick up new releases of unpinned packages or a refreshed base image. Sessions already running keep their old image; new sessions use the new one once build.status is succeeded.

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
Idempotency-KeyNoUp to 255 characters. Retrying with the same key within 24 hours returns the first result instead of acting twice. See Idempotency.

Path parameters

ParameterTypeDescription
environment_idstringThe environment id, starting with env_.

Body parameters

ParameterTypeRequiredNotes
no_cachebooleanNoDefault false. true skips cached layers so every package is downloaded again.

Response

202 Accepted, Content-Type: application/json

{
  "id": "env_01JC5B2D4F6H8K0M2P4R",
  "type": "environment",
  "name": "data-analysis",
  "build": {
    "status": "queued",
    "image_digest": null,
    "previous_image_digest": "sha256:91c2…e07a",
    "finished_at": null,
    "error": null
  }
}
FieldTypeDescription
build.statusstringqueued, building, succeeded or failed. Poll the environment or read the build log.
build.previous_image_digeststringThe image that stays in use if this build fails.

Examples

curl -sS "https://app.syntic.ai/v1/environments/env_01JC5B2D4F6H8K0M2P4R/rebuild" \
  -H "Authorization: Bearer $SYNTIC_API_KEY" \
  -H "syntic-beta: agents-2026-11-01" \
  -H "Idempotency-Key: 8d6f0c1e-4b2a-4a57-9f0e-2f1d3c4b5a69" \
  -H "Content-Type: application/json" \
  -d '{
      "no_cache": true
    }'

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.
409conflict_errorbuild_in_progressA build is already queued or running.
404not_found_errorenvironment_not_foundNo environment with this id in the key’s 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?