Appearance
Duplicate Document
Create a new draft from the root record of a published document. Unpublished draft edits are not copied. Requires authentication, the DOCUMENTS feature flag, and ADMIN, CREATE_DOCUMENT, or MANAGE_DOCUMENTS permissions.
Parameters
| name * are required parameters | data type | description |
|---|---|---|
documentId* | string | The unique identifier of the document. |
No request body is used. The source must exist and have a publishedAt value; otherwise the request returns HTTP 400. The organization-only target (organization/:orgId) is rejected with HTTP 400 because this handler requires a tenant ID for organization targets.
The copy retains the root title (with the prefix), description, folder flag, file path, parent ID, editor content, and links. It receives fresh metadata and comments; ACL rules, workflow customizations, acknowledgment settings, distribution settings, and version history are not copied. File paths are reused, rather than creating a new storage file.
Return Value
HTTP 201 Created. The JSON body contains:
| field | data type | description |
|---|---|---|
message | string | Successfully duplicated the document |
data | DocumentObject | The new draft document with a new id, title prefixed with COPY - , state: "draft", version: 0, and draftVersion: 1. |
Examples
bash
curl -X POST "https://app.wombat.software/api/{targetPath}/document/:documentId/duplicate" \
-H "Authorization: Bearer ..."ENDPOINTS
post
/api/{targetPath}/document/:documentId/duplicate