While implementing a package for the complete REST API in R, I noted that there is an "Upload draft (form) attachment", but that the corresponding "Upload (published form) attachment" is missing.
It is not in the documentation. I tried the to be expected call
It was done this way to ensure that a media attachment change is coupled with a form version change. This makes it easier for clients to detect updates and makes it easier in analysis to know exactly what a data collector saw by tracking the version. The media attachments can have significant impact on the data collected. For example, a particular choice could have been omitted by a data collector deliberately or because it didn’t exist in the form version they were filling. Any form change, including a change in attachments, must happen at the draft stage.
A client could introduce a convenience wrapper that takes in a version and media file(s). It could create a draft, attach media, publish with the given version. A client could also use a version incrementing convention so a version doesn’t have to be manually specified.