---
title: "Replace String"
method: POST
path: "/api/editor/str-replace"
tags: ["editor"]
---

# Replace String

`POST /api/editor/str-replace`

## Request

- Base URL: `http://localhost:4242/your-computer-name`
- URL: `http://localhost:4242/your-computer-name/api/editor/str-replace`
- Auth: none declared

Replaces all occurrences of a string in a file with a new string.

## Request body

- StrReplaceParams
  - `path` string, required: File path to modify
  - `old_str` string, required: String to replace
  - `new_str` string, required: Replacement string

## Response `204`

Successfully replaced string

## Other responses

- `404`: File not found
- `422`: Validation Error
- `500`: Internal server error

## Changes

- **2026-07-13** `5424450258fc`: 1 info
  - endpoint added
- **2025-01-13** `a2d864f3a8db`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/cuse-dev/apis/cuse-apps-api/changes/api/editor/str-replace/post.md)

---

[API](https://skmtc.dev/cuse-dev/apis/cuse-apps-api.md) - [All operations](https://skmtc.dev/cuse-dev/apis/cuse-apps-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cuse-dev/apis/cuse-apps-api/revisions/5424450258fc?raw)
