Rename / move an attachment
POST
/attachments/rename
const url = 'https://api.engram.page/attachments/rename';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"new_path":"Archive/Engram.md","old_path":"Projects/Engram.md"}'};
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/rename \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "new_path": "Archive/Engram.md", "old_path": "Projects/Engram.md" }'Moves the attachment from old_path to new_path. Requires a plan with attachments enabled (402 otherwise). Returns 404 when the source is missing and 409 when the target path already exists.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Old + new path
Media typeapplication/json
RenameRequest
object
new_path
required
string
old_path
required
string
Example
{ "new_path": "Archive/Engram.md", "old_path": "Projects/Engram.md"}Responses
Section titled “Responses”Renamed
Media typeapplication/json
AttachmentRenameResponse
object
attachment
AttachmentMeta
object
created_at
string format: date-time
id
string format: uuid
mime_type
string
mtime
Client mtime (epoch seconds)
number format: float
path
required
string
size_bytes
integer
updated_at
string format: date-time
new_path
string
old_path
string
renamed
boolean
Example
{ "attachment": { "path": "assets/diagram.png" }}Attachments require a paid plan
No such attachment
Media typeapplication/json
MessageError
object
error
required
string
Example
{ "error": "not found"}Target exists
Media typeapplication/json
MessageError
object
error
required
string
Example
{ "error": "not found"}