Move folders under a new parent (idempotent)
POST
/folders/batch-move
const url = 'https://api.engram.page/folders/batch-move';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ids":["3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f","4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f90"],"target_parent_id":"root"}'};
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/batch-move \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ids": [ "3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f", "4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f90" ], "target_parent_id": "root" }'Re-parents multiple folders under target_parent_id (or the literal "root" for top level) in one transaction and returns the moved count. Requires the X-Idempotency-Key header. Returns 404 for a missing id and 409 (with item_id) on a conflict or a cycle.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Ids + target parent
Media typeapplication/json
BatchMoveFoldersRequest
object
ids
required
Array<string>
target_parent
Destination parent folder path (alternative to target_parent_id; “” = top level). Use this to re-parent under a derived folder that has no marker.
string
target_parent_id
Parent folder UUID or “root”.
string
Example
{ "ids": [ "3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f", "4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f90" ], "target_parent_id": "root"}Responses
Section titled “Responses”Moved count
Media typeapplication/json
MovedCount
object
moved
required
integer
Example
{ "moved": 3}Invalid input
Some ids not found
Conflict