---
title: "Rename a document"
method: PATCH
path: "/workspaces/{workspaceId}/documents/{documentId}"
tags: ["Workspace"]
---

# Rename a document

`PATCH /workspaces/{workspaceId}/documents/{documentId}`

DB-only rename — re-slugs the basename from `name` while preserving
the directory prefix and extension; the document id is stable. A
collision with another live document at the derived path →
`409 DOCUMENT_PATH_TAKEN`.

## Request body

- object
  - `name` string, required

## Response `200`

The renamed document summary.

- DocumentSummary
  - `object` 'document', required
  - `id` string, uuid, required
  - `documentId` string, uuid, required — Legacy alias of `id` — kept for pre-restructure consumers.
  - `filename` string, required — Last segment of the VFS path — the user-facing filename.
  - `vfsPath` string, required
  - `kind` string, required
  - `status` string, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `404` — DOCUMENT_NOT_FOUND.
- `409` — DOCUMENT_PATH_TAKEN.

---

[API](https://skmtc.net/origami/apis/origami-agent-api.md) · [All operations](https://skmtc.net/origami/apis/origami-agent-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/origami/origami-agent-api/versions/8083ad7fe081/schema)
