Move attachments to a folder (idempotent)
POST
/attachments/batch-move
const url = 'https://api.engram.page/attachments/batch-move';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"paths":["assets/diagram.png","assets/logo.svg"],"target_folder":"archive/assets"}'};
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/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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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"}Responses
Section titled “Responses”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
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"}