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

# Clear Environment Variables

> Remove all global environment variables from the sandbox using the HopX VM Agent API. Clear all environment variables to reset configuration or start fresh. Learn how to use DELETE /env endpoint to remove all variables at once. Includes request examples and cleanup best practices.

Remove all custom environment variables from the sandbox. System environment variables may be preserved.

<Warning>
  This removes ALL custom environment variables. This operation cannot be undone.
</Warning>

## Endpoint

```
DELETE /env
```

## Request

### Headers

```
Authorization: Bearer YOUR_JWT_TOKEN
```

### Example Request

```bash theme={null}
curl -X DELETE https://sandbox_abc123xyz.hopx.dev/env \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

## Response

### Success (204 No Content)

Empty response on success.

## Status Codes

| Code | Description                    |
| ---- | ------------------------------ |
| 204  | Variables cleared successfully |
| 401  | Unauthorized                   |

## Use Cases

### Reset Environment

```bash theme={null}
curl -X DELETE https://sandbox_abc123xyz.hopx.dev/env \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"
```

## Related

* **SDK**: [sandbox.env.clear()](/sdk/python/environment-variables#clear) - Python SDK method
* [CLI Environment Variables](/cli/commands/env) - Environment variables from CLI

## Next Steps

* **[Get Environment Variables](/api/vm-agent/get-env)** - View all variables
* **[Set Environment Variables](/api/vm-agent/set-env)** - Set new variables
