Skip to content

Move folders under a new parent (idempotent)

POST
/folders/batch-move
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.

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"
}

Moved count

Media typeapplication/json
MovedCount
object
moved
required
integer
Example
{
"moved": 3
}

Invalid input

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

Some ids not found

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

Conflict

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