Upload a file to Files area via API?

I’m not aware of a way to upload files to the Files area via the API, but I don’t work for FreeAgent so that’s not definitive.

However you can use the API to upload files to bank transaction explanations (see the attachment attribute), which I presume is where you want the files to end up.

[Shameless plug] As it happens I have built something which allows you to forward supplier PDF receipts to an email address, from where they are attached to the appropriate explanation in your FreeAgent account. I use it for all my own supplier PDF receipts. If a receipt doesn’t have a PDF attachment, it converts the HTML email (or text if there’s no HTML part) to PDF using headless Chrome and uploads that.