Multiple clients ask these questions about emails but the information on salesforce documentation is limited or ambiguous.
I will provide here an idea base on what I read but I was not able to test this so I’m not able to guarantee this.
Please check this movie where I explain step by step via REST API how to upload and assign a file to Salesforce.
In this movie, at time 8:19 I show very well the Commands via REST API on the last command with ASSIGN FILE to CASE you need to provide on parameters LinkedEntityID you will provide Your EmailMessages ID instead of CASE ID.
That’s the only Idea that I have based on what I read on the internet. Please tell us what you configure in SalesForce for AddEmail Activity to work. (To be more direct a lot of people say that this activity just add Email on the database of Salesforce and on the webpage but don’t see the actual email and I don’t know what special setting you need to do in salesforce for this)