Duplicate Writing Document
POST /api/writing/documents/{document_id}/duplicate
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.
Parameters
Section titled β Parameters βPath Parameters
Section titled βPath Parameters β document_id
required
Document Id
Source document ID to copy
string
Source document ID to copy
Request Body
Section titled βRequest Body βResponses
Section titled β Responses β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>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context