Rename / move a folder
POST
/folders/rename
const url = 'https://api.engram.page/folders/rename';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"new_path":"Archive/Engram.md","old_path":"Projects/Engram.md"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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"}Responses
Section titled “Responses”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
Target exists