Skip to content

Duplicate Writing Document

POST
/api/writing/documents/{document_id}/duplicate

πŸ“‘ Create an independent copy of an existing document.

Unlike POST /documents/{id}/forks (which creates a fork branch with parent lineage so the user can compare/promote it later), duplicate produces a fresh standalone document with no relationship to the source β€” same content, same tags, same document_type, suffixed ” (Copy)” by default. The new document goes into the source’s folder when present.

Path Parameters:

  • document_id: Source document to copy.

Form Parameters:

  • new_title: Optional override for the new title. Defaults to "<source title> (Copy)".

Returns:

  • document_id: ID of the newly created copy.
  • message: Success confirmation.

Raises:

  • HTTPException 404: If the source document is not found, trashed, or belongs to a different project.
  • HTTPException 500: If duplication fails.
document_id
required
Document Id

Source document ID to copy

string

Source document ID to copy

Body_duplicate_writing_document_api_writing_documents__document_id__duplicate_post
object
new_title
Any of:
string

Successful Response

Response Duplicate Writing Document Api Writing Documents Document Id Duplicate Post
object
key
additional properties
string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object