# EditRequest

Request for editing a file with one or more operations. Supports find/replace, line-range edits, insertions, and deletions. Designed for AI agents that need to modify files programmatically.

**Kind:** an object, used in requests.

## Fields

| Field | Type | Required | Description |
|---|---|---|---|
| `path` | `string` |  | Path to the file within the file system. |
| `operations` | [`EditOperation`](https://docs.maitento.com/reference/types/edit-operation.md)`[]` |  | List of edit operations to apply, in order. |

## Example

```json
{
  "path": "...",
  "operations": [
    {
      "type": "...",
      "find": "...",
      "replace": "...",
      "replaceAll": false,
      "startLine": 0,
      "endLine": 0,
      "content": "...",
      "insertAfterLine": 0,
      "deleteLines": []
    }
  ]
}
```

## Where it's used

- [`vfs.open(name).edit`](https://docs.maitento.com/reference/api/vfs.md) (`POST /namespaces/{namespaceName}/vfs/by-name/{name}/files/edit`)
- [`vfs.openById(id).edit`](https://docs.maitento.com/reference/api/vfs.md) (`POST /vfs/by-id/{id}/files/edit`)
