> For the complete documentation index, see [llms.txt](https://docs.ibexa.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ibexa.ai/developers/rest-api/knowledge-base/discard-document-draft.md).

# Discard Document Draft

Discard an unpublished draft version without publishing it.

Deletes the draft and any chunks staged under it. 400 if the version is not an editable draft (published/archived versions cannot be discarded); 404 if the node or version does not exist in the caller's organisation.

```json
{"openapi":"3.1.0","info":{"title":"Ibexa Agentic Marketing Platform","version":"0.1.0"},"security":[{"OAuth2PasswordBearer":[]}],"components":{"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/v1/login/access-token"}}}}},"paths":{"/api/v1/knowledge-base/nodes/{node_id}/versions/{version_id}":{"delete":{"tags":["knowledge-base","public"],"summary":"Discard Document Draft","description":"Discard an unpublished draft version without publishing it.\n\nDeletes the draft and any chunks staged under it. 400 if the version is not\nan editable draft (published/archived versions cannot be discarded); 404 if\nthe node or version does not exist in the caller's organisation.","operationId":"knowledge-base-discard_document_draft","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"integer","title":"Node Id"}},{"name":"version_id","in":"path","required":true,"schema":{"type":"integer","title":"Version Id"}}],"responses":{"204":{"description":"Successful Response"},"400":{"description":"Invalid request payload or parameters","content":{"application/json":{}}},"401":{"description":"User not authenticated","content":{"application/json":{}}},"403":{"description":"User lacks permission","content":{"application/json":{}}},"404":{"description":"Resource not found or user has no permission to access it","content":{"application/json":{}}}}}}}}
```
