Skip to content

Apply a str_replace patch to a note

POST
/notes/{query}/patch
curl --request POST \
--url http://127.0.0.1:7677/notes/example/patch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "old_str": "example", "new_str": "example" }'

Replaces old_str with new_str in the note’s content. old_str must appear exactly once in the current content; use an empty new_str to delete text.

query
required
string

Full UUID, 8+ char UUID prefix, or filename

Media type application/json
object
old_str
required
string
new_str
required
string
Example generated
{
"old_str": "example",
"new_str": "example"
}

Patched note

Media type application/json
object
data
object
id
required
string format: uuid
title
required
string
description
string
tags
required
Array<string>
type
required
string
Allowed values: user feedback project reference knowledge snippet file
repository
string
created
required
string format: date-time
updated
required
string format: date-time
content
required

Markdown body

string
filePath
required

Absolute path on the server’s filesystem

string
Example
{
"data": {
"type": "user"
}
}

Malformed request

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

Note not found

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}