Skip to content

Move attachments to a folder (idempotent)

POST
/attachments/batch-move
curl --request POST \
--url https://api.engram.page/attachments/batch-move \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "paths": [ "assets/diagram.png", "assets/logo.svg" ], "target_folder": "archive/assets" }'

Moves multiple attachments (by path) into target_folder and returns the moved count. Requires a plan with attachments enabled (402 otherwise) and the X-Idempotency-Key header. Returns 404/409 (with the offending item_path) if an item is missing or conflicts at the target.

Paths + target folder

Media typeapplication/json
AttachmentBatchMoveRequest
object
paths
required
Array<string>
target_folder
required
string
Example
{
"paths": [
"assets/diagram.png",
"assets/logo.svg"
],
"target_folder": "archive/assets"
}

Moved count

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

Missing params

Media typeapplication/json
MessageError
object
error
required
string
Example
{
"error": "not found"
}

Attachments require a paid plan

Media typeapplication/json
LimitError
object
current
integer
nullable
error
required
string
limit
One of:
integer
limit_key
string
nullable
reason
required
string
tier
string
nullable
upgrade_url
string
nullable
Example
{
"error": "limit_exceeded",
"limit_key": "vaults_cap",
"reason": "vaults_cap_exceeded",
"tier": "free"
}

An item was not found

Media typeapplication/json
BatchItemError
object
error
required
string
item_path
string
Example
{
"error": "conflict"
}

An item conflicts at target

Media typeapplication/json
BatchItemError
object
error
required
string
item_path
string
Example
{
"error": "conflict"
}