Rebuild an environment
⚠️
Preview — this feature is being built; the design below is the spec.
POST https://app.syntic.ai/v1/environments/{environment_id}/rebuildBuild 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
| 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 |
Idempotency-Key | No | Up to 255 characters. Retrying with the same key within 24 hours returns the first result instead of acting twice. See Idempotency. |
Path parameters
| Parameter | Type | Description |
|---|---|---|
environment_id | string | The environment id, starting with env_. |
Body parameters
| Parameter | Type | Required | Notes |
|---|---|---|---|
no_cache | boolean | No | Default 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
}
}| Field | Type | Description |
|---|---|---|
build.status | string | queued, building, succeeded or failed. Poll the environment or read the build log. |
build.previous_image_digest | string | The 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:
| Status | type | code | When |
|---|---|---|---|
| 400 | invalid_request_error | beta_required | The syntic-beta header is missing. |
| 409 | conflict_error | build_in_progress | A build is already queued or running. |
| 404 | not_found_error | environment_not_found | No environment with this id in the key’s 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. |
Was this page helpful?