Skip to content

syncthing

get folder label and id

this will create an output like this: my-folder: foo-id

curl -s -H "Authorization: Bearer your-api-key-here" https://syncthing.example.com/rest/config | jq -r '.folders[] | "\(.label): \(.id)"'

pause / resume folder sync

I use this with home-assistant to pause/resume folder syncing to avoid starting up my NAS drives when syncthing does a rescan. Replace your-folderID at the end of the url with the ID of your folder (see get folder label and id)

pause syncthing:

curl -s -H "Authorization: Bearer your-api-key-here" -H "content-type: application/json" -X PATCH -d '{"paused": true}' https://syncthing.example.com/rest/config/folders/your-folderID

resume syncthing:

curl -s -H "Authorization: Bearer your-api-key-here" -H "content-type: application/json" -X PATCH -d '{"paused": false}' https://syncthing.example.com/rest/config/folders/your-folderID