In plugin version 5.0+, the default PATCH format changed from header-based instructions to a single JSON body.
1.x Format (Deprecated): Uses headers like Operation, Target-Type, and Target with a text/markdown body.
2.x Format (Default): Uses a JSON body with application/json content-type.
Key Field Mappings:
Operation: append $\rightarrow$ "operation": "append" (also supports "delete")Target-Type: heading $\rightarrow$ "targetType": "heading"Target: A::B $\rightarrow$ "target": ["A", "B"] (an array, no delimiter needed)Target-Scope: content $\rightarrow$ "scope": "content" (also supports "parent" for moves)- Body (
text/markdown) $\rightarrow$ "content": "..." - Body (
application/json) $\rightarrow$ "value": <json> Create-Target-If-Missing: true $\rightarrow$ "createTargetIfMissing": trueReject-If-Content-Preexists: true $\rightarrow$ "rejectIfContentPreexists": true
Important Changes:
- Heading Targets: Must be arrays (e.g.,
["Heading 1", "Subheading 1:1"]). - Renaming Headings: Use
"scope": "marker" with "content": "New Name". Do not include # characters in the content; they will be treated as literal text. - Frontmatter: Values must be sent as typed JSON in the
"value" field (e.g., a list, dict, number, or string).
# After (2.x) Default
curl -k -X PATCH \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
--data '{"targetType": "heading", "target": ["Heading 1", "Subheading 1:1"], "operation": "append", "content": "Hello"}' \
"https://127.0.0.1:27124/vault/note.md"