# Remove (/docs/api-reference/filesystem/remove)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 655 · updated: 2026-07-30 -->
Related: [Download a file](/docs/api-reference/filesystem/download-a-file.md), [Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten.](/docs/api-reference/filesystem/upload-a-file-and-ensure-the-parent-directories-exist-if-the-file-exists-it-will-be-overwritten.md), [CreateWatcher](/docs/api-reference/filesystem/createwatcher.md), [GetWatcherEvents](/docs/api-reference/filesystem/getwatcherevents.md), [ListDir](/docs/api-reference/filesystem/listdir.md), [MakeDir](/docs/api-reference/filesystem/makedir.md)

# Remove

`POST /filesystem.Filesystem/Remove`

Remove

## OpenAPI

```json
{
  "security": [
    {
      "SandboxAccessTokenAuth": [],
      "SandboxUserAuth": []
    }
  ],
  "parameters": [
    {
      "name": "E2b-Sandbox-Id",
      "in": "header",
      "required": true,
      "description": "Identifier of the target sandbox. Routes the request to that sandbox's envd over the shared sandbox host.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "E2b-Sandbox-Port",
      "in": "header",
      "required": true,
      "description": "Port envd listens on inside the sandbox (default 49983).",
      "schema": {
        "type": "integer",
        "default": 49983
      }
    },
    {
      "name": "Connect-Protocol-Version",
      "in": "header",
      "required": true,
      "schema": {
        "type": "number",
        "title": "Connect-Protocol-Version",
        "description": "Define the version of the Connect protocol",
        "const": 1
      }
    },
    {
      "name": "Connect-Timeout-Ms",
      "in": "header",
      "schema": {
        "type": "number",
        "title": "Connect-Timeout-Ms",
        "description": "Define the timeout, in ms"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "path": {
              "type": "string",
              "title": "path"
            }
          },
          "title": "RemoveRequest",
          "additionalProperties": false
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "title": "RemoveResponse",
            "additionalProperties": false
          }
        }
      }
    },
    "502": {
      "description": "Sandbox not found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "sandboxID",
              "message",
              "code"
            ],
            "properties": {
              "message": {
                "type": "string",
                "description": "Error message"
              },
              "code": {
                "type": "integer",
                "description": "Error code"
              },
              "sandboxID": {
                "type": "string",
                "description": "Identifier of the sandbox"
              }
            }
          }
        }
      }
    }
  }
}
```
