SYNCTHING-REST-API(7)              Syncthing             SYNCTHING-REST-API(7)



NNAAMMEE
       syncthing-rest-api - REST API

       Syncthing  exposes  a REST interface over HTTP on the GUI port. This is
       used by the GUI (from Javascript) and can be used  by  other  processes
       wishing  to  control Syncthing. In most cases both the input and output
       data is in JSON format. The interface is subject to change.

AAPPII KKEEYY
       To use the REST API an API key must be set and used. The API key can be
       generated in the GUI, or set in the ccoonnffiigguurraattiioonn//gguuii//aappiikkeeyy element in
       the configuration file. To use an  API  key,  set  the  request  header
       XX--AAPPII--KKeeyy  to  the  API  key  value.  For  example,  ccuurrll  --XX  PPOOSSTT  --HH
       ""XX--AAPPII--KKeeyy::  aabbcc112233""  hhttttpp::////llooccaallhhoosstt::88338844//rreesstt//......  can  be  used  to
       invoke  with ccuurrll (add --kk flag when using HTTPS with a Syncthing gener‐
       ated or self signed certificate).

RREESSUULLTT PPAAGGIINNAATTIIOONN
       Some _G_E_T endpoints take optional ppaaggee and ppeerrppaaggee arguments for pagina‐
       tion.   No  more  than  ppeerrppaaggee (defaults to 65536 if not given) result
       entries are returned in an array.  To access further  entries,  passing
       the ppaaggee parameter will advance in the results by that many pages.  The
       actually used parameters are  always  returned  as  attributes  in  the
       response object.

SSYYSSTTEEMM EENNDDPPOOIINNTTSS
   GGEETT //rreesstt//ssyysstteemm//bbrroowwssee
       Returns  a  list of directories matching the path given by the optional
       parameter ccuurrrreenntt. The path can  use  _p_a_t_t_e_r_n_s  _a_s  _d_e_s_c_r_i_b_e_d  _i_n  _G_o_â_s
       _f_i_l_e_p_a_t_h  _p_a_c_k_a_g_e  <hhttttppss::////ppkkgg..ggoo..ddeevv//ppaatthh//ffiilleeppaatthh##MMaattcchh>. A â*â will
       always be appended to the given path (e.g. //ttmmpp// matches all its subdi‐
       rectories).  If  the option ccuurrrreenntt is not given, filesystem root paths
       are returned.

          $ curl -H "X-API-Key: yourkey" localhost:8384/rest/system/browse | json_pp
          [
              "/"
          ]

          $ curl -H "X-API-Key: yourkey" localhost:8384/rest/system/browse?current=/var/ | json_pp
          [
              "/var/backups/",
              "/var/cache/",
              "/var/lib/",
              "/var/local/",
              "/var/lock/",
              "/var/log/",
              "/var/mail/",
              "/var/opt/",
              "/var/run/",
              "/var/spool/",
              "/var/tmp/"
          ]

          $ curl -H "X-API-Key: yourkey" localhost:8384/rest/system/browse?current=/var/*o | json_pp
          [
              "/var/local/",
              "/var/lock/",
              "/var/log/",
              "/var/opt/",
              "/var/spool/"
          ]

   GGEETT //rreesstt//ssyysstteemm//ccoonnffiigg ((DDEEPPRREECCAATTEEDD))
       Deprecated since version v1.12.0: This endpoint still works  as  before
       but is deprecated. Use rest-config instead.


       Returns the current configuration.

          {
            "version": 35,
            "folders": [
              {
                "id": "default",
                "label": "Default Folder",
                "filesystemType": "basic",
                "path": "...",
                "type": "sendreceive",
                "devices": [
                  {
                    "deviceID": "...",
                    "introducedBy": "",
                    "encryptionPassword": ""
                  }
                ],
                "rescanIntervalS": 3600,
                "fsWatcherEnabled": true,
                "fsWatcherDelayS": 10,
                "ignorePerms": false,
                "autoNormalize": true,
                "minDiskFree": {
                  "value": 1,
                  "unit": "%"
                },
                "versioning": {
                  "type": "",
                  "params": {},
                  "cleanupIntervalS": 3600,
                  "fsPath": "",
                  "fsType": "basic"
                },
                "copiers": 0,
                "pullerMaxPendingKiB": 0,
                "hashers": 0,
                "order": "random",
                "ignoreDelete": false,
                "scanProgressIntervalS": 0,
                "pullerPauseS": 0,
                "maxConflicts": -1,
                "disableSparseFiles": false,
                "disableTempIndexes": false,
                "paused": false,
                "weakHashThresholdPct": 25,
                "markerName": ".stfolder",
                "copyOwnershipFromParent": false,
                "modTimeWindowS": 0,
                "maxConcurrentWrites": 2,
                "disableFsync": false,
                "blockPullOrder": "standard",
                "copyRangeMethod": "standard",
                "caseSensitiveFS": false,
                "junctionsAsDirs": true
              }
            ],
            "devices": [
              {
                "deviceID": "...",
                "name": "Laptop",
                "addresses": [
                  "dynamic",
                  "tcp://192.168.1.2:22000"
                ],
                "compression": "metadata",
                "certName": "",
                "introducer": false,
                "skipIntroductionRemovals": false,
                "introducedBy": "",
                "paused": false,
                "allowedNetworks": [],
                "autoAcceptFolders": false,
                "maxSendKbps": 0,
                "maxRecvKbps": 0,
                "ignoredFolders": [
                  {
                    "time": "2022-01-09T19:09:52Z",
                    "id": "br63e-wyhb7",
                    "label": "Foo"
                  }
                ],
                "maxRequestKiB": 0,
                "untrusted": false,
                "remoteGUIPort": 0
              }
            ],
            "gui": {
              "enabled": true,
              "address": "127.0.0.1:8384",
              "unixSocketPermissions": "",
              "user": "Username",
              "password": "$2a$10$ZFws69T4FlvWwsqeIwL.TOo5zOYqsa/.TxlUnsGYS.j3JvjFTmxo6",
              "authMode": "static",
              "useTLS": false,
              "apiKey": "k1dnz1Dd0rzTBjjFFh7CXPnrF12C49B1",
              "insecureAdminAccess": false,
              "theme": "default",
              "debugging": false,
              "insecureSkipHostcheck": false,
              "insecureAllowFrameLoading": false
            },
            "ldap": {
              "address": "",
              "bindDN": "",
              "transport": "plain",
              "insecureSkipVerify": false,
              "searchBaseDN": "",
              "searchFilter": ""
            },
            "options": {
              "listenAddresses": [
                "default"
              ],
              "globalAnnounceServers": [
                "default"
              ],
              "globalAnnounceEnabled": true,
              "localAnnounceEnabled": true,
              "localAnnouncePort": 21027,
              "localAnnounceMCAddr": "[ff12::8384]:21027",
              "maxSendKbps": 0,
              "maxRecvKbps": 0,
              "reconnectionIntervalS": 60,
              "relaysEnabled": true,
              "relayReconnectIntervalM": 10,
              "startBrowser": true,
              "natEnabled": true,
              "natLeaseMinutes": 60,
              "natRenewalMinutes": 30,
              "natTimeoutSeconds": 10,
              "urAccepted": 0,
              "urSeen": 0,
              "urUniqueId": "...",
              "urURL": "https://data.syncthing.net/newdata",
              "urPostInsecurely": false,
              "urInitialDelayS": 1800,
              "restartOnWakeup": true,
              "autoUpgradeIntervalH": 12,
              "upgradeToPreReleases": false,
              "keepTemporariesH": 24,
              "cacheIgnoredFiles": false,
              "progressUpdateIntervalS": 5,
              "limitBandwidthInLan": false,
              "minHomeDiskFree": {
                "value": 1,
                "unit": "%"
              },
              "releasesURL": "https://upgrades.syncthing.net/meta.json",
              "alwaysLocalNets": [],
              "overwriteRemoteDeviceNamesOnConnect": false,
              "tempIndexMinBlocks": 10,
              "unackedNotificationIDs": [
                "authenticationUserAndPassword"
              ],
              "trafficClass": 0,
              "setLowPriority": true,
              "maxFolderConcurrency": 0,
              "crURL": "https://crash.syncthing.net/newcrash",
              "crashReportingEnabled": true,
              "stunKeepaliveStartS": 180,
              "stunKeepaliveMinS": 20,
              "stunServers": [
                "default"
              ],
              "databaseTuning": "auto",
              "maxConcurrentIncomingRequestKiB": 0,
              "announceLANAddresses": true,
              "sendFullIndexOnUpgrade": false,
              "featureFlags": [],
              "connectionLimitEnough": 0,
              "connectionLimitMax": 0,
              "insecureAllowOldTLSVersions": false
            },
            "remoteIgnoredDevices": [
              {
                "time": "2022-01-09T20:02:01Z",
                "deviceID": "...",
                "name": "...",
                "address": "192.168.0.20:22000"
              }
            ],
            "defaults": {
              "folder": {
                "id": "",
                "label": "",
                "filesystemType": "basic",
                "path": "~",
                "type": "sendreceive",
                "devices": [
                  {
                    "deviceID": "...",
                    "introducedBy": "",
                    "encryptionPassword": ""
                  }
                ],
                "rescanIntervalS": 3600,
                "fsWatcherEnabled": true,
                "fsWatcherDelayS": 10,
                "ignorePerms": false,
                "autoNormalize": true,
                "minDiskFree": {
                  "value": 1,
                  "unit": "%"
                },
                "versioning": {
                  "type": "",
                  "params": {},
                  "cleanupIntervalS": 3600,
                  "fsPath": "",
                  "fsType": "basic"
                },
                "copiers": 0,
                "pullerMaxPendingKiB": 0,
                "hashers": 0,
                "order": "random",
                "ignoreDelete": false,
                "scanProgressIntervalS": 0,
                "pullerPauseS": 0,
                "maxConflicts": 10,
                "disableSparseFiles": false,
                "disableTempIndexes": false,
                "paused": false,
                "weakHashThresholdPct": 25,
                "markerName": ".stfolder",
                "copyOwnershipFromParent": false,
                "modTimeWindowS": 0,
                "maxConcurrentWrites": 2,
                "disableFsync": false,
                "blockPullOrder": "standard",
                "copyRangeMethod": "standard",
                "caseSensitiveFS": false,
                "junctionsAsDirs": false
              },
              "device": {
                "deviceID": "",
                "name": "",
                "addresses": [
                  "dynamic"
                ],
                "compression": "metadata",
                "certName": "",
                "introducer": false,
                "skipIntroductionRemovals": false,
                "introducedBy": "",
                "paused": false,
                "allowedNetworks": [],
                "autoAcceptFolders": false,
                "maxSendKbps": 0,
                "maxRecvKbps": 0,
                "ignoredFolders": [],
                "maxRequestKiB": 0,
                "untrusted": false,
                "remoteGUIPort": 0
              }
            }
          }

   GGEETT //rreesstt//ssyysstteemm//ccoonnffiigg//iinnssyynncc ((DDEEPPRREECCAATTEEDD))
       Deprecated  since  version v1.12.0: This endpoint still works as before
       but is deprecated. Use rest-config-insync instead.


       Returns whether the config is in sync, i.e. whether the running config‐
       uration is the same as that on disk.

          {
            "configInSync": true
          }

   PPOOSSTT //rreesstt//ssyysstteemm//ccoonnffiigg ((DDEEPPRREECCAATTEEDD))
       Deprecated  since  version v1.12.0: This endpoint still works as before
       but is deprecated.  Use config instead.


       Post the full contents of the configuration,  in  the  same  format  as
       returned  by the corresponding GET request. When posting the configura‐
       tion succeeds, the posted configuration is immediately applied,  except
       for  changes  that require a restart. Query rest-config-insync to check
       if a restart is required.

       This endpoint is the main point  to  control  Syncthing,  even  if  the
       change  only  concerns a very small part of the config: The usual work‐
       flow is to get the config, modify the needed parts and post it again.

   GGEETT //rreesstt//ssyysstteemm//ccoonnnneeccttiioonnss
       NNOOTTEE::
          Return format changed in versions 0.13.0 and 1.19.0.

       Returns the list of configured devices  and  some  metadata  associated
       with  them.  The list also contains the local device itself as not con‐
       nected.

       The connection types are TTCCPP ((CClliieenntt)), TTCCPP ((SSeerrvveerr)), RReellaayy ((CClliieenntt)) and
       RReellaayy ((SSeerrvveerr)).

          {
             "total" : {
                    "at" : "2015-11-07T17:29:47.691637262+01:00",
                    "inBytesTotal" : 1479,
                    "outBytesTotal" : 1318,
             },
             "connections" : {
                    "YZJBJFX-RDBL7WY-6ZGKJ2D-4MJB4E7-ZATSDUY-LD6Y3L3-MLFUYWE-AEMXJAC" : {
                       "connected" : true,
                       "inBytesTotal" : 556,
                       "paused" : false,
                       "at" : "2015-11-07T17:29:47.691548971+01:00",
                       "startedAt" : "2015-11-07T00:09:47Z",
                       "clientVersion" : "v0.12.1",
                       "address" : "127.0.0.1:22002",
                       "type" : "TCP (Client)",
                       "outBytesTotal" : 550
                    },
                    "DOVII4U-SQEEESM-VZ2CVTC-CJM4YN5-QNV7DCU-5U3ASRL-YVFG6TH-W5DV5AA" : {
                       "outBytesTotal" : 0,
                       "type" : "",
                       "address" : "",
                       "at" : "0001-01-01T00:00:00Z",
                       "startedAt" : "0001-01-01T00:00:00Z",
                       "clientVersion" : "",
                       "paused" : false,
                       "inBytesTotal" : 0,
                       "connected" : false
                    },
                    "UYGDMA4-TPHOFO5-2VQYDCC-7CWX7XW-INZINQT-LE4B42N-4JUZTSM-IWCSXA4" : {
                       "address" : "",
                       "type" : "",
                       "outBytesTotal" : 0,
                       "connected" : false,
                       "inBytesTotal" : 0,
                       "paused" : false,
                       "at" : "0001-01-01T00:00:00Z",
                       "startedAt" : "0001-01-01T00:00:00Z",
                       "clientVersion" : ""
                    }
             }
          }

   GGEETT //rreesstt//ssyysstteemm//ddeebbuugg
       New in version 0.12.0.


       Returns  the  set  of  debug facilities and which of them are currently
       enabled.

          {
            "enabled": [
              "beacon"
            ],
            "facilities": {
              "beacon": "Multicast and broadcast discovery",
              "config": "Configuration loading and saving",
              "connections": "Connection handling",
              "db": "The database layer",
              "dialer": "Dialing connections",
              "discover": "Remote device discovery",
              "events": "Event generation and logging",
              "http": "REST API",
              "main": "Main package",
              "model": "The root hub",
              "protocol": "The BEP protocol",
              "relay": "Relay connection handling",
              "scanner": "File change detection and hashing",
              "stats": "Persistent device and folder statistics",
              "sync": "Mutexes",
              "upgrade": "Binary upgrades",
              "upnp": "UPnP discovery and port mapping",
              "versioner": "File versioning"
            }
          }

   PPOOSSTT //rreesstt//ssyysstteemm//ddeebbuugg
       New in version 0.12.0.


       Enables or disables debugging for specified  facilities.  Give  one  or
       both  of  eennaabbllee  and  ddiissaabbllee  query  parameters, with comma separated
       facility names. To disable debugging of the beacon and discovery  pack‐
       ages, and enable it for config and db:

          $ curl -H X-API-Key:abc123 -X POST 'http://localhost:8384/rest/system/debug?disable=beacon,discovery&enable=config,db'

   GGEETT //rreesstt//ssyysstteemm//ddiissccoovveerryy
       Returns the contents of the local discovery cache.

          {
            "LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q": [
              "192.162.129.11:22000"
            ]
          }

   PPOOSSTT //rreesstt//ssyysstteemm//ddiissccoovveerryy
       NNOOTTEE::
          Removed in v0.12.0.

       Post  with  the  query parameters ddeevviiccee and aaddddrr to add entries to the
       discovery cache.

          curl -X POST http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\&addr=192.162.129.11:22000
          # Or with the X-API-Key header:
          curl -X POST --header "X-API-Key: TcE28kVPdtJ8COws1JdM0b2nodj77WeQ" http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\&addr=192.162.129.11:22000

   PPOOSSTT //rreesstt//ssyysstteemm//eerrrroorr//cclleeaarr
       Post with empty to body to remove all recent errors.

   GGEETT //rreesstt//ssyysstteemm//eerrrroorr
       NNOOTTEE::
          Return format changed in 0.12.0.

       Returns the list of recent errors.

          {
            "errors": [
              {
                "when": "2014-09-18T12:59:26.549953186+02:00",
                "message": "This is an error string"
              }
            ]
          }

   PPOOSSTT //rreesstt//ssyysstteemm//eerrrroorr
       Post with an error message in the body (plain text) to register  a  new
       error. The new error will be displayed on any active GUI clients.

   GGEETT //rreesstt//ssyysstteemm//lloogg
       New in version 0.12.0.


       Returns  the  list of recent log entries.  The optional ssiinnccee parameter
       limits the results to message newer than the  given  timestamp  in  _R_F_C
       _3_3_3_9 <hhttttppss::////ddaattaattrraacckkeerr..iieettff..oorrgg//ddoocc//hhttmmll//rrffcc33333399..hhttmmll> format.

          {
            "messages": [
              {
                "when": "2014-09-18T12:59:26.549953186+02:00",
                "message": "This is a log entry"
              }
            ]
          }

   GGEETT //rreesstt//ssyysstteemm//lloogg..ttxxtt
       Returns the same information, formatted as a text log instead of a JSON
       object.

   PPOOSSTT //rreesstt//ssyysstteemm//ppaauussee
       Pause the given device or all devices.

       Takes the optional parameter ddeevviiccee (device ID). When  omitted,  pauses
       all devices.  Returns status 200 and no content upon success, or status
       500 and a plain text error on failure.

   GGEETT //rreesstt//ssyysstteemm//ppiinngg
       Returns a {{""ppiinngg"":: ""ppoonngg""}} object.

          {
            "ping": "pong"
          }

   PPOOSSTT //rreesstt//ssyysstteemm//ppiinngg
       Returns a {{""ppiinngg"":: ""ppoonngg""}} object.

   PPOOSSTT //rreesstt//ssyysstteemm//rreesseett
       Post with empty body to erase the current index  database  and  restart
       Syncthing. With no query parameters, the entire database is erased from
       disk.  By specifying the ffoollddeerr parameter with a valid folder ID,  only
       information for that folder will be erased:

          curl -X POST -H "X-API-Key: abc123" http://localhost:8384/rest/system/reset?folder=ab1c2-def3g

       CCaauuttiioonn:  See  ----rreesseett--ddaattaabbaassee  for ..ssttffoollddeerr creation side-effect and
       caution regarding mountpoints.

   PPOOSSTT //rreesstt//ssyysstteemm//rreessttaarrtt
       Post with empty body to immediately restart Syncthing.

   PPOOSSTT //rreesstt//ssyysstteemm//rreessuummee
       Resume the given device or all devices.

       Takes the optional parameter ddeevviiccee (device ID). When omitted,  resumes
       all devices.  Returns status 200 and no content upon success, or status
       500 and a plain text error on failure.

   PPOOSSTT //rreesstt//ssyysstteemm//sshhuuttddoowwnn
       Post with empty body to cause Syncthing to exit and not restart.

   GGEETT //rreesstt//ssyysstteemm//ssttaattuuss
       Returns information about current system status and resource usage. The
       CPU  percent  value  has  been  deprecated from the API and will always
       report 0.

          {
            "alloc": 30618136,
            "connectionServiceStatus": {
              "dynamic+https://relays.syncthing.net/endpoint": {
                "error": null,
                "lanAddresses": [
                  "relay://23.92.71.120:443/?id=53STGR7-YBM6FCX-PAZ2RHM-YPY6OEJ-WYHVZO7-PCKQRCK-PZLTP7T-434XCAD&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=canton7"
                ],
                "wanAddresses": [
                  "relay://23.92.71.120:443/?id=53STGR7-YBM6FCX-PAZ2RHM-YPY6OEJ-WYHVZO7-PCKQRCK-PZLTP7T-434XCAD&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=canton7"
                ]
              },
              "tcp://0.0.0.0:22000": {
                "error": null,
                "lanAddresses": [
                  "tcp://0.0.0.0:22000"
                ],
                "wanAddresses": [
                  "tcp://0.0.0.0:22000"
                ]
              }
            },
            "cpuPercent": 0,
            "discoveryEnabled": true,
            "discoveryErrors": {
              "global@https://discovery-v4-1.syncthing.net/v2/": "500 Internal Server Error",
              "global@https://discovery-v4-2.syncthing.net/v2/": "Post https://discovery-v4-2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)",
              "global@https://discovery-v4-3.syncthing.net/v2/": "Post https://discovery-v4-3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)",
              "global@https://discovery-v6-1.syncthing.net/v2/": "Post https://discovery-v6-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host",
              "global@https://discovery-v6-2.syncthing.net/v2/": "Post https://discovery-v6-2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host",
              "global@https://discovery-v6-3.syncthing.net/v2/": "Post https://discovery-v6-3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host"
            },
            "discoveryStatus": {
              "IPv4 local": {
                "error": null
              },
              "IPv6 local": {
                "error": null
              },
              "global@https://discovery-v4-1.syncthing.net/v2/": {
                "error": "500 Internal Server Error"
              },
              "global@https://discovery-v4-2.syncthing.net/v2/": {
                "error": "Post https://discovery-v4-2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
              },
              "global@https://discovery-v4-3.syncthing.net/v2/": {
                "error": "Post https://discovery-v4-3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
              },
              "global@https://discovery-v6-1.syncthing.net/v2/": {
                "error": "Post https://discovery-v6-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host"
              },
              "global@https://discovery-v6-2.syncthing.net/v2/": {
                "error": "Post https://discovery-v6-2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host"
              },
              "global@https://discovery-v6-3.syncthing.net/v2/": {
                "error": "Post https://discovery-v6-3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host"
              }
            },
            "discoveryMethods": 8,
            "goroutines": 49,
            "lastDialStatus": {
                "tcp://10.20.30.40": {
                  "when": "2019-05-16T07:41:23Z",
                  "error": "dial tcp 10.20.30.40:22000: i/o timeout"
                },
                "tcp://172.16.33.3:22000": {
                  "when": "2019-05-16T07:40:43Z",
                  "ok": true
                },
                "tcp://83.233.120.221:22000": {
                  "when": "2019-05-16T07:41:13Z",
                  "error": "dial tcp 83.233.120.221:22000: connect: connection refused"
                }
            },
            "myID": "P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2",
            "pathSeparator": "/",
            "startTime": "2016-06-06T19:41:43.039284753+02:00",
            "sys": 42092792,
            "themes": [
              "default",
              "dark"
            ],
            "tilde": "/Users/jb",
            "uptime": 2635
          }

       New in version 1.2.0: The llaassttDDiiaallSSttaattuuss dictionary contains  the  last
       error  (or  nnuullll  for success) for each peer address that Syncthing has
       attempted  to  contact.   The  ccoonnnneeccttiioonnSSeerrvviicceeSSttaattuuss  entries  gained
       ""eerrrroorr""::  nnuullll  attributes  where  previously  there  would be no eerrrroorr
       attribute at all in the success case.


       New in version 1.18.0: The ddiissccoovveerryySSttaattuuss dictionary lists all config‐
       ured  discovery  methods,  not only failed ones like the now deprecated
       ddiissccoovveerryyEErrrroorrss.  Each entry is an object itself (for consistency  with
       other  fields),  where  a  nnuullll value for the eerrrroorr attribute means the
       method is running successfully.  This effectively deprecates  the  ddiiss‐‐
       ccoovveerryyMMeetthhooddss attribute as well, which now always matches the number of
       entries in ddiissccoovveerryySSttaattuuss.


   GGEETT //rreesstt//ssyysstteemm//uuppggrraaddee
       Checks for a possible upgrade and returns an object describing the new‐
       est version and upgrade possibility.

          {
            "latest": "v0.14.47",
            "majorNewer": false,
            "newer": true,
            "running": "v0.14.46"
          }

   PPOOSSTT //rreesstt//ssyysstteemm//uuppggrraaddee
       Perform  an  upgrade  to  the newest released version and restart. Does
       nothing if there is no newer version than currently running.

   GGEETT //rreesstt//ssyysstteemm//vveerrssiioonn
       Returns the current Syncthing version information.

          {
            "arch": "amd64",
            "longVersion": "syncthing v0.10.27+3-gea8c3de (go1.4 darwin-amd64 default) jb@syno 2015-03-16 11:01:29 UTC",
            "os": "darwin",
            "version": "v0.10.27+3-gea8c3de"
          }

CCOONNFFIIGG EENNDDPPOOIINNTTSS
   CCoonnffiigg EEnnddppooiinnttss
       New in version 1.12.0.


       These endpoints facilitate access and modification of the configuration
       in  a  granular  way.  Config sent to the endpoints must be in the same
       format as returned by the corresponding GET request. When  posting  the
       configuration   succeeds,   the  posted  configuration  is  immediately
       applied,  except  for   changes   that   require   a   restart.   Query
       _/_r_e_s_t_/_c_o_n_f_i_g_/_r_e_s_t_a_r_t_-_r_e_q_u_i_r_e_d to check if a restart is required.

       For  all  endpoints  supporting PPAATTCCHH, it takes the existing config and
       unmarshals the given JSON object on top of it.  This  means  all  child
       objects will replace the existing objects, not extend them. For example
       for RRaawwLLiisstteennAAddddrreesssseess in options, which is an array of strings,  send‐
       ing  {{RRaawwLLiisstteennAAddddrreesssseess:: [[""ttccpp::////1100..00..00..22""]]}} will replace all existing
       listen addresses.

   //rreesstt//ccoonnffiigg
       GGEETT returns the entire config and PPUUTT replaces it.

   //rreesstt//ccoonnffiigg//rreessttaarrtt--rreeqquuiirreedd
       GGEETT returns whether a restart of Syncthing is required for the  current
       config to take effect.

   //rreesstt//ccoonnffiigg//ffoollddeerrss,, //rreesstt//ccoonnffiigg//ddeevviicceess
       GGEETT  returns all folders respectively devices as an array. PPUUTT takes an
       array and PPOOSSTT a single object. In both cases if a given  folder/device
       already exists, itâs replaced, otherwise a new one is added.

   //rreesstt//ccoonnffiigg//ffoollddeerrss//**iidd**,, //rreesstt//ccoonnffiigg//ddeevviicceess//**iidd**
       Put  the  desired  folder- respectively device-ID in place of *id*. GGEETT
       returns the folder/device for the given ID,  PPUUTT  replaces  the  entire
       config,  PPAATTCCHH replaces only the given child objects and DDEELLEETTEE removes
       the folder/device.

   //rreesstt//ccoonnffiigg//ddeeffaauullttss//ffoollddeerr,, //rreesstt//ccoonnffiigg//ddeeffaauullttss//ddeevviiccee
       GGEETT returns a template folder / device configuration  object  with  all
       default  values,  which  only  needs  a  unique  ID to be applied.  PPUUTT
       replaces the default config (omitted values are reset to the hard-coded
       defaults), PPAATTCCHH replaces only the given child objects.

   //rreesstt//ccoonnffiigg//ddeeffaauullttss//iiggnnoorreess
       New in version 1.19.0.


       GGEETT returns an object with a single lliinneess attribute listing ignore pat‐
       terns to be used by default on folders,  as  an  array  of  single-line
       strings.   PPUUTT  replaces  the default ignore patterns from an object of
       the same format.

   //rreesstt//ccoonnffiigg//ooppttiioonnss,, //rreesstt//ccoonnffiigg//llddaapp,, //rreesstt//ccoonnffiigg//gguuii
       GGEETT returns the respective object, PPUUTT replaces the entire  object  and
       PPAATTCCHH replaces only the given child objects.

CCLLUUSSTTEERR EENNDDPPOOIINNTTSS
       Concerns the mesh network structure.

   DDEELLEETTEE //rreesstt//cclluusstteerr//ppeennddiinngg//ddeevviicceess
       New in version 1.18.0.


       Remove  records  about  a pending remote device which tried to connect.
       Valid values for the ddeevviiccee parameter are those from the  corresponding
       cluster-pending-devices-get endpoint.

          $ curl -X DELETE -H "X-API-Key: abc123" http://localhost:8384/rest/cluster/pending/devices?device=P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2

       Returns  status  200  and  no content upon success, or status 500 and a
       plain text error on  failure.   A  /events/pendingdeviceschanged  event
       will be generated in response.

       For  a more permanent effect, also for future connections from the same
       device ID, the device should be ignored in the configuration instead.

   GGEETT //rreesstt//cclluusstteerr//ppeennddiinngg//ddeevviicceess
       New in version 1.13.0.


       Lists remote devices which have tried to connect, but are not yet  con‐
       figured in our instance.

          {
            "P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2": {
              "time": "2020-03-18T11:43:07Z",
              "name": "Friend Joe",
              "address": "192.168.1.2:22000"
            }
          }

   DDEELLEETTEE //rreesstt//cclluusstteerr//ppeennddiinngg//ffoollddeerrss
       New in version 1.18.0.


       Remove  records  about a pending folder announced from a remote device.
       Valid values for the ffoollddeerr and ddeevviiccee parameters are  those  from  the
       corresponding cluster-pending-folders-get endpoint.  The ddeevviiccee parame‐
       ter is optional and affects announcements of this folder from the given
       device, or from _a_n_y device if omitted.

          $ curl -X DELETE -H "X-API-Key: abc123" http://localhost:8384/rest/cluster/pending/folders?folder=cpkn4-57ysy&device=P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2

       Returns  status  200  and  no content upon success, or status 500 and a
       plain text error on  failure.   A  /events/pendingfolderschanged  event
       will be generated in response.

       For  a more permanent effect, also for future announcements of the same
       folder ID, the folder should be ignored in the configuration instead.

   GGEETT //rreesstt//cclluusstteerr//ppeennddiinngg//ffoollddeerrss
       New in version 1.13.0.


       Lists folders which remote devices have offered to us, but are not  yet
       shared  from our instance to them.  Takes the optional ddeevviiccee parameter
       to only return folders offered by  a  specific  remote  device.   Other
       offering devices are also omitted from the result.

          {
            "cpkn4-57ysy": {
              "offeredBy": {
                "P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2": {
                  "time": "2020-03-18T11:43:07Z",
                  "label": "Joe's folder",
                  "receiveEncrypted": true,
                  "remoteEncrypted": false
                },
                "DOVII4U-SQEEESM-VZ2CVTC-CJM4YN5-QNV7DCU-5U3ASRL-YVFG6TH-W5DV5AA": {
                  "time": "2020-03-01T10:12:13Z",
                  "label": "Jane's and Joe's folder",
                  "receiveEncrypted": false,
                  "remoteEncrypted": false
                }
              }
            },
            "abcde-fghij": {
              "offeredBy": {
                "P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2": {
                  "time": "2020-03-18T11:43:07Z",
                  "label": "MyPics",
                  "receiveEncrypted": false,
                  "remoteEncrypted": false
                }
              }
            }
          }

FFOOLLDDEERR EENNDDPPOOIINNTTSS
       Runtime state of the individual shared folders.

   GGEETT //rreesstt//ffoollddeerr//eerrrroorrss
       New in version 0.14.53.


       Takes  one  mandatory parameter, ffoollddeerr, and returns the list of errors
       encountered during scanning or pulling.

       The results can be paginated using the common pagination parameters.

          {
            "folder": "nnhic-sxuae",
            "errors": [
              {
                "path": "noperm.txt",
                "error": "hashing: open /path/to/folder/noperm.txt: permission denied"
              }
            ],
            "page": 1,
            "perpage": 100
          }

   GGEETT //rreesstt//ffoollddeerr//ppuulllleerrrroorrss ((DDEEPPRREECCAATTEEDD))
       Deprecated since version v0.14.53: This endpoint still works as  before
       but  is  deprecated.   Use folder-errors-get instead, which returns the
       same information.

       See _d_5_1_0_e_3_c_c_a_3_d_5_c_a_a_e_4_2_1_2_1_f_a_2_0_6_b_3_d_e_c_c_9_8_1_a_e_5_9_e  <hhttttppss::////ggiitthhuubb..ccoomm//ssyynncc‐‐
       tthhiinngg//ssyynncctthhiinngg//ccoommmmiitt//dd551100ee33ccccaa33dd55ccaaaaee4422112211ffaa220066bb33ddeecccc998811aaee5599ee>


   GGEETT //rreesstt//ffoollddeerr//vveerrssiioonnss
       New in version 0.14.44.


       Takes one mandatory parameter, ffoollddeerr, and returns the list of archived
       files that could be recovered.  How many versions are available depends
       on  the /users/versioning configuration.  Each entry specifies when the
       file version was archived as the vveerrssiioonnTTiimmee, the mmooddTTiimmee when  it  was
       last modified before being archived, and the size in bytes.

          {
            "dir1/dir2/bar": [
              {
                "versionTime": "2022-02-06T20:44:12+01:00",
                "modTime": "2021-01-14T13:21:22+01:00",
                "size": 4
              }
            ],
            "baz": [
              {
                "versionTime": "2022-02-06T20:44:20+01:00",
                "modTime": "2021-01-14T13:23:49+01:00",
                "size": 4
              }
            ],
            "foo": [
              {
                "versionTime": "2022-02-06T20:55:31+01:00",
                "modTime": "2022-02-06T20:44:13+01:00",
                "size": 4
              },
              {
                "versionTime": "2022-02-06T20:44:20+01:00",
                "modTime": "2021-01-14T13:21:16+01:00",
                "size": 4
              }
            ]
          }

   PPOOSSTT //rreesstt//ffoollddeerr//vveerrssiioonnss
       Restore  archived  versions of a given set of files.  Expects an object
       with attributes named after the relative file paths, with timestamps as
       values   matching   valid  vveerrssiioonnTTiimmee  entries  in  the  corresponding
       folder-versions-get response object.

       Takes the mandatory parameter ffoollddeerr (folder ID).   Returns  an  object
       containing  any  error messages that occurred during restoration of the
       file, with the file path as attribute name.

          curl -X POST -H X-API-key:... http://127.0.0.1:8384/rest/folder/versions?folder=default -d '{
            "dir1/dir2/bar": "2022-02-06T20:44:12+01:00",
            "baz": "2022-02-06T20:44:20+01:00"
          }'

DDAATTAABBAASSEE EENNDDPPOOIINNTTSS
   GGEETT //rreesstt//ddbb//bbrroowwssee
       Returns the directory tree of the global model. Directories are  always
       JSON objects (map/dictionary), and files are always arrays of modifica‐
       tion time and size. The first integer is the files  modification  time,
       and the second integer is the file size.

       The  call takes one mandatory ffoollddeerr parameter and two optional parame‐
       ters. Optional parameter lleevveellss defines how deep  within  the  tree  we
       want  to  dwell  down  (0  based, defaults to unlimited depth) Optional
       parameter pprreeffiixx defines a prefix within the tree where to start build‐
       ing the structure.

          $ curl -s http://localhost:8384/rest/db/browse?folder=j663y-3ct3e&prefix=DCIM&levels=2
          [
              {
                  "modTime" : "2020-10-02T23:48:52.076996974+02:00",
                  "name" : "100ANDRO",
                  "size" : 128,
                  "type" : "FILE_INFO_TYPE_DIRECTORY"
              },
              {
                  "children" : [
                      {
                          "modTime" : "2020-12-16T23:31:34.5009668+01:00",
                          "name" : "IMG_20201114_124821.jpg",
                          "size" : 10682189,
                          "type" : "FILE_INFO_TYPE_FILE"
                      },
                      {
                          "modTime" : "2020-12-16T23:31:35.0106367+01:00",
                          "name" : "IMG_20201213_122451.jpg",
                          "size" : 7936351,
                          "type" : "FILE_INFO_TYPE_FILE"
                      },
                      {
                          "modTime" : "2020-12-13T12:25:05.017097469+01:00",
                          "name" : "IMG_20201213_122504.jpg",
                          "size" : 8406507,
                          "type" : "FILE_INFO_TYPE_FILE"
                      },
                      {
                          "modTime" : "2020-12-13T12:25:06.127097469+01:00",
                          "name" : "IMG_20201213_122505.jpg",
                          "size" : 8381931,
                          "type" : "FILE_INFO_TYPE_FILE"
                      },
                      {
                          "modTime" : "2020-12-13T12:53:29.707298401+01:00",
                          "name" : "IMG_20201213_125329.jpg",
                          "size" : 4388331,
                          "type" : "FILE_INFO_TYPE_FILE"
                      },
                  ],
                  "modTime" : "2020-10-09T13:04:42.4410738+02:00",
                  "name" : "Camera",
                  "size" : 128,
                  "type" : "FILE_INFO_TYPE_DIRECTORY"
              },
          ]

       NNOOTTEE::
          This  is  an  expensive  call,  increasing  CPU and RAM usage on the
          device. Use sparingly.

   GGEETT //rreesstt//ddbb//ccoommpplleettiioonn
       Returns the completion percentage (0 to 100) and byte  /  item  counts.
       Takes optional ddeevviiccee and ffoollddeerr parameters:

       · ffoollddeerr  specifies the folder ID to calculate completion for. An empty
         or absent ffoollddeerr parameter means all folders as an aggregate.

       · ddeevviiccee specifies the device ID to calculate completion for. An  empty
         or absent ddeevviiccee parameter means the local device.

       If  a  device  is specified but no folder, completion is calculated for
       all folders shared with that device.

   EExxaammppllee QQuueerriieess
       Completion status for folder aabbccdd--11223344 on device II66KKAAHH7766--......--33PPSSRROOAAUU:

          /rest/db/completion?folder=abcd-1234&device=I6KAH76-...-3PSROAU

       Aggregated completion status for device II66KKAAHH7766--......--33PPSSRROOAAUU (all  fold‐
       ers shared with them):

          /rest/db/completion?device=I6KAH76-...-3PSROAU

       Completion status for folder aabbccdd--11223344 on the local device:

          /rest/db/completion?folder=abcd-1234

       Aggregated completion status for all folders on the local device:

          /rest/db/completion

   EExxaammppllee RReessppoonnssee
          {
            "completion": 99.9937565835,
            "globalBytes": 156793013575,
            "needBytes": 9789241,
            "globalItems": 7823,
            "needItems": 412,
            "needDeletes": 0,
            "sequence": 12
          }

       New  in  version  1.8.0:  The  ability to aggregate multiple folders by
       leaving out the folder ID.  Querying data for the local device by leav‐
       ing  out  the  device  ID.  Returning  the  gglloobbaallIItteemmss  counter in the
       response.


   GGEETT //rreesstt//ddbb//ffiillee
       Returns most data available about a given file, including  version  and
       availability. Takes ffoollddeerr and ffiillee parameters.

          {
            "availability": [
              {
                "id": "ITZRNXE-YNROGBZ-HXTH5P7-VK5NYE5-QHRQGE2-7JQ6VNJ-KZUEDIU-5PPR5AM",
                "fromTemporary": false
              }
            ],
            "global": {
              "deleted": false,
              "ignored": false,
              "invalid": false,
              "localFlags": 0,
              "modified": "2018-08-18T12:21:13.836784059+02:00",
              "modifiedBy": "SYNO4VL",
              "mustRescan": false,
              "name": "testfile",
              "noPermissions": false,
              "numBlocks": 1,
              "permissions": "0755",
              "sequence": 107499,
              "size": 1234,
              "type": 0,
              "version": [
                "SYNO4VL:1"
              ]
            },
            "local": {
              "deleted": false,
              "ignored": false,
              "invalid": false,
              "localFlags": 0,
              "modified": "2018-08-18T12:21:13.836784059+02:00",
              "modifiedBy": "SYNO4VL",
              "mustRescan": false,
              "name": "testfile",
              "noPermissions": false,
              "numBlocks": 1,
              "permissions": "0755",
              "sequence": 111038,
              "size": 1234,
              "type": 0,
              "version": [
                "SYNO4VL:1"
              ]
            }
          }

   GGEETT //rreesstt//ddbb//iiggnnoorreess
       Takes  one  parameter, ffoollddeerr, and returns the content of the ..ssttiiggnnoorree
       as the iiggnnoorree field. A second  field,  eexxppaannddeedd,  provides  a  list  of
       strings  which  represent  globbing  patterns  described by gobwas/glob
       (based on standard wildcards) that match the patterns in ..ssttiiggnnoorree  and
       all  the includes. If appropriate these globs are prepended by the fol‐
       lowing modifiers: !! to negate the glob, ((??ii))  to  do  case  insensitive
       matching  and  ((??dd)) to enable removing of ignored files in an otherwise
       empty directory.

          {
            "ignore": [
              "(?i)/Backups"
            ],
            "expanded": [
              "(?i)Backups",
              "(?i)Backups/**"
            ]
          }

   PPOOSSTT //rreesstt//ddbb//iiggnnoorreess
       Expects a format similar to the output of db-ignores-get call, but only
       containing  the  iiggnnoorree  field  (eexxppaannddeedd field should be omitted).  It
       takes one parameter, ffoollddeerr, and either  updates  the  content  of  the
       ..ssttiiggnnoorree echoing it back as a response, or returns an error.

   GGEETT //rreesstt//ddbb//llooccaallcchhaannggeedd
       New in version 0.14.55.


       Takes  one  mandatory  parameter, ffoollddeerr, and returns the list of files
       which were changed locally in a receive-only folder.  Thus they  differ
       from  the  global  state  and  could be reverted by pulling from remote
       devices again, see db-revert-post.

       The results can be paginated using the common pagination parameters.

          {
            "files": [
              {
                "flags": "0755",
                "sequence": 6,
                "modified": "2015-04-20T23:06:12+09:00",
                "name": "ls",
                "size": 34640,
                "version": [
                  "5157751870738175669:1"
                ]
              }
            ],
            "page": 1,
            "perpage": 100
          }

       NNOOTTEE::
          This is an expensive call, increasing  CPU  and  RAM  usage  on  the
          device.  Use sparingly.

   GGEETT //rreesstt//ddbb//nneeeedd
       Takes one mandatory parameter, ffoollddeerr, and returns lists of files which
       are needed by this device in order for it to become in sync.

       The results can be paginated using the  common  pagination  parameters.
       Pagination  happens,  across  the  union of all needed files, that is -
       across all 3 sections of the response.  For example, given the  current
       need state is as follows:

       1. pprrooggrreessss has 15 items

       2. qquueeuueedd has 3 items

       3. rreesstt has 12 items

       If you issue a query with ppaaggee==11 and ppeerrppaaggee==1100, only the pprrooggrreessss sec‐
       tion in the response will have 10 items. If you issue a  request  query
       with  ppaaggee==22  and  ppeerrppaaggee==1100,  pprrooggrreessss  section  will have the last 5
       items, qquueeuueedd section will have all 3 items, and rreesstt section will have
       first 2 items. If you issue a query for ppaaggee==33 and ppeerrppaaggee==1100, you will
       only have the last 10 items of the rreesstt section.

       NNOOTTEE::
          Return format changed in version 0.14.43, removing the  ttoottaall  count
          attribute.

          {
            # Files currently being downloaded
            "progress": [
              {
                "flags": "0755",
                "sequence": 6,
                "modified": "2015-04-20T23:06:12+09:00",
                "name": "ls",
                "size": 34640,
                "version": [
                  "5157751870738175669:1"
                ]
              }
            ],
            # Files queued to be downloaded next (as per array order)
            "queued": [
                ...
            ],
            # Files to be downloaded after all queued files will be downloaded.
            # This happens when we start downloading files, and new files get added while we are downloading.
            "rest": [
                ...
            ],
            "page": 1,
            "perpage": 100
          }

       NNOOTTEE::
          This  is  an  expensive  call,  increasing  CPU and RAM usage on the
          device.  Use sparingly.

   PPOOSSTT //rreesstt//ddbb//oovveerrrriiddee
       Request override of a send only folder.  Override  means  to  make  the
       local  version  latest,  overriding changes made on other devices. This
       API call does nothing if the folder is not a send only folder.

       Takes the mandatory parameter _f_o_l_d_e_r (folder ID).

          curl -X POST -H X-API-key:... http://127.0.0.1:8384/rest/db/override?folder=default

   PPOOSSTT //rreesstt//ddbb//pprriioo
       Moves the file to the top of the download queue.

          curl -X POST http://127.0.0.1:8384/rest/db/prio?folder=default&file=foo/bar

       Response contains the same output as db-need-get.

   GGEETT //rreesstt//ddbb//rreemmootteenneeeedd
       New in version 0.14.43.


       Takes the mandatory parameters ffoollddeerr and ddeevviiccee, and returns the  list
       of  files  which  are  needed  by that remote device in order for it to
       become in sync with the shared folder.

       The results can be paginated using the common pagination parameters.

          {
            "files": [
              {
                "flags": "0755",
                "sequence": 6,
                "modified": "2015-04-20T23:06:12+09:00",
                "name": "ls",
                "size": 34640,
                "version": [
                  "5157751870738175669:1"
                ]
              }
            ],
            "page": 1,
            "perpage": 100
          }

       NNOOTTEE::
          This is an expensive call, increasing  CPU  and  RAM  usage  on  the
          device.  Use sparingly.

   PPOOSSTT //rreesstt//ddbb//rreevveerrtt
       New in version 0.14.50.


       Request  revert  of  a receive only folder. Reverting a folder means to
       undo all local changes. This API call does nothing if the folder is not
       a receive only folder.

       Takes the mandatory parameter _f_o_l_d_e_r (folder ID).

          curl -X POST -H X-API-Key:... http://127.0.0.1:8384/rest/db/revert?folder=default

   PPOOSSTT //rreesstt//ddbb//ssccaann
       Request  immediate  scan.  Takes the optional parameters ffoollddeerr (folder
       ID), ssuubb (path relative to the folder root) and nneexxtt (time in seconds).
       If ffoollddeerr is omitted or empty all folders are scanned. If ssuubb is given,
       only this path (and children, in case itâs a directory) is scanned. The
       nneexxtt  argument delays Syncthingâs automated rescan interval for a given
       amount of seconds.

       Requesting scan of a path that no longer exists, but previously did, is
       valid and will result in Syncthing noticing the deletion of the path in
       question.

       Returns status 200 and no content upon success, or  status  500  and  a
       plain text error if an error occurred during scanning.

          curl -X POST http://127.0.0.1:8384/rest/db/scan?folder=default&sub=foo/bar

   GGEETT //rreesstt//ddbb//ssttaattuuss
       Returns information about the current status of a folder.

       Parameters: ffoollddeerr, the ID of a folder.

          {
            "globalBytes": 0,
            "globalDeleted": 0,
            "globalDirectories": 0,
            "globalFiles": 0,
            "globalSymlinks": 0,
            "globalTotalItems": 0,
            "ignorePatterns": false,
            "inSyncBytes": 0,
            "inSyncFiles": 0,
            "invalid": "",
            "localBytes": 0,
            "localDeleted": 0,
            "localDirectories": 0,
            "localFiles": 0,
            "localSymlinks": 0,
            "localTotalItems": 0,
            "needBytes": 0,
            "needDeletes": 0,
            "needDirectories": 0,
            "needFiles": 0,
            "needSymlinks": 0,
            "needTotalItems": 0,
            "pullErrors": 0,
            "receiveOnlyChangedBytes": 0,
            "receiveOnlyChangedDeletes": 0,
            "receiveOnlyChangedDirectories": 0,
            "receiveOnlyChangedFiles": 0,
            "receiveOnlyChangedSymlinks": 0,
            "receiveOnlyTotalItems": 0,
            "sequence": 0,
            "state": "idle",
            "stateChanged": "2018-08-08T07:04:57.301064781+02:00",
            "version": 0
          }

       The various fields have the following meaning:

       gglloobbaall**::
              Data in the cluster latest version.

       iinnSSyynncc**::
              Data that is locally the same as the cluster latest version.

       llooccaall**::
              Data  that  is  locally  present, regardless of whether itâs the
              same or different version as the cluster latest version.

       nneeeedd**:: Data that is needed to become up to date with the cluster latest
              version (i.e., data that is out of sync).

       rreecceeiivveeOOnnllyyCChhaannggeedd**::
              Data that has changed locally in a receive only folder, and thus
              not been sent to the cluster.

       iinnvvaalliidd::
              Deprecated, always empty.

       ppuullllEErrrroorrss::
              The number of files that failed to sync  during  the  last  sync
              operations.

       sseeqquueennccee::
              The current folder sequence number.

       ssttaattee:: The current folder state.

       ssttaatteeCChhaannggeedd::
              When the folder state last changed.

       vveerrssiioonn::
              Deprecated, equivalent to the sequence number.

       NNOOTTEE::
          This  is  an  expensive  call,  increasing  CPU and RAM usage on the
          device. Use sparingly.

EEVVEENNTT EENNDDPPOOIINNTTSS
   GGEETT //rreesstt//eevveennttss
       To receive events, perform a HTTP GET of //rreesstt//eevveennttss.

       To filter the event list, in effect creating  a  specific  subscription
       for  only  the  desired  event  types,  add a parameter eevveennttss==EEvveennttTTyy‐‐
       ppeeAA,,EEvveennttTTyyppeeBB,,......  where the event types are any of  the  event-types.
       If  no  filter  is  specified, all events _e_x_c_e_p_t /events/localchangede‐
       tected and /events/remotechangedetected are included.

       The optional parameter ssiinnccee==<<llaassttSSeeeennIIDD>> sets the ID of the last event
       youâve  already  seen.  Syncthing returns a JSON encoded array of event
       objects, starting at the event just after the one with this  last  seen
       ID.  The default value is 0, which returns all events. There is a limit
       to the number of events buffered, so if the rate of events is  high  or
       the  time  between  polling  calls is long some events might be missed.
       This can be detected by noting a discontinuity in the event IDs.

       If no new events are produced since <<llaassttSSeeeennIIDD>>, the HTTP call  blocks
       and  waits  for  new  events  to happen before returning. By default it
       times out after 60 seconds returning an empty array. The time out dura‐
       tion can be customized with the optional parameter ttiimmeeoouutt==<<sseeccoonnddss>>.

       To receive only a limited number of events, add the lliimmiitt==<<nn>> parameter
       with a suitable value for  nn  and  only  the  _l_a_s_t  nn  events  will  be
       returned. This can be used to catch up with the latest event ID after a
       disconnection for example: //rreesstt//eevveennttss??ssiinnccee==00&&lliimmiitt==11.

   GGEETT //rreesstt//eevveennttss//ddiisskk
       This convenience endpoint provides the same event stream, but  pre-fil‐
       tered      to     show     only     /events/localchangedetected     and
       /events/remotechangedetected event types.  The eevveennttss parameter is  not
       used.

SSTTAATTIISSTTIICCSS EENNDDPPOOIINNTTSS
   GGEETT //rreesstt//ssttaattss//ddeevviiccee
       Returns  general statistics about devices. Currently, only contains the
       time the device was last seen.

          $ curl -s http://localhost:8384/rest/stats/device | json
          {
            "P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2": {
              "lastSeen" : "2015-04-18T11:21:31.3256277+01:00"
            }
          }

   GGEETT //rreesstt//ssttaattss//ffoollddeerr
       Returns general statistics about folders. Currently contains  the  last
       scan time and the last synced file.

          {
            "folderid": {
              "lastScan": "2016-06-02T13:28:01.288181412-04:00",
              "lastFile": {
                "filename": "file/name",
                "at": "2015-04-16T22:04:18.3066971+01:00"
              }
            }
          }

MMIISSCC SSEERRVVIICCEESS EENNDDPPOOIINNTTSS
   GGEETT //rreesstt//ssvvcc//ddeevviicceeiidd
       Verifies  and  formats a device ID. Accepts all currently valid formats
       (52 or 56 characters with or without separators, upper or  lower  case,
       with  trivial  substitutions).  Takes  one  parameter,  iidd, and returns
       either a valid device ID in modern format, or an error.

          $ curl -s http://localhost:8384/rest/svc/deviceid?id=1234 | json
          {
            "error": "device ID invalid: incorrect length"
          }

          $ curl -s http://localhost:8384/rest/svc/deviceid?id=p56ioi7m--zjnu2iq-gdr-eydm-2mgtmgl3bxnpq6w5btbbz4tjxzwicq | json
          {
            "id": "P56IOI7-MZJNU2Y-IQGDREY-DM2MGTI-MGL3BXN-PQ6W5BM-TBBZ4TJ-XZWICQ2"
          }

   GGEETT //rreesstt//ssvvcc//llaanngg
       Returns a list of canonicalized localization codes, as picked  up  from
       the AAcccceepptt--LLaanngguuaaggee header sent by the browser.

          ["sv_sv","sv","en_us","en"]

   GGEETT //rreesstt//ssvvcc//rraannddoomm//ssttrriinngg
       Returns  a  strong random generated string (alphanumeric) of the speci‐
       fied length. Takes the lleennggtthh parameter.

          {
            "random": "FdPaEaZQ56sXEKYNxpgF"
          }

   GGEETT //rreesstt//ssvvcc//rreeppoorrtt
       Returns the data sent in the anonymous usage report.

          {
             "folderMaxMiB" : 0,
             "platform" : "linux-amd64",
             "totMiB" : 0,
             "longVersion" : "syncthing v0.12.2 \"Beryllium Bedbug\" (go1.4.3 linux-amd64 default) unknown-user@build2.syncthing.net 2015-11-09 13:23:26 UTC",
             "upgradeAllowedManual" : true,
             "totFiles" : 3,
             "folderUses" : {
                "ignorePerms" : 0,
                "autoNormalize" : 0,
                "sendonly" : 0,
                "ignoreDelete" : 0
             },
             "memoryUsageMiB" : 13,
             "version" : "v0.12.2",
             "sha256Perf" : 27.28,
             "numFolders" : 2,
             "memorySize" : 1992,
             "announce" : {
                "defaultServersIP" : 0,
                "otherServers" : 0,
                "globalEnabled" : false,
                "defaultServersDNS" : 1,
                "localEnabled" : false
             },
             "usesRateLimit" : false,
             "numCPU" : 2,
             "uniqueID" : "",
             "urVersion" : 2,
             "rescanIntvs" : [
                60,
                60
             ],
             "numDevices" : 2,
             "folderMaxFiles" : 3,
             "relays" : {
                "defaultServers" : 1,
                "enabled" : true,
                "otherServers" : 0
             },
             "deviceUses" : {
                "compressMetadata" : 1,
                "customCertName" : 0,
                "staticAddr" : 1,
                "compressAlways" : 0,
                "compressNever" : 1,
                "introducer" : 0,
                "dynamicAddr" : 1
             },
             "upgradeAllowedAuto" : false
          }

DDEEBBUUGG EENNDDPPOOIINNTTSS
   DDeebbuugg EEnnddppooiinnttss
       These endpoints require the gguuii..ddeebbuuggggiinngg configuration  option  to  be
       enabled and yield an access denied error code otherwise.

   GGEETT //rreesstt//ddeebbuugg//ppeeeerrCCoommpplleettiioonn
       Summarizes  the  completion precentage for each remote device.  Returns
       an object with device IDs as keys and an integer percentage as values.

   GGEETT //rreesstt//ddeebbuugg//hhttttppmmeettrriiccss
       Returns statistics about each served REST API endpoint, to diagnose how
       much time was spent generating the responses.

   GGEETT //rreesstt//ddeebbuugg//ccppuupprrooff
       Used  to  capture a profile of what Syncthing is doing on the CPU.  See
       /users/profiling.

   GGEETT //rreesstt//ddeebbuugg//hheeaapppprrooff
       Used to capture a profile of what Syncthing is doing with the heap mem‐
       ory.  See /users/profiling.

   GGEETT //rreesstt//ddeebbuugg//ssuuppppoorrtt
       Collects  information  about  the  running instance for troubleshooting
       purposes.  Returns a âsupport bundleâ as a zipped archive, which should
       be sent to the developers after verifying it contains no sensitive per‐
       sonal information.  Credentials for the web GUI and  the  API  key  are
       automatically redacted already.

   GGEETT //rreesstt//ddeebbuugg//ffiillee
       Shows  diagnostics  about a certain file in a shared folder.  Takes the
       ffoollddeerr (folder ID) and ffiillee (folder relative path) parameters.

          $ curl -H X-API-Key:... "http://localhost:8384/rest/debug/file?folder=default&file=foo/bar"

       The returned object contains the same info as db-file-get, plus a  sum‐
       mary of gglloobbaallVVeerrssiioonnss.

AAUUTTHHOORR
       The Syncthing Authors

CCOOPPYYRRIIGGHHTT
       2014-2019, The Syncthing Authors



v1.19.2                          Apr 05, 2022            SYNCTHING-REST-API(7)
