Skip to main content
POST
/
api
/
editor
/
insert
Insert Text
curl --request POST \
  --url http://localhost:4242/{computer_name}/api/editor/insert \
  --header 'Content-Type: application/json' \
  --data '
{
  "insert_line": 5,
  "path": "/path/to/file.txt",
  "text": "New line of text"
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Body

application/json
path
string
required

File path to modify

Example:

"/path/to/file.txt"

text
string
required

Text to insert

Example:

"New line of text"

insert_line
integer | null

Line number to insert at (1-based)

Example:

5

Response

Successfully inserted text