Automatically do a files:scan on that specific file when a new file is added

That’s right, because this is the only case where Nextcloud is aware of file system changes. If you’re by-passing the Nextcloud gui you have to make sure that a file scan is triggered afterwards.