Skip to content

Discard Document Draft

Reset the draft version counters to the root document version and restore the legacy draft doc field from the root record. Requires authentication, the DOCUMENTS feature flag, and ADMIN, UPDATE_DOCUMENT, or MANAGE_DOCUMENTS permissions.

Parameters

name * are required parametersdata typedescription
documentId*stringThe unique identifier of the document.
body.updatedAtnumberCurrent draft update timestamp in milliseconds. Optional in handler validation, but required to match whenever the stored draft has an updatedAt value.

Use the actual draft timestamp in the request. A missing or stale timestamp is rejected with HTTP 400 when the draft has an updatedAt value. Externally managed and removed documents are also rejected.

The current implementation updates draftVersion and timestamps on the root, draft, and metadata entry, and restores or deletes the draft doc field. It does not restore docString, file fields, metadata, comments, or workflow state. This operation is not a complete content rollback.

Return Value

HTTP 201 Created. The JSON body is:

json
{
  "message": "Successfully discarded the draft document",
  "data": null
}

Examples

bash
curl -X POST "https://app.wombat.software/api/{targetPath}/document/:documentId/discard-draft" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ..." \
  -d '{"updatedAt": 1789380000000}'

ENDPOINTS

post/api/{targetPath}/document/:documentId/discard-draft