Attach file using Rest API

I have a custom module built through module builder (file type).
Does anyone know how to attach file to a record belonging to the custom module using the Rest API.

I am able to attach files to the Document module via Rest API but not to any other custom module.
Is there something different that I should be doing?

I’ve been doing it as a set_entry call followed by a set revision call which fails. The custom module does not have any revision fields.