Unable to upload a document over the rest API

Situation
I have enabled the Rest API, have already been able to make calls to it (e.g. to retrieve patient information), but it is unclear how exactly to post a document over the API. I read this reference and I get that I need to pass on a reference to the file I want to upload (got it, put it in a temp folder on the EMR server), but I don’t get what the path reference is and find no information about it.
I tried this approach: http://emrtst.xxx.xxx/openemr/apis/default/api/patient/${data_patient_ss}/document&path=var/www/html/openemr/sites/default/documents/${data_patient_ss}&document=/HL7/IN/eid/${data_patient_ss}.jpg
So in conclusion: Rest API works, but how exactly does one upload a document?

OpenEMR Version
I’m using OpenEMR version 5.0.2

Browser:
I’m using: Chrome

Operating System
I’m using: UBUNTU 20.04 on server, Win10 on client

Logs
I checked the logs, but there is no info on the attempted document upload.