---
title: "Rebuild Environment"
method: POST
path: "/api/v1/environments/{environment_id}/rebuild"
tags: ["environments"]
---

# Rebuild Environment

`POST /api/v1/environments/{environment_id}/rebuild`

## Request

- Base URL: `https://api.komos.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.komos.ai/api/v1/environments/{environment_id}/rebuild`
- Auth: none declared

Rebuild a persistent sandbox: delete the underlying Daytona box but
keep the env row, label, and task bindings. Next run creates a fresh box
from the current snapshot. State on disk is lost.

Refuses with 409 if a run is currently active (current_run_id set).

## Path parameters

- `environment_id` string, uuid, required

## Headers

- `Authorization` string, nullable
- `X-Org-Id` string, nullable

## Response `204`

Successful Response

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/komos/apis/komos-backend.md) · [All operations](https://skmtc.dev/komos/apis/komos-backend/llms.txt) · [OpenAPI document](https://skmtc.dev/komos/apis/komos-backend/revisions/f10e153fab38?raw)
