Skip to content

Rename / move a folder

POST
/folders/rename
curl --request POST \
--url https://api.engram.page/folders/rename \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "new_path": "Archive/Engram.md", "old_path": "Projects/Engram.md" }'

Renames or moves a folder from old_path to new_path, re-homing every note beneath it, and returns the affected note count. Returns 404 when the source folder does not exist and 409 when the target path is already occupied.

Old + new path

Media typeapplication/json
RenameRequest
object
new_path
required
string
old_path
required
string
Example
{
"new_path": "Archive/Engram.md",
"old_path": "Projects/Engram.md"
}

Renamed

Media typeapplication/json
FolderRenameResponse
object
count
integer
new_path
string
old_path
string
renamed
boolean
Examplegenerated
{
"count": 1,
"new_path": "example",
"old_path": "example",
"renamed": true
}

No such folder

Media typeapplication/json
Error
object
errors
One of:
string
Examplegenerated
{
"errors": {}
}

Target exists

Media typeapplication/json
Error
object
errors
One of:
string
Examplegenerated
{
"errors": {}
}