When generating a document, the data needs to be posted as FormData: https://www.docugenerate.com/help/articles/why-use-the-multipartform-data-content-type/
It would be useful to also be able to post the data as JSON (with the content type "application/json").