When you generate a Document you might sometimes need to give it a specific name. To do so, you can provide the filename to use through the Document's meta-data:
{
"_filename":"some-custom-name.pdf"
}
When calling the API, this should be sent using the meta property of the Document: