Skip to content

Rename / move an attachment

POST
/attachments/rename
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.

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

Renamed

Media typeapplication/json
AttachmentRenameResponse
object
attachment
AttachmentMeta
object
created_at
string format: date-time
nullable
id
string format: uuid
nullable
mime_type
string
nullable
mtime

Client mtime (epoch seconds)

number format: float
path
required
string
size_bytes
integer
updated_at
string format: date-time
nullable
new_path
string
old_path
string
renamed
boolean
Example
{
"attachment": {
"path": "assets/diagram.png"
}
}

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

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