Headless: accept all changes in writer document

Hi all,

I am trying to find a solution to accept all changes in a writer document in a headless system.
I totally new to using libreoffice in headless. This is a server project, where I want to store two versions of documents, one with changes and an automatic copy without changes.

It would also help to print a PDF without changes showing.

Is there a way to achieve this?

Thanks!