---
title: "Edit File"
method: PATCH
path: "/api/workspace/file"
tags: ["workspace-editor"]
---

# Edit File

`PATCH /api/workspace/file`

REST fallback: Edit file with search/replace.

## Query parameters

- `path` string, required

## Request body

- FileEdit
  - `old_text` string, required
  - `new_text` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/deeptrace/apis/fastapi.md) · [All operations](https://skmtc.net/deeptrace/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deeptrace/fastapi/versions/2e2a6de8aeda/schema)
