---
title: "Insert Text"
method: POST
path: "/api/editor/insert"
tags: ["editor"]
---

# Insert Text

`POST /api/editor/insert`

Inserts text at a specified line number in a file.

## Request body

- InsertParams
  - `path` string, required — File path to modify
  - `text` string, required — Text to insert
  - `insert_line` integer, nullable — Line number to insert at (1-based)

## Response `204`

Successfully inserted text

## 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

[Change history](https://skmtc.dev/cuse-dev/apis/fastapi/changes/api/editor/insert/post.md)

---

[API](https://skmtc.dev/cuse-dev/apis/fastapi.md) · [All operations](https://skmtc.dev/cuse-dev/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cuse-dev/fastapi/revisions/5424450258fc/schema)
