Delete attachments by path (idempotent)
POST
/attachments/batch-delete
const url = 'https://api.engram.page/attachments/batch-delete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"paths":["assets/diagram.png","assets/old-logo.svg"]}'};
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-delete \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "paths": [ "assets/diagram.png", "assets/old-logo.svg" ] }'Deletes multiple attachments by path and returns the deleted count. Deliberately not billing-gated so a downgraded user can always clean up. Requires the X-Idempotency-Key header for safe retries.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Paths
Media typeapplication/json
AttachmentBatchDeleteRequest
object
paths
required
Array<string>
Example
{ "paths": [ "assets/diagram.png", "assets/old-logo.svg" ]}Responses
Section titled “Responses”Deleted count
Media typeapplication/json
DeletedCount
object
deleted
required
integer
Example
{ "deleted": 3}Missing paths
Media typeapplication/json
MessageError
object
error
required
string
Example
{ "error": "not found"}