files_scripts icon indicating copy to clipboard operation
files_scripts copied to clipboard

How do I invoke a file action via HTTP API?

Open Rudd-O opened this issue 7 months ago • 0 comments

I've created a file action that looks into a subfolder of an external mount in my user name space, lists all files in that subfolder, and moves them all to a shared folder that my wife can see. Think "scanner drops off receipts into a SAMBA share, Nextcloud feeds them into a queue of receipts to go over".

I've also noticed that I can't use Flow with files in external mounts. No matter what I do, the File created and File updated triggers in Flow do not trigger my file action, even when manually scanning the external mounts using occ.

Regrettably, that leaves me with only one way to trigger the file action, which is remotely via HTTPS. My hope is to (1) tell Nextcloud to refresh the external mount (2) tell Nextcloud to run my file action against all files in that subfolder. This would also be convenient since my Home Assistant instance already gets notified when files on the share in question are changed, so from there to making an HTTP call to Nextcloud is but a trivial thing.

Except I can't find a way to do this! The OCS v2 API has no endpoint for files_scripts. The documentation does not explain anything remotely in line with what I'm trying to do.

How should I proceed then?

Rudd-O avatar May 21 '25 17:05 Rudd-O