Mail Merge fails on the email stage with error code 1003 when called via API

Mail Merge fails on the email stage with error code 1003 when called via API

I am trying to create an automated Mail Merge that executes when a specific field in a Zoho CRM record is updated. The mail merge attaches the merged All goes well until it reaches the email stage and gives me an error 1003 on the progress page. The file is properly filled in with the merge fields and I can download it from the URL in the response. 

I can supply the code if that would help, I am using this documentation - https://www.zoho.com/writer/help/api/v1/to-send-merge-document-as-attachment-via-email.html

I have provided a screenshot of the error.