Dynamically Add Folders in Syncthing

When I add a new folder via GUI it gives me a unique ID automatically

But to add a folder via API call post request I need to give my own unique ID Config Endpoints β€” Syncthing documentation

I want to use dynamically generated ID provided by syncthing so that I dont need to be worried about conflict. Is there a way to extract a unique ID for adding a given folder.

You can in fact ask Syncthing for a random string, but you can also just generate one yourself. The GUI assigns new folder IDs by asking for a random string and inserting a dash. Unless you have exceptional requirements you don’t really need to worry about a conflict, but if you do then you can look at the existing folders before adding a new one.

2 Likes