# Automating synthing functions (add device, folder, etc...)

**URL:** https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936
**Category:** Support
**Created:** [May 4, 2020, 1:28pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936 "2020-05-04T13:28:49Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![rogerAppleby](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rogerAppleby](https://forum.syncthing.net/u/rogerAppleby)
#### Post date: [May 4, 2020, 1:28pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/1 "2020-05-04T13:28:49Z")

</div>

I want to automatically add devices and folders. We use secure messaging and want to request additions and automatically add them. I know the system config - but the GUI must use something different. Can you enlighten me on how this can be done?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [May 4, 2020, 1:34pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/2 "2020-05-04T13:34:29Z")

</div>

The GUI uses the system/config endpoint.

---

<div class="post-metadata">

### Author: ![rogerAppleby](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rogerAppleby](https://forum.syncthing.net/u/rogerAppleby)
#### Post date: [May 4, 2020, 2:56pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/3 "2020-05-04T14:56:19Z")

</div>

so basically we have to load the entire config file make the updates and post them back out?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [May 4, 2020, 2:59pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/4 "2020-05-04T14:59:15Z")

</div>

Yep

---

<div class="post-metadata">

### Author: ![rogerAppleby](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rogerAppleby](https://forum.syncthing.net/u/rogerAppleby)
#### Post date: [May 4, 2020, 3:22pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/5 "2020-05-04T15:22:26Z")

</div>

This may be stupid - but can we pause syncthing - directly read and write the config - then continue? or do we need to use the api to rewrite it?

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [May 4, 2020, 3:23pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/6 "2020-05-04T15:23:00Z")

</div>

You can of course change the config file after shutting down syncthing, but doing it via the API is generally preferable.

---

<div class="post-metadata">

### Author: ![rogerAppleby](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rogerAppleby](https://forum.syncthing.net/u/rogerAppleby)
#### Post date: [May 4, 2020, 3:24pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/7 "2020-05-04T15:24:16Z")

</div>

by using the api - will syncthing recognize the changes immediately

---

<div class="post-metadata">

### Author: ![rogerAppleby](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/r/df788c/32.png) [@rogerAppleby](https://forum.syncthing.net/u/rogerAppleby)
#### Post date: [May 4, 2020, 3:39pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/8 "2020-05-04T15:39:36Z")

</div>

never mind - it was in the documentation - Thanks for your help

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [June 3, 2020, 3:54pm UTC](https://forum.syncthing.net/t/automating-synthing-functions-add-device-folder-etc/14936/9 "2020-06-03T15:54:08Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
