Is there an API to pause a folder?

https://docs.syncthing.net/dev/rest.html

I do not see anything for pausing a folder?

What I am looking to do is add options Windows’s context menu to pause/unpause a folder? So, my thought:

  • User right clicks on a folder and selects SyncThings > Pause
  • Either an API is called directly or a script is called that calls the API

Would need to either:

  • Pause sharing based on a folder path
  • Lookup folder ID based on folder path and then pause based on folder ID

Is any of this possible? TIA!

The endpoint would be /rest/config/folders, and there could probably be an example for how to pause a folder there: Config Endpoints — Syncthing v1 documentation

You need to send a PATCH to /rest/config/folders/*id*, where you replace *id* with the id of your folder and as data payload you send {"paused": true}.

2 Likes