---
title: "Rename / move an attachment"
method: POST
path: "/api/attachments/rename"
tags: ["Attachments"]
---

# Rename / move an attachment

`POST /api/attachments/rename`

## Request

- Base URL: `https://api.engram.page`
- URL: `https://api.engram.page/api/attachments/rename`
- Auth: HTTP bearer

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.

## Request body

- RenameRequest
  - `new_path` string, required
  - `old_path` string, required

## Response `200`

Renamed

- AttachmentRenameResponse
  - `attachment` AttachmentMeta
    - `content_hash` string, nullable: Opaque content fingerprint. Stable for identical bytes and scoped to the owning account. Compare against a local copy to decide whether an upload is needed; re-uploading matching bytes is accepted but does no work.
    - `created_at` string, date-time, nullable
    - `id` string, uuid, nullable
    - `mime_type` string, nullable
    - `mtime` number, float: Client mtime (epoch seconds)
    - `path` string, required
    - `size_bytes` integer
    - `updated_at` string, date-time, nullable
  - `new_path` string
  - `old_path` string
  - `renamed` boolean

## Other responses

- `402`: Attachments require a paid plan
- `404`: No such attachment
- `409`: Target exists

---

[API](https://skmtc.dev/engram/apis/engram-api.md) · [All operations](https://skmtc.dev/engram/apis/engram-api/llms.txt) · [OpenAPI document](https://skmtc.dev/engram/apis/engram-api/revisions/8c4c2eec29dc?raw)
