> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gym.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reset Environment

> Reset the desktop environment to initial state

Resets the desktop environment to its initial state. Runs as a background task. Optionally accepts a new task configuration to initialize after reset.

## Request Body

<ParamField body="vm_id" type="string" required>
  VM identifier
</ParamField>

<ParamField body="task_config" type="object">
  Optional task configuration to initialize after reset
</ParamField>

## Response

<ResponseField name="status" type="string">
  Request status (`accepted`)
</ResponseField>

<ResponseField name="message" type="string">
  Status message
</ResponseField>

<ResponseField name="vm_id" type="string">
  VM identifier
</ResponseField>

<ResponseField name="task_id" type="string">
  Background task ID for status polling
</ResponseField>

<ResponseField name="status_url" type="string">
  URL to check task status
</ResponseField>

<RequestExample>
  ```bash Reset Only theme={null}
  curl -X POST "http://CONTROL_PLANE_IP:PORT/reset" \
    -H "Content-Type: application/json" \
    -d '{
      "vm_id": "vm-abc123"
    }'
  ```

  ```bash Reset with New Task theme={null}
  curl -X POST "http://CONTROL_PLANE_IP:PORT/reset" \
    -H "Content-Type: application/json" \
    -d '{
      "vm_id": "vm-abc123",
      "task_config": {
        "id": "task-002",
        "instruction": "New task instructions",
        "config": []
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response (202) theme={null}
  {
    "status": "accepted",
    "message": "Environment reset started",
    "vm_id": "vm-abc123",
    "task_id": "uuid-string",
    "status_url": "/task_status/uuid-string"
  }
  ```
</ResponseExample>
