1
0

syncthing-rest-api.7 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "SYNCTHING-REST-API" "7" "Apr 26, 2025" "v1.29.3" "Syncthing"
  31. .SH NAME
  32. syncthing-rest-api \- REST API
  33. .sp
  34. Syncthing exposes a REST interface over HTTP on the GUI port. This is used by
  35. the GUI (from Javascript) and can be used by other processes wishing to control
  36. Syncthing. In most cases both the input and output data is in JSON format. The
  37. interface is subject to change.
  38. .SH API KEY
  39. .sp
  40. To use the REST API an API key must be set and used. The API key can be
  41. generated in the GUI, or set in the \fBconfiguration/gui/apikey\fP element in
  42. the configuration file. To use an API key, set the request header
  43. \fBX\-API\-Key\fP to the API key value, or set it as a \fBBearer\fP token in the
  44. \fBAuthorization\fP header. For example, \fBcurl \-X POST \-H \(dqX\-API\-Key: abc123\(dq
  45. http://localhost:8384/rest/...\fP or \fBcurl \-X POST \-H \(dqAuthorization: Bearer
  46. abc123\(dq http://localhost:8384/rest/...\fP can be used to invoke with \fBcurl\fP
  47. (add \fB\-k\fP flag when using HTTPS with a Syncthing generated or self signed
  48. certificate).
  49. .sp
  50. One exception to this requirement is \fB/rest/noauth\fP, you do not need an API
  51. key to use those endpoints. This way third\-party devices and services can do
  52. simple calls that don’t expose sensitive information without having to expose
  53. your API key.
  54. .SH RESULT PAGINATION
  55. .sp
  56. Some \fIGET\fP endpoints take optional \fBpage\fP and \fBperpage\fP arguments for
  57. pagination. No more than \fBperpage\fP (defaults to 65536 if not given) result
  58. entries are returned in an array. To access further entries, passing the
  59. \fBpage\fP parameter will advance in the results by that many pages. The actually
  60. used parameters are always returned as attributes in the response object.
  61. .SH SYSTEM ENDPOINTS
  62. .SS GET /rest/system/browse
  63. .sp
  64. Returns a list of directories matching the path given by the optional parameter
  65. \fBcurrent\fP\&. The path can use \X'tty: link https://pkg.go.dev/path/filepath#Match'\fI\%patterns as described in Go’s filepath package\fP <\fBhttps://pkg.go.dev/path/filepath#Match\fP>\X'tty: link'\&. A ‘*’ will always be appended
  66. to the given path (e.g. \fB/tmp/\fP matches all its subdirectories). If the option
  67. \fBcurrent\fP is not given, filesystem root paths are returned.
  68. .INDENT 0.0
  69. .INDENT 3.5
  70. .sp
  71. .EX
  72. $ curl \-H \(dqX\-API\-Key: yourkey\(dq localhost:8384/rest/system/browse | json_pp
  73. [
  74. \(dq/\(dq
  75. ]
  76. $ curl \-H \(dqX\-API\-Key: yourkey\(dq localhost:8384/rest/system/browse?current=/var/ | json_pp
  77. [
  78. \(dq/var/backups/\(dq,
  79. \(dq/var/cache/\(dq,
  80. \(dq/var/lib/\(dq,
  81. \(dq/var/local/\(dq,
  82. \(dq/var/lock/\(dq,
  83. \(dq/var/log/\(dq,
  84. \(dq/var/mail/\(dq,
  85. \(dq/var/opt/\(dq,
  86. \(dq/var/run/\(dq,
  87. \(dq/var/spool/\(dq,
  88. \(dq/var/tmp/\(dq
  89. ]
  90. $ curl \-H \(dqX\-API\-Key: yourkey\(dq localhost:8384/rest/system/browse?current=/var/*o | json_pp
  91. [
  92. \(dq/var/local/\(dq,
  93. \(dq/var/lock/\(dq,
  94. \(dq/var/log/\(dq,
  95. \(dq/var/opt/\(dq,
  96. \(dq/var/spool/\(dq
  97. ]
  98. .EE
  99. .UNINDENT
  100. .UNINDENT
  101. .SS GET /rest/system/config (DEPRECATED)
  102. .sp
  103. Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use \fI\%/rest/config\fP
  104. instead.
  105. .sp
  106. Returns the current configuration.
  107. .INDENT 0.0
  108. .INDENT 3.5
  109. .sp
  110. .EX
  111. {
  112. \(dqversion\(dq: 35,
  113. \(dqfolders\(dq: [
  114. {
  115. \(dqid\(dq: \(dqdefault\(dq,
  116. \(dqlabel\(dq: \(dqDefault Folder\(dq,
  117. \(dqfilesystemType\(dq: \(dqbasic\(dq,
  118. \(dqpath\(dq: \(dq...\(dq,
  119. \(dqtype\(dq: \(dqsendreceive\(dq,
  120. \(dqdevices\(dq: [
  121. {
  122. \(dqdeviceID\(dq: \(dq...\(dq,
  123. \(dqintroducedBy\(dq: \(dq\(dq,
  124. \(dqencryptionPassword\(dq: \(dq\(dq
  125. }
  126. ],
  127. \(dqrescanIntervalS\(dq: 3600,
  128. \(dqfsWatcherEnabled\(dq: true,
  129. \(dqfsWatcherDelayS\(dq: 10,
  130. \(dqignorePerms\(dq: false,
  131. \(dqautoNormalize\(dq: true,
  132. \(dqminDiskFree\(dq: {
  133. \(dqvalue\(dq: 1,
  134. \(dqunit\(dq: \(dq%\(dq
  135. },
  136. \(dqversioning\(dq: {
  137. \(dqtype\(dq: \(dq\(dq,
  138. \(dqparams\(dq: {},
  139. \(dqcleanupIntervalS\(dq: 3600,
  140. \(dqfsPath\(dq: \(dq\(dq,
  141. \(dqfsType\(dq: \(dqbasic\(dq
  142. },
  143. \(dqcopiers\(dq: 0,
  144. \(dqpullerMaxPendingKiB\(dq: 0,
  145. \(dqhashers\(dq: 0,
  146. \(dqorder\(dq: \(dqrandom\(dq,
  147. \(dqignoreDelete\(dq: false,
  148. \(dqscanProgressIntervalS\(dq: 0,
  149. \(dqpullerPauseS\(dq: 0,
  150. \(dqmaxConflicts\(dq: \-1,
  151. \(dqdisableSparseFiles\(dq: false,
  152. \(dqdisableTempIndexes\(dq: false,
  153. \(dqpaused\(dq: false,
  154. \(dqweakHashThresholdPct\(dq: 25,
  155. \(dqmarkerName\(dq: \(dq.stfolder\(dq,
  156. \(dqcopyOwnershipFromParent\(dq: false,
  157. \(dqmodTimeWindowS\(dq: 0,
  158. \(dqmaxConcurrentWrites\(dq: 2,
  159. \(dqdisableFsync\(dq: false,
  160. \(dqblockPullOrder\(dq: \(dqstandard\(dq,
  161. \(dqcopyRangeMethod\(dq: \(dqstandard\(dq,
  162. \(dqcaseSensitiveFS\(dq: false,
  163. \(dqjunctionsAsDirs\(dq: true
  164. }
  165. ],
  166. \(dqdevices\(dq: [
  167. {
  168. \(dqdeviceID\(dq: \(dq...\(dq,
  169. \(dqname\(dq: \(dqLaptop\(dq,
  170. \(dqaddresses\(dq: [
  171. \(dqdynamic\(dq,
  172. \(dqtcp://192.168.1.2:22000\(dq
  173. ],
  174. \(dqcompression\(dq: \(dqmetadata\(dq,
  175. \(dqcertName\(dq: \(dq\(dq,
  176. \(dqintroducer\(dq: false,
  177. \(dqskipIntroductionRemovals\(dq: false,
  178. \(dqintroducedBy\(dq: \(dq\(dq,
  179. \(dqpaused\(dq: false,
  180. \(dqallowedNetworks\(dq: [],
  181. \(dqautoAcceptFolders\(dq: false,
  182. \(dqmaxSendKbps\(dq: 0,
  183. \(dqmaxRecvKbps\(dq: 0,
  184. \(dqignoredFolders\(dq: [
  185. {
  186. \(dqtime\(dq: \(dq2022\-01\-09T19:09:52Z\(dq,
  187. \(dqid\(dq: \(dqbr63e\-wyhb7\(dq,
  188. \(dqlabel\(dq: \(dqFoo\(dq
  189. }
  190. ],
  191. \(dqmaxRequestKiB\(dq: 0,
  192. \(dquntrusted\(dq: false,
  193. \(dqremoteGUIPort\(dq: 0
  194. }
  195. ],
  196. \(dqgui\(dq: {
  197. \(dqenabled\(dq: true,
  198. \(dqaddress\(dq: \(dq127.0.0.1:8384\(dq,
  199. \(dqunixSocketPermissions\(dq: \(dq\(dq,
  200. \(dquser\(dq: \(dqUsername\(dq,
  201. \(dqpassword\(dq: \(dq$2a$10$ZFws69T4FlvWwsqeIwL.TOo5zOYqsa/.TxlUnsGYS.j3JvjFTmxo6\(dq,
  202. \(dqauthMode\(dq: \(dqstatic\(dq,
  203. \(dquseTLS\(dq: false,
  204. \(dqapiKey\(dq: \(dqk1dnz1Dd0rzTBjjFFh7CXPnrF12C49B1\(dq,
  205. \(dqinsecureAdminAccess\(dq: false,
  206. \(dqtheme\(dq: \(dqdefault\(dq,
  207. \(dqdebugging\(dq: false,
  208. \(dqinsecureSkipHostcheck\(dq: false,
  209. \(dqinsecureAllowFrameLoading\(dq: false
  210. },
  211. \(dqldap\(dq: {
  212. \(dqaddress\(dq: \(dq\(dq,
  213. \(dqbindDN\(dq: \(dq\(dq,
  214. \(dqtransport\(dq: \(dqplain\(dq,
  215. \(dqinsecureSkipVerify\(dq: false,
  216. \(dqsearchBaseDN\(dq: \(dq\(dq,
  217. \(dqsearchFilter\(dq: \(dq\(dq
  218. },
  219. \(dqoptions\(dq: {
  220. \(dqlistenAddresses\(dq: [
  221. \(dqdefault\(dq
  222. ],
  223. \(dqglobalAnnounceServers\(dq: [
  224. \(dqdefault\(dq
  225. ],
  226. \(dqglobalAnnounceEnabled\(dq: true,
  227. \(dqlocalAnnounceEnabled\(dq: true,
  228. \(dqlocalAnnouncePort\(dq: 21027,
  229. \(dqlocalAnnounceMCAddr\(dq: \(dq[ff12::8384]:21027\(dq,
  230. \(dqmaxSendKbps\(dq: 0,
  231. \(dqmaxRecvKbps\(dq: 0,
  232. \(dqreconnectionIntervalS\(dq: 60,
  233. \(dqrelaysEnabled\(dq: true,
  234. \(dqrelayReconnectIntervalM\(dq: 10,
  235. \(dqstartBrowser\(dq: true,
  236. \(dqnatEnabled\(dq: true,
  237. \(dqnatLeaseMinutes\(dq: 60,
  238. \(dqnatRenewalMinutes\(dq: 30,
  239. \(dqnatTimeoutSeconds\(dq: 10,
  240. \(dqurAccepted\(dq: 0,
  241. \(dqurSeen\(dq: 0,
  242. \(dqurUniqueId\(dq: \(dq...\(dq,
  243. \(dqurURL\(dq: \(dqhttps://data.syncthing.net/newdata\(dq,
  244. \(dqurPostInsecurely\(dq: false,
  245. \(dqurInitialDelayS\(dq: 1800,
  246. \(dqautoUpgradeIntervalH\(dq: 12,
  247. \(dqupgradeToPreReleases\(dq: false,
  248. \(dqkeepTemporariesH\(dq: 24,
  249. \(dqcacheIgnoredFiles\(dq: false,
  250. \(dqprogressUpdateIntervalS\(dq: 5,
  251. \(dqlimitBandwidthInLan\(dq: false,
  252. \(dqminHomeDiskFree\(dq: {
  253. \(dqvalue\(dq: 1,
  254. \(dqunit\(dq: \(dq%\(dq
  255. },
  256. \(dqreleasesURL\(dq: \(dqhttps://upgrades.syncthing.net/meta.json\(dq,
  257. \(dqalwaysLocalNets\(dq: [],
  258. \(dqoverwriteRemoteDeviceNamesOnConnect\(dq: false,
  259. \(dqtempIndexMinBlocks\(dq: 10,
  260. \(dqunackedNotificationIDs\(dq: [
  261. \(dqauthenticationUserAndPassword\(dq
  262. ],
  263. \(dqtrafficClass\(dq: 0,
  264. \(dqsetLowPriority\(dq: true,
  265. \(dqmaxFolderConcurrency\(dq: 0,
  266. \(dqcrURL\(dq: \(dqhttps://crash.syncthing.net/newcrash\(dq,
  267. \(dqcrashReportingEnabled\(dq: true,
  268. \(dqstunKeepaliveStartS\(dq: 180,
  269. \(dqstunKeepaliveMinS\(dq: 20,
  270. \(dqstunServers\(dq: [
  271. \(dqdefault\(dq
  272. ],
  273. \(dqdatabaseTuning\(dq: \(dqauto\(dq,
  274. \(dqmaxConcurrentIncomingRequestKiB\(dq: 0,
  275. \(dqannounceLANAddresses\(dq: true,
  276. \(dqsendFullIndexOnUpgrade\(dq: false,
  277. \(dqfeatureFlags\(dq: [],
  278. \(dqconnectionLimitEnough\(dq: 0,
  279. \(dqconnectionLimitMax\(dq: 0
  280. },
  281. \(dqremoteIgnoredDevices\(dq: [
  282. {
  283. \(dqtime\(dq: \(dq2022\-01\-09T20:02:01Z\(dq,
  284. \(dqdeviceID\(dq: \(dq...\(dq,
  285. \(dqname\(dq: \(dq...\(dq,
  286. \(dqaddress\(dq: \(dq192.168.0.20:22000\(dq
  287. }
  288. ],
  289. \(dqdefaults\(dq: {
  290. \(dqfolder\(dq: {
  291. \(dqid\(dq: \(dq\(dq,
  292. \(dqlabel\(dq: \(dq\(dq,
  293. \(dqfilesystemType\(dq: \(dqbasic\(dq,
  294. \(dqpath\(dq: \(dq~\(dq,
  295. \(dqtype\(dq: \(dqsendreceive\(dq,
  296. \(dqdevices\(dq: [
  297. {
  298. \(dqdeviceID\(dq: \(dq...\(dq,
  299. \(dqintroducedBy\(dq: \(dq\(dq,
  300. \(dqencryptionPassword\(dq: \(dq\(dq
  301. }
  302. ],
  303. \(dqrescanIntervalS\(dq: 3600,
  304. \(dqfsWatcherEnabled\(dq: true,
  305. \(dqfsWatcherDelayS\(dq: 10,
  306. \(dqignorePerms\(dq: false,
  307. \(dqautoNormalize\(dq: true,
  308. \(dqminDiskFree\(dq: {
  309. \(dqvalue\(dq: 1,
  310. \(dqunit\(dq: \(dq%\(dq
  311. },
  312. \(dqversioning\(dq: {
  313. \(dqtype\(dq: \(dq\(dq,
  314. \(dqparams\(dq: {},
  315. \(dqcleanupIntervalS\(dq: 3600,
  316. \(dqfsPath\(dq: \(dq\(dq,
  317. \(dqfsType\(dq: \(dqbasic\(dq
  318. },
  319. \(dqcopiers\(dq: 0,
  320. \(dqpullerMaxPendingKiB\(dq: 0,
  321. \(dqhashers\(dq: 0,
  322. \(dqorder\(dq: \(dqrandom\(dq,
  323. \(dqignoreDelete\(dq: false,
  324. \(dqscanProgressIntervalS\(dq: 0,
  325. \(dqpullerPauseS\(dq: 0,
  326. \(dqmaxConflicts\(dq: 10,
  327. \(dqdisableSparseFiles\(dq: false,
  328. \(dqdisableTempIndexes\(dq: false,
  329. \(dqpaused\(dq: false,
  330. \(dqweakHashThresholdPct\(dq: 25,
  331. \(dqmarkerName\(dq: \(dq.stfolder\(dq,
  332. \(dqcopyOwnershipFromParent\(dq: false,
  333. \(dqmodTimeWindowS\(dq: 0,
  334. \(dqmaxConcurrentWrites\(dq: 2,
  335. \(dqdisableFsync\(dq: false,
  336. \(dqblockPullOrder\(dq: \(dqstandard\(dq,
  337. \(dqcopyRangeMethod\(dq: \(dqstandard\(dq,
  338. \(dqcaseSensitiveFS\(dq: false,
  339. \(dqjunctionsAsDirs\(dq: false
  340. },
  341. \(dqdevice\(dq: {
  342. \(dqdeviceID\(dq: \(dq\(dq,
  343. \(dqname\(dq: \(dq\(dq,
  344. \(dqaddresses\(dq: [
  345. \(dqdynamic\(dq
  346. ],
  347. \(dqcompression\(dq: \(dqmetadata\(dq,
  348. \(dqcertName\(dq: \(dq\(dq,
  349. \(dqintroducer\(dq: false,
  350. \(dqskipIntroductionRemovals\(dq: false,
  351. \(dqintroducedBy\(dq: \(dq\(dq,
  352. \(dqpaused\(dq: false,
  353. \(dqallowedNetworks\(dq: [],
  354. \(dqautoAcceptFolders\(dq: false,
  355. \(dqmaxSendKbps\(dq: 0,
  356. \(dqmaxRecvKbps\(dq: 0,
  357. \(dqignoredFolders\(dq: [],
  358. \(dqmaxRequestKiB\(dq: 0,
  359. \(dquntrusted\(dq: false,
  360. \(dqremoteGUIPort\(dq: 0
  361. }
  362. }
  363. }
  364. .EE
  365. .UNINDENT
  366. .UNINDENT
  367. .SS GET /rest/system/config/insync (DEPRECATED)
  368. .sp
  369. Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use
  370. \fI\%/rest/config/restart\-required\fP instead.
  371. .sp
  372. Returns whether the config is in sync, i.e. whether the running
  373. configuration is the same as that on disk.
  374. .INDENT 0.0
  375. .INDENT 3.5
  376. .sp
  377. .EX
  378. {
  379. \(dqconfigInSync\(dq: true
  380. }
  381. .EE
  382. .UNINDENT
  383. .UNINDENT
  384. .SS POST /rest/system/config (DEPRECATED)
  385. .sp
  386. Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use \fI\%Config Endpoints\fP
  387. instead.
  388. .sp
  389. Post the full contents of the configuration, in the same format as returned by
  390. the corresponding GET request. When posting the configuration succeeds,
  391. the posted configuration is immediately applied, except for changes that require a restart. Query
  392. \fI\%/rest/config/restart\-required\fP to check if a restart is required.
  393. .sp
  394. This endpoint is the main point to control Syncthing, even if the change only
  395. concerns a very small part of the config: The usual workflow is to get the
  396. config, modify the needed parts and post it again.
  397. .SS GET /rest/system/connections
  398. .sp
  399. \fBNOTE:\fP
  400. .INDENT 0.0
  401. .INDENT 3.5
  402. Return format changed in versions 0.13.0, 1.19.0 and 1.23.0.
  403. .UNINDENT
  404. .UNINDENT
  405. .sp
  406. Returns the list of configured devices and some metadata associated
  407. with them. The list also contains the local device itself as not connected.
  408. .sp
  409. The connection types are \fBTCP (Client)\fP, \fBTCP (Server)\fP, \fBRelay (Client)\fP and \fBRelay (Server)\fP\&.
  410. .INDENT 0.0
  411. .INDENT 3.5
  412. .sp
  413. .EX
  414. {
  415. \(dqconnections\(dq: {
  416. \(dqDOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA\(dq: {
  417. \(dqaddress\(dq: \(dq\(dq,
  418. \(dqat\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  419. \(dqclientVersion\(dq: \(dq\(dq,
  420. \(dqconnected\(dq: false,
  421. \(dqinBytesTotal\(dq: 0,
  422. \(dqisLocal\(dq: false,
  423. \(dqoutBytesTotal\(dq: 0,
  424. \(dqpaused\(dq: false,
  425. \(dqstartedAt\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  426. \(dqtype\(dq: \(dq\(dq
  427. },
  428. \(dqUYGDMA4\-TPHOFO5\-2VQYDCC\-7CWX7XW\-INZINQT\-LE4B42N\-4JUZTSM\-IWCSXA4\(dq: {
  429. \(dqaddress\(dq: \(dq\(dq,
  430. \(dqat\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  431. \(dqclientVersion\(dq: \(dq\(dq,
  432. \(dqconnected\(dq: false,
  433. \(dqinBytesTotal\(dq: 0,
  434. \(dqisLocal\(dq: false,
  435. \(dqoutBytesTotal\(dq: 0,
  436. \(dqpaused\(dq: false,
  437. \(dqstartedAt\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  438. \(dqtype\(dq: \(dq\(dq
  439. },
  440. \(dqYZJBJFX\-RDBL7WY\-6ZGKJ2D\-4MJB4E7\-ZATSDUY\-LD6Y3L3\-MLFUYWE\-AEMXJAC\(dq: {
  441. \(dqaddress\(dq: \(dq127.0.0.1:22002\(dq,
  442. \(dqat\(dq: \(dq2015\-11\-07T17:29:47.691548971+01:00\(dq,
  443. \(dqclientVersion\(dq: \(dqv0.12.1\(dq,
  444. \(dqconnected\(dq: true,
  445. \(dqinBytesTotal\(dq: 556,
  446. \(dqisLocal\(dq: true,
  447. \(dqoutBytesTotal\(dq: 550,
  448. \(dqpaused\(dq: false,
  449. \(dqstartedAt\(dq: \(dq2015\-11\-07T00:09:47Z\(dq,
  450. \(dqtype\(dq: \(dqTCP (Client)\(dq
  451. }
  452. },
  453. \(dqtotal\(dq: {
  454. \(dqat\(dq: \(dq2015\-11\-07T17:29:47.691637262+01:00\(dq,
  455. \(dqinBytesTotal\(dq: 1479,
  456. \(dqoutBytesTotal\(dq: 1318
  457. }
  458. }
  459. .EE
  460. .UNINDENT
  461. .UNINDENT
  462. .SS GET /rest/system/debug
  463. .sp
  464. Added in version 0.12.0.
  465. .sp
  466. Returns the set of debug facilities and which of them are currently enabled.
  467. .INDENT 0.0
  468. .INDENT 3.5
  469. .sp
  470. .EX
  471. {
  472. \(dqenabled\(dq: [
  473. \(dqbeacon\(dq
  474. ],
  475. \(dqfacilities\(dq: {
  476. \(dqbeacon\(dq: \(dqMulticast and broadcast discovery\(dq,
  477. \(dqconfig\(dq: \(dqConfiguration loading and saving\(dq,
  478. \(dqconnections\(dq: \(dqConnection handling\(dq,
  479. \(dqdb\(dq: \(dqThe database layer\(dq,
  480. \(dqdialer\(dq: \(dqDialing connections\(dq,
  481. \(dqdiscover\(dq: \(dqRemote device discovery\(dq,
  482. \(dqevents\(dq: \(dqEvent generation and logging\(dq,
  483. \(dqhttp\(dq: \(dqREST API\(dq,
  484. \(dqmain\(dq: \(dqMain package\(dq,
  485. \(dqmodel\(dq: \(dqThe root hub\(dq,
  486. \(dqprotocol\(dq: \(dqThe BEP protocol\(dq,
  487. \(dqrelay\(dq: \(dqRelay connection handling\(dq,
  488. \(dqscanner\(dq: \(dqFile change detection and hashing\(dq,
  489. \(dqstats\(dq: \(dqPersistent device and folder statistics\(dq,
  490. \(dqsync\(dq: \(dqMutexes\(dq,
  491. \(dqupgrade\(dq: \(dqBinary upgrades\(dq,
  492. \(dqupnp\(dq: \(dqUPnP discovery and port mapping\(dq,
  493. \(dqversioner\(dq: \(dqFile versioning\(dq
  494. }
  495. }
  496. .EE
  497. .UNINDENT
  498. .UNINDENT
  499. .SS POST /rest/system/debug
  500. .sp
  501. Added in version 0.12.0.
  502. .sp
  503. Enables or disables debugging for specified facilities. Give one or both of
  504. \fBenable\fP and \fBdisable\fP query parameters, with comma separated facility
  505. names. To disable debugging of the beacon and discovery packages, and enable it
  506. for config and db:
  507. .INDENT 0.0
  508. .INDENT 3.5
  509. .sp
  510. .EX
  511. $ curl \-H X\-API\-Key:abc123 \-X POST \(aqhttp://localhost:8384/rest/system/debug?disable=beacon,discovery&enable=config,db\(aq
  512. .EE
  513. .UNINDENT
  514. .UNINDENT
  515. .SS GET /rest/system/discovery
  516. .sp
  517. Returns the contents of the local discovery cache.
  518. .INDENT 0.0
  519. .INDENT 3.5
  520. .sp
  521. .EX
  522. {
  523. \(dqLGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\(dq: [
  524. \(dq192.162.129.11:22000\(dq
  525. ]
  526. }
  527. .EE
  528. .UNINDENT
  529. .UNINDENT
  530. .SS POST /rest/system/discovery
  531. .sp
  532. \fBNOTE:\fP
  533. .INDENT 0.0
  534. .INDENT 3.5
  535. Removed in v0.12.0.
  536. .UNINDENT
  537. .UNINDENT
  538. .sp
  539. Post with the query parameters \fBdevice\fP and \fBaddr\fP to add entries to
  540. the discovery cache.
  541. .INDENT 0.0
  542. .INDENT 3.5
  543. .sp
  544. .EX
  545. curl \-X POST http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e&addr=192.162.129.11:22000
  546. # Or with the X\-API\-Key header:
  547. curl \-X POST \-\-header \(dqX\-API\-Key: TcE28kVPdtJ8COws1JdM0b2nodj77WeQ\(dq http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e&addr=192.162.129.11:22000
  548. .EE
  549. .UNINDENT
  550. .UNINDENT
  551. .SS POST /rest/system/error/clear
  552. .sp
  553. Post with empty to body to remove all recent errors.
  554. .SS GET /rest/system/error
  555. .sp
  556. \fBNOTE:\fP
  557. .INDENT 0.0
  558. .INDENT 3.5
  559. Return format changed in 0.12.0.
  560. .UNINDENT
  561. .UNINDENT
  562. .sp
  563. Returns the list of recent errors.
  564. .INDENT 0.0
  565. .INDENT 3.5
  566. .sp
  567. .EX
  568. {
  569. \(dqerrors\(dq: [
  570. {
  571. \(dqwhen\(dq: \(dq2014\-09\-18T12:59:26.549953186+02:00\(dq,
  572. \(dqmessage\(dq: \(dqThis is an error string\(dq
  573. }
  574. ]
  575. }
  576. .EE
  577. .UNINDENT
  578. .UNINDENT
  579. .SS POST /rest/system/error
  580. .sp
  581. Post with an error message in the body (plain text) to register a new
  582. error. The new error will be displayed on any active GUI clients.
  583. .SS GET /rest/system/log
  584. .sp
  585. Added in version 0.12.0.
  586. .sp
  587. Returns the list of recent log entries. The optional \fBsince\fP parameter limits
  588. the results to message newer than the given timestamp in \X'tty: link https://datatracker.ietf.org/doc/html/rfc3339.html'\fI\%RFC 3339\fP <\fBhttps://datatracker.ietf.org/doc/html/rfc3339.html\fP>\X'tty: link' format.
  589. .INDENT 0.0
  590. .INDENT 3.5
  591. .sp
  592. .EX
  593. {
  594. \(dqmessages\(dq: [
  595. {
  596. \(dqwhen\(dq: \(dq2014\-09\-18T12:59:26.549953186+02:00\(dq,
  597. \(dqmessage\(dq: \(dqThis is a log entry\(dq
  598. }
  599. ]
  600. }
  601. .EE
  602. .UNINDENT
  603. .UNINDENT
  604. .SS GET /rest/system/log.txt
  605. .sp
  606. Returns the same information, formatted as a text log instead of a JSON object.
  607. .SS GET /rest/system/paths
  608. .sp
  609. Added in version 1.21.0.
  610. .sp
  611. Returns the path locations used internally for storing configuration, database,
  612. and others.
  613. .INDENT 0.0
  614. .INDENT 3.5
  615. .sp
  616. .EX
  617. {
  618. \(dqauditLog\(dq: \(dq/home/user/.local/share/syncthing/audit\-${timestamp}.log\(dq,
  619. \(dqbaseDir\-config\(dq: \(dq/home/user/.config/syncthing\(dq,
  620. \(dqbaseDir\-data\(dq: \(dq/home/user/.local/share/syncthing\(dq,
  621. \(dqbaseDir\-userHome\(dq: \(dq/home/user\(dq,
  622. \(dqcertFile\(dq: \(dq/home/user/.config/syncthing/cert.pem\(dq,
  623. \(dqconfig\(dq: \(dq/home/user/.config/syncthing/config.xml\(dq,
  624. \(dqcsrfTokens\(dq: \(dq/home/user/.config/syncthing/csrftokens.txt\(dq,
  625. \(dqdatabase\(dq: \(dq/home/user/.local/share/syncthing/index\-v0.14.0.db\(dq,
  626. \(dqdefFolder\(dq: \(dq/home/user/Sync\(dq,
  627. \(dqguiAssets\(dq: \(dq/home/user/src/syncthing/gui\(dq,
  628. \(dqhttpsCertFile\(dq: \(dq/home/user/.config/syncthing/https\-cert.pem\(dq,
  629. \(dqhttpsKeyFile\(dq: \(dq/home/user/.config/syncthing/https\-key.pem\(dq,
  630. \(dqkeyFile\(dq: \(dq/home/user/.config/syncthing/key.pem\(dq,
  631. \(dqlogFile\(dq: \(dq\-\(dq,
  632. \(dqpanicLog\(dq: \(dq/home/user/.local/share/syncthing/panic\-${timestamp}.log\(dq
  633. }
  634. .EE
  635. .UNINDENT
  636. .UNINDENT
  637. .SS POST /rest/system/pause
  638. .sp
  639. Pause the given device or all devices.
  640. .sp
  641. Takes the optional parameter \fBdevice\fP (device ID). When omitted,
  642. pauses all devices. Returns status 200 and no content upon success, or status
  643. 500 and a plain text error on failure.
  644. .SS GET /rest/system/ping
  645. .sp
  646. Returns a \fB{\(dqping\(dq: \(dqpong\(dq}\fP object.
  647. .INDENT 0.0
  648. .INDENT 3.5
  649. .sp
  650. .EX
  651. {
  652. \(dqping\(dq: \(dqpong\(dq
  653. }
  654. .EE
  655. .UNINDENT
  656. .UNINDENT
  657. .SS POST /rest/system/ping
  658. .sp
  659. Returns a \fB{\(dqping\(dq: \(dqpong\(dq}\fP object.
  660. .SS POST /rest/system/reset
  661. .sp
  662. Post with empty body to erase the current index database and restart
  663. Syncthing. With no query parameters, the entire database is erased from disk.
  664. By specifying the \fBfolder\fP parameter with a valid folder ID, only
  665. information for that folder will be erased:
  666. .INDENT 0.0
  667. .INDENT 3.5
  668. .sp
  669. .EX
  670. curl \-X POST \-H \(dqX\-API\-Key: abc123\(dq http://localhost:8384/rest/system/reset?folder=ab1c2\-def3g
  671. .EE
  672. .UNINDENT
  673. .UNINDENT
  674. .sp
  675. \fBCaution\fP: See \fI\%\-\-reset\-database\fP for \fB\&.stfolder\fP creation
  676. side\-effect and caution regarding mountpoints.
  677. .SS POST /rest/system/restart
  678. .sp
  679. Post with empty body to immediately restart Syncthing.
  680. .SS POST /rest/system/resume
  681. .sp
  682. Resume the given device or all devices.
  683. .sp
  684. Takes the optional parameter \fBdevice\fP (device ID). When omitted,
  685. resumes all devices. Returns status 200 and no content upon success, or status
  686. 500 and a plain text error on failure.
  687. .SS POST /rest/system/shutdown
  688. .sp
  689. Post with empty body to cause Syncthing to exit and not restart.
  690. .SS GET /rest/system/status
  691. .sp
  692. Returns information about current system status and resource usage. The CPU percent value has been deprecated from the API and will always report 0.
  693. .INDENT 0.0
  694. .INDENT 3.5
  695. .sp
  696. .EX
  697. {
  698. \(dqalloc\(dq: 30618136,
  699. \(dqconnectionServiceStatus\(dq: {
  700. \(dqdynamic+https://relays.syncthing.net/endpoint\(dq: {
  701. \(dqerror\(dq: null,
  702. \(dqlanAddresses\(dq: [
  703. \(dqrelay://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\(dq
  704. ],
  705. \(dqwanAddresses\(dq: [
  706. \(dqrelay://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\(dq
  707. ]
  708. },
  709. \(dqtcp://0.0.0.0:22000\(dq: {
  710. \(dqerror\(dq: null,
  711. \(dqlanAddresses\(dq: [
  712. \(dqtcp://0.0.0.0:22000\(dq
  713. ],
  714. \(dqwanAddresses\(dq: [
  715. \(dqtcp://0.0.0.0:22000\(dq
  716. ]
  717. }
  718. },
  719. \(dqcpuPercent\(dq: 0,
  720. \(dqdiscoveryEnabled\(dq: true,
  721. \(dqdiscoveryErrors\(dq: {
  722. \(dqglobal@https://discovery\-v4\-1.syncthing.net/v2/\(dq: \(dq500 Internal Server Error\(dq,
  723. \(dqglobal@https://discovery\-v4\-2.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v4\-2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq,
  724. \(dqglobal@https://discovery\-v4\-3.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v4\-3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq,
  725. \(dqglobal@https://discovery\-v6\-1.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v6\-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host\(dq,
  726. \(dqglobal@https://discovery\-v6\-2.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v6\-2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host\(dq,
  727. \(dqglobal@https://discovery\-v6\-3.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v6\-3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host\(dq
  728. },
  729. \(dqdiscoveryStatus\(dq: {
  730. \(dqIPv4 local\(dq: {
  731. \(dqerror\(dq: null
  732. },
  733. \(dqIPv6 local\(dq: {
  734. \(dqerror\(dq: null
  735. },
  736. \(dqglobal@https://discovery\-v4\-1.syncthing.net/v2/\(dq: {
  737. \(dqerror\(dq: \(dq500 Internal Server Error\(dq
  738. },
  739. \(dqglobal@https://discovery\-v4\-2.syncthing.net/v2/\(dq: {
  740. \(dqerror\(dq: \(dqPost https://discovery\-v4\-2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq
  741. },
  742. \(dqglobal@https://discovery\-v4\-3.syncthing.net/v2/\(dq: {
  743. \(dqerror\(dq: \(dqPost https://discovery\-v4\-3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq
  744. },
  745. \(dqglobal@https://discovery\-v6\-1.syncthing.net/v2/\(dq: {
  746. \(dqerror\(dq: \(dqPost https://discovery\-v6\-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host\(dq
  747. },
  748. \(dqglobal@https://discovery\-v6\-2.syncthing.net/v2/\(dq: {
  749. \(dqerror\(dq: \(dqPost https://discovery\-v6\-2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host\(dq
  750. },
  751. \(dqglobal@https://discovery\-v6\-3.syncthing.net/v2/\(dq: {
  752. \(dqerror\(dq: \(dqPost https://discovery\-v6\-3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host\(dq
  753. }
  754. },
  755. \(dqdiscoveryMethods\(dq: 8,
  756. \(dqgoroutines\(dq: 49,
  757. \(dqlastDialStatus\(dq: {
  758. \(dqtcp://10.20.30.40\(dq: {
  759. \(dqwhen\(dq: \(dq2019\-05\-16T07:41:23Z\(dq,
  760. \(dqerror\(dq: \(dqdial tcp 10.20.30.40:22000: i/o timeout\(dq
  761. },
  762. \(dqtcp://172.16.33.3:22000\(dq: {
  763. \(dqwhen\(dq: \(dq2019\-05\-16T07:40:43Z\(dq,
  764. \(dqok\(dq: true
  765. },
  766. \(dqtcp://83.233.120.221:22000\(dq: {
  767. \(dqwhen\(dq: \(dq2019\-05\-16T07:41:13Z\(dq,
  768. \(dqerror\(dq: \(dqdial tcp 83.233.120.221:22000: connect: connection refused\(dq
  769. }
  770. },
  771. \(dqmyID\(dq: \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq,
  772. \(dqpathSeparator\(dq: \(dq/\(dq,
  773. \(dqstartTime\(dq: \(dq2016\-06\-06T19:41:43.039284753+02:00\(dq,
  774. \(dqsys\(dq: 42092792,
  775. \(dqthemes\(dq: [
  776. \(dqdefault\(dq,
  777. \(dqdark\(dq
  778. ],
  779. \(dqtilde\(dq: \(dq/Users/jb\(dq,
  780. \(dquptime\(dq: 2635
  781. }
  782. .EE
  783. .UNINDENT
  784. .UNINDENT
  785. .sp
  786. Added in version 1.2.0: The \fBlastDialStatus\fP dictionary contains the last error (or \fBnull\fP for
  787. success) for each peer address that Syncthing has attempted to contact.
  788. The \fBconnectionServiceStatus\fP entries gained \fB\(dqerror\(dq: null\fP
  789. attributes where previously there would be no \fBerror\fP attribute at all
  790. in the success case.
  791. .sp
  792. Added in version 1.18.0: The \fBdiscoveryStatus\fP dictionary lists all configured discovery methods, not
  793. only failed ones like the now deprecated \fBdiscoveryErrors\fP\&. Each entry is
  794. an object itself (for consistency with other fields), where a \fBnull\fP value
  795. for the \fBerror\fP attribute means the method is running successfully. This
  796. effectively deprecates the \fBdiscoveryMethods\fP attribute as well, which now
  797. always matches the number of entries in \fBdiscoveryStatus\fP\&.
  798. .SS GET /rest/system/upgrade
  799. .sp
  800. Checks for a possible upgrade and returns an object describing the
  801. newest version and upgrade possibility.
  802. .INDENT 0.0
  803. .INDENT 3.5
  804. .sp
  805. .EX
  806. {
  807. \(dqlatest\(dq: \(dqv0.14.47\(dq,
  808. \(dqmajorNewer\(dq: false,
  809. \(dqnewer\(dq: true,
  810. \(dqrunning\(dq: \(dqv0.14.46\(dq
  811. }
  812. .EE
  813. .UNINDENT
  814. .UNINDENT
  815. .SS POST /rest/system/upgrade
  816. .sp
  817. Perform an upgrade to the newest released version and restart. Does
  818. nothing if there is no newer version than currently running.
  819. .SS GET /rest/system/version
  820. .sp
  821. Returns the current Syncthing version information.
  822. .INDENT 0.0
  823. .INDENT 3.5
  824. .sp
  825. .EX
  826. {
  827. \(dqarch\(dq: \(dqamd64\(dq,
  828. \(dqlongVersion\(dq: \(dqsyncthing v0.10.27+3\-gea8c3de (go1.4 darwin\-amd64 default) jb@syno 2015\-03\-16 11:01:29 UTC\(dq,
  829. \(dqos\(dq: \(dqdarwin\(dq,
  830. \(dqversion\(dq: \(dqv0.10.27+3\-gea8c3de\(dq
  831. }
  832. .EE
  833. .UNINDENT
  834. .UNINDENT
  835. .SH CONFIG ENDPOINTS
  836. .SS Config Endpoints
  837. .sp
  838. Added in version 1.12.0.
  839. .sp
  840. These endpoints facilitate access and modification of the \fI\%configuration\fP in a granular way. Config sent to the endpoints must be in the
  841. same format as returned by the corresponding GET request. When posting the
  842. configuration succeeds, the posted configuration is immediately applied, except
  843. for changes that require a restart. Query \fI\%/rest/config/restart\-required\fP to check if
  844. a restart is required.
  845. .sp
  846. For all endpoints supporting \fBPATCH\fP, it takes the existing config and
  847. unmarshals the given JSON object on top of it. This means all child objects will
  848. replace the existing objects, not extend them. For example for
  849. \fBRawListenAddresses\fP in options, which is an array of strings, sending
  850. \fB{RawListenAddresses: [\(dqtcp://10.0.0.2\(dq]}\fP will replace all existing listen
  851. addresses.
  852. .SS /rest/config
  853. .sp
  854. \fBGET\fP returns the entire config and \fBPUT\fP replaces it.
  855. .SS /rest/config/restart\-required
  856. .sp
  857. \fBGET\fP returns whether a restart of Syncthing is required for the current
  858. config to take effect.
  859. .SS /rest/config/folders, /rest/config/devices
  860. .sp
  861. \fBGET\fP returns all folders respectively devices as an array. \fBPUT\fP takes an array and
  862. \fBPOST\fP a single object. In both cases if a given folder/device already exists,
  863. it’s replaced, otherwise a new one is added.
  864. .SS /rest/config/folders/*id*, /rest/config/devices/*id*
  865. .sp
  866. Put the desired folder\- respectively device\-ID in place of *id*. \fBGET\fP
  867. returns the folder/device for the given ID, \fBPUT\fP replaces the entire config,
  868. \fBPATCH\fP replaces only the given child objects and \fBDELETE\fP removes the
  869. folder/device.
  870. .SS /rest/config/defaults/folder, /rest/config/defaults/device
  871. .sp
  872. \fBGET\fP returns a template folder / device configuration object with all default
  873. values, which only needs a unique ID to be applied. \fBPUT\fP replaces the
  874. default config (omitted values are reset to the hard\-coded defaults), \fBPATCH\fP
  875. replaces only the given child objects.
  876. .SS /rest/config/defaults/ignores
  877. .sp
  878. Added in version 1.19.0.
  879. .sp
  880. \fBGET\fP returns an object with a single \fBlines\fP attribute listing ignore
  881. patterns to be used by default on folders, as an array of single\-line strings.
  882. \fBPUT\fP replaces the default ignore patterns from an object of the same format.
  883. .SS /rest/config/options, /rest/config/ldap, /rest/config/gui
  884. .sp
  885. \fBGET\fP returns the respective object, \fBPUT\fP replaces the entire object and
  886. \fBPATCH\fP replaces only the given child objects.
  887. .sp
  888. \fBNOTE:\fP
  889. .INDENT 0.0
  890. .INDENT 3.5
  891. The \fI\%gui.password\fP configuration option has special handling to
  892. accept already hashed passwords. Any valid bcrypt hash is stored verbatim,
  893. while a plaintext password is first hashed.
  894. .UNINDENT
  895. .UNINDENT
  896. .SH CLUSTER ENDPOINTS
  897. .sp
  898. Concerns the mesh network structure.
  899. .SS DELETE /rest/cluster/pending/devices
  900. .sp
  901. Added in version 1.18.0.
  902. .sp
  903. Remove records about a pending remote device which tried to connect. Valid
  904. values for the \fBdevice\fP parameter are those from the corresponding
  905. \fI\%GET /rest/cluster/pending/devices\fP endpoint.
  906. .INDENT 0.0
  907. .INDENT 3.5
  908. .sp
  909. .EX
  910. $ curl \-X DELETE \-H \(dqX\-API\-Key: abc123\(dq http://localhost:8384/rest/cluster/pending/devices?device=P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2
  911. .EE
  912. .UNINDENT
  913. .UNINDENT
  914. .sp
  915. Returns status 200 and no content upon success, or status 500 and a
  916. plain text error on failure. A \fI\%PendingDevicesChanged\fP
  917. event will be generated in response.
  918. .sp
  919. For a more permanent effect, also for future connections from the same
  920. device ID, the device should be ignored in the \fI\%configuration\fP instead.
  921. .SS GET /rest/cluster/pending/devices
  922. .sp
  923. Added in version 1.13.0.
  924. .sp
  925. Lists remote devices which have tried to connect, but are not yet
  926. configured in our instance.
  927. .INDENT 0.0
  928. .INDENT 3.5
  929. .sp
  930. .EX
  931. {
  932. \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
  933. \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
  934. \(dqname\(dq: \(dqFriend Joe\(dq,
  935. \(dqaddress\(dq: \(dq192.168.1.2:22000\(dq
  936. }
  937. }
  938. .EE
  939. .UNINDENT
  940. .UNINDENT
  941. .SS DELETE /rest/cluster/pending/folders
  942. .sp
  943. Added in version 1.18.0.
  944. .sp
  945. Remove records about a pending folder announced from a remote device. Valid
  946. values for the \fBfolder\fP and \fBdevice\fP parameters are those from the
  947. corresponding \fI\%GET /rest/cluster/pending/folders\fP endpoint. The \fBdevice\fP
  948. parameter is optional and affects announcements of this folder from the given
  949. device, or from \fIany\fP device if omitted.
  950. .INDENT 0.0
  951. .INDENT 3.5
  952. .sp
  953. .EX
  954. $ curl \-X DELETE \-H \(dqX\-API\-Key: abc123\(dq http://localhost:8384/rest/cluster/pending/folders?folder=cpkn4\-57ysy&device=P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2
  955. .EE
  956. .UNINDENT
  957. .UNINDENT
  958. .sp
  959. Returns status 200 and no content upon success, or status 500 and a plain text
  960. error on failure. A \fI\%PendingFoldersChanged\fP event will be
  961. generated in response.
  962. .sp
  963. For a more permanent effect, also for future announcements of the same folder
  964. ID, the folder should be ignored in the \fI\%configuration\fP
  965. instead.
  966. .SS GET /rest/cluster/pending/folders
  967. .sp
  968. Added in version 1.13.0.
  969. .sp
  970. Lists folders which remote devices have offered to us, but are not yet
  971. shared from our instance to them. Takes the optional \fBdevice\fP
  972. parameter to only return folders offered by a specific remote device.
  973. Other offering devices are also omitted from the result.
  974. .INDENT 0.0
  975. .INDENT 3.5
  976. .sp
  977. .EX
  978. {
  979. \(dqcpkn4\-57ysy\(dq: {
  980. \(dqofferedBy\(dq: {
  981. \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
  982. \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
  983. \(dqlabel\(dq: \(dqJoe\(aqs folder\(dq,
  984. \(dqreceiveEncrypted\(dq: true,
  985. \(dqremoteEncrypted\(dq: false
  986. },
  987. \(dqDOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA\(dq: {
  988. \(dqtime\(dq: \(dq2020\-03\-01T10:12:13Z\(dq,
  989. \(dqlabel\(dq: \(dqJane\(aqs and Joe\(aqs folder\(dq,
  990. \(dqreceiveEncrypted\(dq: false,
  991. \(dqremoteEncrypted\(dq: false
  992. }
  993. }
  994. },
  995. \(dqabcde\-fghij\(dq: {
  996. \(dqofferedBy\(dq: {
  997. \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
  998. \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
  999. \(dqlabel\(dq: \(dqMyPics\(dq,
  1000. \(dqreceiveEncrypted\(dq: false,
  1001. \(dqremoteEncrypted\(dq: false
  1002. }
  1003. }
  1004. }
  1005. }
  1006. .EE
  1007. .UNINDENT
  1008. .UNINDENT
  1009. .SH FOLDER ENDPOINTS
  1010. .sp
  1011. Runtime state of the individual shared folders.
  1012. .SS GET /rest/folder/errors
  1013. .sp
  1014. Added in version 0.14.53.
  1015. .sp
  1016. Takes one mandatory parameter, \fBfolder\fP, and returns the list of errors
  1017. encountered during scanning or pulling.
  1018. .sp
  1019. The results can be paginated using the \fI\%common pagination parameters\fP\&.
  1020. .INDENT 0.0
  1021. .INDENT 3.5
  1022. .sp
  1023. .EX
  1024. {
  1025. \(dqfolder\(dq: \(dqnnhic\-sxuae\(dq,
  1026. \(dqerrors\(dq: [
  1027. {
  1028. \(dqpath\(dq: \(dqnoperm.txt\(dq,
  1029. \(dqerror\(dq: \(dqhashing: open /path/to/folder/noperm.txt: permission denied\(dq
  1030. }
  1031. ],
  1032. \(dqpage\(dq: 1,
  1033. \(dqperpage\(dq: 100
  1034. }
  1035. .EE
  1036. .UNINDENT
  1037. .UNINDENT
  1038. .SS GET /rest/folder/pullerrors (DEPRECATED)
  1039. .sp
  1040. Deprecated since version v0.14.53: This endpoint still works as before but is deprecated. Use
  1041. \fI\%GET /rest/folder/errors\fP instead, which returns the same information.
  1042. .sp
  1043. See \X'tty: link https://github.com/syncthing/syncthing/commit/d510e3cca3d5caae42121fa206b3decc981ae59e'\fI\%https://github.com/syncthing/syncthing/commit/d510e3cca3d5caae42121fa206b3decc981ae59e\fP\X'tty: link'
  1044. .SS GET /rest/folder/versions
  1045. .sp
  1046. Added in version 0.14.44.
  1047. .sp
  1048. Takes one mandatory parameter, \fBfolder\fP, and returns the list of archived
  1049. files that could be recovered. How many versions are available depends on the
  1050. \fI\%File Versioning\fP configuration. Each entry specifies when the file
  1051. version was archived as the \fBversionTime\fP, the \fBmodTime\fP when it was last
  1052. modified before being archived, and the size in bytes.
  1053. .INDENT 0.0
  1054. .INDENT 3.5
  1055. .sp
  1056. .EX
  1057. {
  1058. \(dqdir1/dir2/bar\(dq: [
  1059. {
  1060. \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:12+01:00\(dq,
  1061. \(dqmodTime\(dq: \(dq2021\-01\-14T13:21:22+01:00\(dq,
  1062. \(dqsize\(dq: 4
  1063. }
  1064. ],
  1065. \(dqbaz\(dq: [
  1066. {
  1067. \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq,
  1068. \(dqmodTime\(dq: \(dq2021\-01\-14T13:23:49+01:00\(dq,
  1069. \(dqsize\(dq: 4
  1070. }
  1071. ],
  1072. \(dqfoo\(dq: [
  1073. {
  1074. \(dqversionTime\(dq: \(dq2022\-02\-06T20:55:31+01:00\(dq,
  1075. \(dqmodTime\(dq: \(dq2022\-02\-06T20:44:13+01:00\(dq,
  1076. \(dqsize\(dq: 4
  1077. },
  1078. {
  1079. \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq,
  1080. \(dqmodTime\(dq: \(dq2021\-01\-14T13:21:16+01:00\(dq,
  1081. \(dqsize\(dq: 4
  1082. }
  1083. ]
  1084. }
  1085. .EE
  1086. .UNINDENT
  1087. .UNINDENT
  1088. .SS POST /rest/folder/versions
  1089. .sp
  1090. Restore archived versions of a given set of files. Expects an object with
  1091. attributes named after the relative file paths, with timestamps as values
  1092. matching valid \fBversionTime\fP entries in the corresponding
  1093. \fI\%GET /rest/folder/versions\fP response object.
  1094. .sp
  1095. Takes the mandatory parameter \fBfolder\fP (folder ID). Returns an object
  1096. containing any error messages that occurred during restoration of the file, with
  1097. the file path as attribute name.
  1098. .INDENT 0.0
  1099. .INDENT 3.5
  1100. .sp
  1101. .EX
  1102. curl \-X POST \-H X\-API\-key:... http://127.0.0.1:8384/rest/folder/versions?folder=default \-d \(aq{
  1103. \(dqdir1/dir2/bar\(dq: \(dq2022\-02\-06T20:44:12+01:00\(dq,
  1104. \(dqbaz\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq
  1105. }\(aq
  1106. .EE
  1107. .UNINDENT
  1108. .UNINDENT
  1109. .SH DATABASE ENDPOINTS
  1110. .SS GET /rest/db/browse
  1111. .sp
  1112. Returns the directory tree of the global model. Directories are always
  1113. JSON objects (map/dictionary), and files are always arrays of
  1114. modification time and size. The first integer is the files modification
  1115. time, and the second integer is the file size.
  1116. .sp
  1117. The call takes one mandatory \fBfolder\fP parameter and two optional
  1118. parameters. Optional parameter \fBlevels\fP defines how deep within the
  1119. tree we want to dwell down (0 based, defaults to unlimited depth)
  1120. Optional parameter \fBprefix\fP defines a prefix within the tree where to
  1121. start building the structure.
  1122. .INDENT 0.0
  1123. .INDENT 3.5
  1124. .sp
  1125. .EX
  1126. $ curl \-s http://localhost:8384/rest/db/browse?folder=j663y\-3ct3e&prefix=DCIM&levels=2
  1127. [
  1128. {
  1129. \(dqmodTime\(dq : \(dq2020\-10\-02T23:48:52.076996974+02:00\(dq,
  1130. \(dqname\(dq : \(dq100ANDRO\(dq,
  1131. \(dqsize\(dq : 128,
  1132. \(dqtype\(dq : \(dqFILE_INFO_TYPE_DIRECTORY\(dq
  1133. },
  1134. {
  1135. \(dqchildren\(dq : [
  1136. {
  1137. \(dqmodTime\(dq : \(dq2020\-12\-16T23:31:34.5009668+01:00\(dq,
  1138. \(dqname\(dq : \(dqIMG_20201114_124821.jpg\(dq,
  1139. \(dqsize\(dq : 10682189,
  1140. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1141. },
  1142. {
  1143. \(dqmodTime\(dq : \(dq2020\-12\-16T23:31:35.0106367+01:00\(dq,
  1144. \(dqname\(dq : \(dqIMG_20201213_122451.jpg\(dq,
  1145. \(dqsize\(dq : 7936351,
  1146. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1147. },
  1148. {
  1149. \(dqmodTime\(dq : \(dq2020\-12\-13T12:25:05.017097469+01:00\(dq,
  1150. \(dqname\(dq : \(dqIMG_20201213_122504.jpg\(dq,
  1151. \(dqsize\(dq : 8406507,
  1152. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1153. },
  1154. {
  1155. \(dqmodTime\(dq : \(dq2020\-12\-13T12:25:06.127097469+01:00\(dq,
  1156. \(dqname\(dq : \(dqIMG_20201213_122505.jpg\(dq,
  1157. \(dqsize\(dq : 8381931,
  1158. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1159. },
  1160. {
  1161. \(dqmodTime\(dq : \(dq2020\-12\-13T12:53:29.707298401+01:00\(dq,
  1162. \(dqname\(dq : \(dqIMG_20201213_125329.jpg\(dq,
  1163. \(dqsize\(dq : 4388331,
  1164. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1165. },
  1166. ],
  1167. \(dqmodTime\(dq : \(dq2020\-10\-09T13:04:42.4410738+02:00\(dq,
  1168. \(dqname\(dq : \(dqCamera\(dq,
  1169. \(dqsize\(dq : 128,
  1170. \(dqtype\(dq : \(dqFILE_INFO_TYPE_DIRECTORY\(dq
  1171. },
  1172. ]
  1173. .EE
  1174. .UNINDENT
  1175. .UNINDENT
  1176. .sp
  1177. \fBNOTE:\fP
  1178. .INDENT 0.0
  1179. .INDENT 3.5
  1180. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  1181. .UNINDENT
  1182. .UNINDENT
  1183. .SS GET /rest/db/completion
  1184. .sp
  1185. Returns the completion percentage (0 to 100) and byte / item counts. Takes
  1186. optional \fBdevice\fP and \fBfolder\fP parameters:
  1187. .INDENT 0.0
  1188. .IP \(bu 2
  1189. \fBfolder\fP specifies the folder ID to calculate completion for. An empty
  1190. or absent \fBfolder\fP parameter means all folders as an aggregate.
  1191. .IP \(bu 2
  1192. \fBdevice\fP specifies the device ID to calculate completion for. An empty
  1193. or absent \fBdevice\fP parameter means the local device.
  1194. .UNINDENT
  1195. .sp
  1196. If a device is specified but no folder, completion is calculated for all
  1197. folders shared with that device.
  1198. .SS Example Queries
  1199. .sp
  1200. Completion status for folder \fBabcd\-1234\fP on device \fBI6KAH76\-...\-3PSROAU\fP:
  1201. .INDENT 0.0
  1202. .INDENT 3.5
  1203. .sp
  1204. .EX
  1205. /rest/db/completion?folder=abcd\-1234&device=I6KAH76\-...\-3PSROAU
  1206. .EE
  1207. .UNINDENT
  1208. .UNINDENT
  1209. .sp
  1210. Aggregated completion status for device \fBI6KAH76\-...\-3PSROAU\fP (all folders shared with them):
  1211. .INDENT 0.0
  1212. .INDENT 3.5
  1213. .sp
  1214. .EX
  1215. /rest/db/completion?device=I6KAH76\-...\-3PSROAU
  1216. .EE
  1217. .UNINDENT
  1218. .UNINDENT
  1219. .sp
  1220. Completion status for folder \fBabcd\-1234\fP on the local device:
  1221. .INDENT 0.0
  1222. .INDENT 3.5
  1223. .sp
  1224. .EX
  1225. /rest/db/completion?folder=abcd\-1234
  1226. .EE
  1227. .UNINDENT
  1228. .UNINDENT
  1229. .sp
  1230. Aggregated completion status for all folders on the local device:
  1231. .INDENT 0.0
  1232. .INDENT 3.5
  1233. .sp
  1234. .EX
  1235. /rest/db/completion
  1236. .EE
  1237. .UNINDENT
  1238. .UNINDENT
  1239. .SS Example Response
  1240. .INDENT 0.0
  1241. .INDENT 3.5
  1242. .sp
  1243. .EX
  1244. {
  1245. \(dqcompletion\(dq: 99.9937565835,
  1246. \(dqglobalBytes\(dq: 156793013575,
  1247. \(dqneedBytes\(dq: 9789241,
  1248. \(dqglobalItems\(dq: 7823,
  1249. \(dqneedItems\(dq: 412,
  1250. \(dqneedDeletes\(dq: 0,
  1251. \(dqremoteState\(dq: \(dqvalid\(dq,
  1252. \(dqsequence\(dq: 12
  1253. }
  1254. .EE
  1255. .UNINDENT
  1256. .UNINDENT
  1257. .sp
  1258. Added in version 1.8.0: The ability to aggregate multiple folders by leaving out the folder ID.
  1259. Querying data for the local device by leaving out the device ID. Returning
  1260. the \fBglobalItems\fP counter in the response.
  1261. .sp
  1262. Added in version 1.20.0: Indication whether the remote device has accepted the folder (shares it with
  1263. us) as well, and whether it is paused. The \fBremoteState\fP field is
  1264. meaningless for aggregated responses, \fBunknown\fP when the remote device is
  1265. not connected. Otherwise it can be either \fBpaused\fP, \fBnotSharing\fP, or
  1266. \fBvalid\fP if the remote is sharing back.
  1267. .SS GET /rest/db/file
  1268. .sp
  1269. Returns most data about a given file, including version and availability.
  1270. .SS Request
  1271. .sp
  1272. The call requires parameters for \fBfolder\fP and \fBfile\fP in the query string:
  1273. .INDENT 0.0
  1274. .IP \(bu 2
  1275. \fBfolder\fP is the folder ID which you can find in the Syncthing Web GUI,
  1276. e.g. \fB5camp\-slpa8\fP\&.
  1277. .IP \(bu 2
  1278. \fBfile\fP is the relative path of the file starting from the folder root to the
  1279. file you are interested in. The path and filename must be correctly
  1280. URL\-encoded.
  1281. .UNINDENT
  1282. .SS Example Request
  1283. .INDENT 0.0
  1284. .INDENT 3.5
  1285. .sp
  1286. .EX
  1287. $ curl \-s \-H X\-API\-KEY:... \(dqhttp://localhost:8384/rest/db/file?folder=YOUR_FOLDER_ID\(dq \-\-url\-query \(dqfile=path/to/file.pdf\(dq
  1288. .EE
  1289. .UNINDENT
  1290. .UNINDENT
  1291. .SS Response
  1292. .INDENT 0.0
  1293. .INDENT 3.5
  1294. .sp
  1295. .EX
  1296. {
  1297. \(dqavailability\(dq: [
  1298. {
  1299. \(dqid\(dq: \(dqITZRNXE\-YNROGBZ\-HXTH5P7\-VK5NYE5\-QHRQGE2\-7JQ6VNJ\-KZUEDIU\-5PPR5AM\(dq,
  1300. \(dqfromTemporary\(dq: false
  1301. }
  1302. ],
  1303. \(dqglobal\(dq: { /* a file entry */ },
  1304. \(dqlocal\(dq: { /* a file entry */ },
  1305. \(dqmtime\(dq: {
  1306. \(dqerr\(dq: null,
  1307. \(dqvalue\(dq: {
  1308. \(dqreal\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  1309. \(dqvirtual\(dq: \(dq0001\-01\-01T00:00:00Z\(dq
  1310. }
  1311. }
  1312. .EE
  1313. .UNINDENT
  1314. .UNINDENT
  1315. .sp
  1316. \fBlocal\fP and \fBglobal\fP refer to the current file on the local device and the
  1317. globally newest file, respectively. A file entry looks like this:
  1318. .INDENT 0.0
  1319. .INDENT 3.5
  1320. .sp
  1321. .EX
  1322. {
  1323. \(dqdeleted\(dq: false,
  1324. \(dqignored\(dq: false,
  1325. \(dqinodeChange\(dq: \(dq1970\-01\-01T01:00:00+01:00\(dq,
  1326. \(dqinvalid\(dq: false,
  1327. \(dqlocalFlags\(dq: 0,
  1328. \(dqmodified\(dq: \(dq2022\-09\-28T08:07:19.979723+02:00\(dq,
  1329. \(dqmodifiedBy\(dq: \(dq523ITIE\(dq,
  1330. \(dqmustRescan\(dq: false,
  1331. \(dqname\(dq: \(dqimg\(dq,
  1332. \(dqnoPermissions\(dq: false,
  1333. \(dqnumBlocks\(dq: 0,
  1334. \(dqpermissions\(dq: \(dq0755\(dq,
  1335. \(dqplatform\(dq: { /* platform specific data */ },
  1336. \(dqsequence\(dq: 914,
  1337. \(dqsize\(dq: 128,
  1338. \(dqtype\(dq: \(dqFILE_INFO_TYPE_DIRECTORY\(dq,
  1339. \(dqversion\(dq: [
  1340. \(dq523ITIE:1664345275\(dq
  1341. ]
  1342. }
  1343. .EE
  1344. .UNINDENT
  1345. .UNINDENT
  1346. .sp
  1347. Platform specific data may be ownership, extended attributes, etc. and is
  1348. divided into entries per operating system / platform. An example platform entry
  1349. containing ownership information for Unix systems and an extended attribute for
  1350. macOS (“darwin”) looks as follows:
  1351. .INDENT 0.0
  1352. .INDENT 3.5
  1353. .sp
  1354. .EX
  1355. {
  1356. \(dqdarwin\(dq: {
  1357. \(dqxattrs\(dq: [
  1358. {
  1359. \(dqname\(dq: \(dqnet.kastelo.xattrtest\(dq,
  1360. \(dqvalue\(dq: \(dqaGVsbG8=\(dq
  1361. }
  1362. ]
  1363. },
  1364. \(dqfreebsd\(dq: null,
  1365. \(dqlinux\(dq: null,
  1366. \(dqnetbsd\(dq: null,
  1367. \(dqunix\(dq: {
  1368. \(dqgid\(dq: 20,
  1369. \(dqgroupName\(dq: \(dqstaff\(dq,
  1370. \(dqownerName\(dq: \(dqjb\(dq,
  1371. \(dquid\(dq: 501
  1372. },
  1373. \(dqwindows\(dq: null
  1374. }
  1375. .EE
  1376. .UNINDENT
  1377. .UNINDENT
  1378. .SS GET /rest/db/ignores
  1379. .sp
  1380. Takes one parameter, \fBfolder\fP, and returns the content of the
  1381. \fB\&.stignore\fP as the \fBignore\fP field. A second field, \fBexpanded\fP,
  1382. provides a list of strings which represent globbing patterns described by gobwas/glob (based on standard wildcards) that match the patterns in \fB\&.stignore\fP and all the includes. If appropriate these globs are prepended by the following modifiers: \fB!\fP to negate the glob, \fB(?i)\fP to do case insensitive matching and \fB(?d)\fP to enable removing of ignored files in an otherwise empty directory.
  1383. .INDENT 0.0
  1384. .INDENT 3.5
  1385. .sp
  1386. .EX
  1387. {
  1388. \(dqignore\(dq: [
  1389. \(dq(?i)/Backups\(dq
  1390. ],
  1391. \(dqexpanded\(dq: [
  1392. \(dq(?i)Backups\(dq,
  1393. \(dq(?i)Backups/**\(dq
  1394. ]
  1395. }
  1396. .EE
  1397. .UNINDENT
  1398. .UNINDENT
  1399. .SS POST /rest/db/ignores
  1400. .sp
  1401. Expects a format similar to the output of \fI\%GET /rest/db/ignores\fP call, but only
  1402. containing the \fBignore\fP field (\fBexpanded\fP field should be omitted).
  1403. It takes one parameter, \fBfolder\fP, and either updates the content of
  1404. the \fB\&.stignore\fP echoing it back as a response, or returns an error.
  1405. .SS GET /rest/db/localchanged
  1406. .sp
  1407. Added in version 0.14.55.
  1408. .sp
  1409. Takes one mandatory parameter, \fBfolder\fP, and returns the list of files which
  1410. were changed locally in a receive\-only folder. Thus they differ from the global
  1411. state and could be reverted by pulling from remote devices again, see
  1412. \fI\%POST /rest/db/revert\fP\&.
  1413. .sp
  1414. The results can be paginated using the \fI\%common pagination parameters\fP\&.
  1415. .INDENT 0.0
  1416. .INDENT 3.5
  1417. .sp
  1418. .EX
  1419. {
  1420. \(dqfiles\(dq: [
  1421. {
  1422. \(dqflags\(dq: \(dq0755\(dq,
  1423. \(dqsequence\(dq: 6,
  1424. \(dqmodified\(dq: \(dq2015\-04\-20T23:06:12+09:00\(dq,
  1425. \(dqname\(dq: \(dqls\(dq,
  1426. \(dqsize\(dq: 34640,
  1427. \(dqversion\(dq: [
  1428. \(dq5157751870738175669:1\(dq
  1429. ]
  1430. }
  1431. ],
  1432. \(dqpage\(dq: 1,
  1433. \(dqperpage\(dq: 100
  1434. }
  1435. .EE
  1436. .UNINDENT
  1437. .UNINDENT
  1438. .sp
  1439. \fBNOTE:\fP
  1440. .INDENT 0.0
  1441. .INDENT 3.5
  1442. This is an expensive call, increasing CPU and RAM usage on the device.
  1443. Use sparingly.
  1444. .UNINDENT
  1445. .UNINDENT
  1446. .SS GET /rest/db/need
  1447. .sp
  1448. Takes one mandatory parameter, \fBfolder\fP, and returns lists of files which are
  1449. needed by this device in order for it to become in sync.
  1450. .sp
  1451. The results can be paginated using the \fI\%common pagination parameters\fP\&. Pagination happens, across the union of all needed files,
  1452. that is \- across all 3 sections of the response. For example, given the current
  1453. need state is as follows:
  1454. .INDENT 0.0
  1455. .IP 1. 3
  1456. \fBprogress\fP has 15 items
  1457. .IP 2. 3
  1458. \fBqueued\fP has 3 items
  1459. .IP 3. 3
  1460. \fBrest\fP has 12 items
  1461. .UNINDENT
  1462. .sp
  1463. If you issue a query with \fBpage=1\fP and \fBperpage=10\fP, only the \fBprogress\fP
  1464. section in the response will have 10 items. If you issue a request query with
  1465. \fBpage=2\fP and \fBperpage=10\fP, \fBprogress\fP section will have the last 5 items,
  1466. \fBqueued\fP section will have all 3 items, and \fBrest\fP section will have first
  1467. 2 items. If you issue a query for \fBpage=3\fP and \fBperpage=10\fP, you will only
  1468. have the last 10 items of the \fBrest\fP section.
  1469. .sp
  1470. \fBNOTE:\fP
  1471. .INDENT 0.0
  1472. .INDENT 3.5
  1473. Return format changed in version 0.14.43, removing the \fBtotal\fP count
  1474. attribute.
  1475. .UNINDENT
  1476. .UNINDENT
  1477. .INDENT 0.0
  1478. .INDENT 3.5
  1479. .sp
  1480. .EX
  1481. {
  1482. # Files currently being downloaded
  1483. \(dqprogress\(dq: [
  1484. {
  1485. \(dqflags\(dq: \(dq0755\(dq,
  1486. \(dqsequence\(dq: 6,
  1487. \(dqmodified\(dq: \(dq2015\-04\-20T23:06:12+09:00\(dq,
  1488. \(dqname\(dq: \(dqls\(dq,
  1489. \(dqsize\(dq: 34640,
  1490. \(dqversion\(dq: [
  1491. \(dq5157751870738175669:1\(dq
  1492. ]
  1493. }
  1494. ],
  1495. # Files queued to be downloaded next (as per array order)
  1496. \(dqqueued\(dq: [
  1497. ...
  1498. ],
  1499. # Files to be downloaded after all queued files will be downloaded.
  1500. # This happens when we start downloading files, and new files get added while we are downloading.
  1501. \(dqrest\(dq: [
  1502. ...
  1503. ],
  1504. \(dqpage\(dq: 1,
  1505. \(dqperpage\(dq: 100
  1506. }
  1507. .EE
  1508. .UNINDENT
  1509. .UNINDENT
  1510. .sp
  1511. \fBNOTE:\fP
  1512. .INDENT 0.0
  1513. .INDENT 3.5
  1514. This is an expensive call, increasing CPU and RAM usage on the device.
  1515. Use sparingly.
  1516. .UNINDENT
  1517. .UNINDENT
  1518. .SS POST /rest/db/override
  1519. .sp
  1520. Request override of a send only folder. Override means to make the local
  1521. version latest, overriding changes made on other devices. This API call does
  1522. nothing if the folder is not a send only folder.
  1523. .sp
  1524. Takes the mandatory parameter \fIfolder\fP (folder ID).
  1525. .INDENT 0.0
  1526. .INDENT 3.5
  1527. .sp
  1528. .EX
  1529. curl \-X POST \-H X\-API\-key:... http://127.0.0.1:8384/rest/db/override?folder=default
  1530. .EE
  1531. .UNINDENT
  1532. .UNINDENT
  1533. .SS POST /rest/db/prio
  1534. .sp
  1535. Moves the file to the top of the download queue.
  1536. .INDENT 0.0
  1537. .INDENT 3.5
  1538. .sp
  1539. .EX
  1540. curl \-X POST http://127.0.0.1:8384/rest/db/prio?folder=default&file=foo/bar
  1541. .EE
  1542. .UNINDENT
  1543. .UNINDENT
  1544. .sp
  1545. Response contains the same output as \fI\%GET /rest/db/need\fP\&.
  1546. .SS GET /rest/db/remoteneed
  1547. .sp
  1548. Added in version 0.14.43.
  1549. .sp
  1550. Takes the mandatory parameters \fBfolder\fP and \fBdevice\fP, and returns the list
  1551. of files which are needed by that remote device in order for it to become in
  1552. sync with the shared folder.
  1553. .sp
  1554. The results can be paginated using the \fI\%common pagination parameters\fP\&.
  1555. .INDENT 0.0
  1556. .INDENT 3.5
  1557. .sp
  1558. .EX
  1559. {
  1560. \(dqfiles\(dq: [
  1561. {
  1562. \(dqflags\(dq: \(dq0755\(dq,
  1563. \(dqsequence\(dq: 6,
  1564. \(dqmodified\(dq: \(dq2015\-04\-20T23:06:12+09:00\(dq,
  1565. \(dqname\(dq: \(dqls\(dq,
  1566. \(dqsize\(dq: 34640,
  1567. \(dqversion\(dq: [
  1568. \(dq5157751870738175669:1\(dq
  1569. ]
  1570. }
  1571. ],
  1572. \(dqpage\(dq: 1,
  1573. \(dqperpage\(dq: 100
  1574. }
  1575. .EE
  1576. .UNINDENT
  1577. .UNINDENT
  1578. .sp
  1579. \fBNOTE:\fP
  1580. .INDENT 0.0
  1581. .INDENT 3.5
  1582. This is an expensive call, increasing CPU and RAM usage on the device.
  1583. Use sparingly.
  1584. .UNINDENT
  1585. .UNINDENT
  1586. .SS POST /rest/db/revert
  1587. .sp
  1588. Added in version 0.14.50.
  1589. .sp
  1590. Request revert of a receive only folder. Reverting a folder means to undo
  1591. all local changes. This API call does nothing if the folder is not a receive
  1592. only folder.
  1593. .sp
  1594. Takes the mandatory parameter \fIfolder\fP (folder ID).
  1595. .INDENT 0.0
  1596. .INDENT 3.5
  1597. .sp
  1598. .EX
  1599. curl \-X POST \-H X\-API\-Key:... http://127.0.0.1:8384/rest/db/revert?folder=default
  1600. .EE
  1601. .UNINDENT
  1602. .UNINDENT
  1603. .SS POST /rest/db/scan
  1604. .sp
  1605. Request immediate scan. Takes the optional parameters \fBfolder\fP (folder ID),
  1606. \fBsub\fP (path relative to the folder root) and \fBnext\fP (time in seconds). If
  1607. \fBfolder\fP is omitted or empty all folders are scanned. If \fBsub\fP is given,
  1608. only this path (and children, in case it’s a directory) is scanned. The \fBnext\fP
  1609. argument delays Syncthing’s automated rescan interval for a given amount of
  1610. seconds.
  1611. .sp
  1612. Requesting scan of a path that no longer exists, but previously did, is
  1613. valid and will result in Syncthing noticing the deletion of the path in
  1614. question.
  1615. .sp
  1616. Returns status 200 and no content upon success, or status 500 and a
  1617. plain text error if an error occurred during scanning.
  1618. .INDENT 0.0
  1619. .INDENT 3.5
  1620. .sp
  1621. .EX
  1622. curl \-X POST http://127.0.0.1:8384/rest/db/scan?folder=default&sub=foo/bar
  1623. .EE
  1624. .UNINDENT
  1625. .UNINDENT
  1626. .SS GET /rest/db/status
  1627. .sp
  1628. Returns information about the current status of a folder.
  1629. .sp
  1630. Parameters: \fBfolder\fP, the ID of a folder.
  1631. .INDENT 0.0
  1632. .INDENT 3.5
  1633. .sp
  1634. .EX
  1635. {
  1636. \(dqglobalBytes\(dq: 0,
  1637. \(dqglobalDeleted\(dq: 0,
  1638. \(dqglobalDirectories\(dq: 0,
  1639. \(dqglobalFiles\(dq: 0,
  1640. \(dqglobalSymlinks\(dq: 0,
  1641. \(dqglobalTotalItems\(dq: 0,
  1642. \(dqignorePatterns\(dq: false,
  1643. \(dqinSyncBytes\(dq: 0,
  1644. \(dqinSyncFiles\(dq: 0,
  1645. \(dqinvalid\(dq: \(dq\(dq,
  1646. \(dqlocalBytes\(dq: 0,
  1647. \(dqlocalDeleted\(dq: 0,
  1648. \(dqlocalDirectories\(dq: 0,
  1649. \(dqlocalFiles\(dq: 0,
  1650. \(dqlocalSymlinks\(dq: 0,
  1651. \(dqlocalTotalItems\(dq: 0,
  1652. \(dqneedBytes\(dq: 0,
  1653. \(dqneedDeletes\(dq: 0,
  1654. \(dqneedDirectories\(dq: 0,
  1655. \(dqneedFiles\(dq: 0,
  1656. \(dqneedSymlinks\(dq: 0,
  1657. \(dqneedTotalItems\(dq: 0,
  1658. \(dqpullErrors\(dq: 0,
  1659. \(dqreceiveOnlyChangedBytes\(dq: 0,
  1660. \(dqreceiveOnlyChangedDeletes\(dq: 0,
  1661. \(dqreceiveOnlyChangedDirectories\(dq: 0,
  1662. \(dqreceiveOnlyChangedFiles\(dq: 0,
  1663. \(dqreceiveOnlyChangedSymlinks\(dq: 0,
  1664. \(dqreceiveOnlyTotalItems\(dq: 0,
  1665. \(dqsequence\(dq: 0,
  1666. \(dqstate\(dq: \(dqidle\(dq,
  1667. \(dqstateChanged\(dq: \(dq2018\-08\-08T07:04:57.301064781+02:00\(dq,
  1668. \(dqversion\(dq: 0
  1669. }
  1670. .EE
  1671. .UNINDENT
  1672. .UNINDENT
  1673. .sp
  1674. The various fields have the following meaning:
  1675. .INDENT 0.0
  1676. .TP
  1677. .B global*:
  1678. Data in the cluster latest version.
  1679. .TP
  1680. .B inSync*:
  1681. Data that is locally the same as the cluster latest version.
  1682. .TP
  1683. .B local*:
  1684. Data that is locally present, regardless of whether it’s the same or different version as the cluster latest version.
  1685. .TP
  1686. .B need*:
  1687. Data that is needed to become up to date with the cluster latest version (i.e., data that is out of sync).
  1688. .TP
  1689. .B receiveOnlyChanged*:
  1690. Data that has changed locally in a receive only folder, and thus not been sent to the cluster.
  1691. .TP
  1692. .B invalid:
  1693. Deprecated, always empty.
  1694. .TP
  1695. .B pullErrors:
  1696. The number of files that failed to sync during the last sync operations.
  1697. .TP
  1698. .B sequence:
  1699. The current folder sequence number.
  1700. .TP
  1701. .B state:
  1702. The current folder state.
  1703. .TP
  1704. .B stateChanged:
  1705. When the folder state last changed.
  1706. .TP
  1707. .B version:
  1708. Deprecated, equivalent to the sequence number.
  1709. .UNINDENT
  1710. .sp
  1711. \fBNOTE:\fP
  1712. .INDENT 0.0
  1713. .INDENT 3.5
  1714. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  1715. .UNINDENT
  1716. .UNINDENT
  1717. .SH EVENT ENDPOINTS
  1718. .SS GET /rest/events
  1719. .sp
  1720. To receive events, perform a HTTP GET of \fB/rest/events\fP\&.
  1721. .sp
  1722. To filter the event list, in effect creating a specific subscription for only
  1723. the desired event types, add a parameter \fBevents=EventTypeA,EventTypeB,...\fP
  1724. where the event types are any of the \fI\%Event Types\fP\&. If no filter is
  1725. specified, all events \fIexcept\fP \fI\%LocalChangeDetected\fP and
  1726. \fI\%RemoteChangeDetected\fP are included.
  1727. .sp
  1728. The optional parameter \fBsince=<lastSeenID>\fP sets the ID of the last event
  1729. you’ve already seen. Syncthing returns a JSON encoded array of event objects,
  1730. starting at the event just after the one with this last seen ID. The default
  1731. value is 0, which returns all events. There is a limit to the number of events
  1732. buffered, so if the rate of events is high or the time between polling calls is
  1733. long some events might be missed. This can be detected by noting a discontinuity
  1734. in the event IDs.
  1735. .sp
  1736. If no new events are produced since \fB<lastSeenID>\fP, the HTTP call blocks and
  1737. waits for new events to happen before returning. If \fB<lastSeenID>\fP is a
  1738. future ID, the HTTP call blocks until such ID is reached or timeouts. By
  1739. default it times out after 60 seconds returning an empty array. The time out
  1740. duration can be customized with the optional parameter \fBtimeout=<seconds>\fP\&.
  1741. .sp
  1742. To receive only a limited number of events, add the \fBlimit=<n>\fP parameter with a
  1743. suitable value for \fBn\fP and only the \fIlast\fP \fBn\fP events will be returned. This
  1744. can be used to catch up with the latest event ID after a disconnection for
  1745. example: \fB/rest/events?since=0&limit=1\fP\&.
  1746. .SS GET /rest/events/disk
  1747. .sp
  1748. This convenience endpoint provides the same event stream, but pre\-filtered to show
  1749. only \fI\%LocalChangeDetected\fP and \fI\%RemoteChangeDetected\fP
  1750. event types. The \fBevents\fP parameter is not used.
  1751. .SH STATISTICS ENDPOINTS
  1752. .SS GET /rest/stats/device
  1753. .sp
  1754. Returns general statistics about devices. Currently, only contains the
  1755. time the device was last seen and the last connection duration.
  1756. .INDENT 0.0
  1757. .INDENT 3.5
  1758. .sp
  1759. .EX
  1760. $ curl \-s http://localhost:8384/rest/stats/device | json
  1761. {
  1762. \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
  1763. \(dqlastSeen\(dq : \(dq2015\-04\-18T11:21:31.3256277+01:00\(dq
  1764. \(dqlastConnectionDurationS\(dq: 556335.421708141
  1765. }
  1766. }
  1767. .EE
  1768. .UNINDENT
  1769. .UNINDENT
  1770. .SS GET /rest/stats/folder
  1771. .sp
  1772. Returns general statistics about folders. Currently contains the
  1773. last scan time and the last synced file.
  1774. .INDENT 0.0
  1775. .INDENT 3.5
  1776. .sp
  1777. .EX
  1778. {
  1779. \(dqfolderid\(dq: {
  1780. \(dqlastScan\(dq: \(dq2016\-06\-02T13:28:01.288181412\-04:00\(dq,
  1781. \(dqlastFile\(dq: {
  1782. \(dqfilename\(dq: \(dqfile/name\(dq,
  1783. \(dqat\(dq: \(dq2015\-04\-16T22:04:18.3066971+01:00\(dq
  1784. }
  1785. }
  1786. }
  1787. .EE
  1788. .UNINDENT
  1789. .UNINDENT
  1790. .SH MISC SERVICES ENDPOINTS
  1791. .SS GET /rest/svc/deviceid
  1792. .sp
  1793. Verifies and formats a device ID. Accepts all currently valid formats
  1794. (52 or 56 characters with or without separators, upper or lower case,
  1795. with trivial substitutions). Takes one parameter, \fBid\fP, and returns
  1796. either a valid device ID in modern format, or an error.
  1797. .INDENT 0.0
  1798. .INDENT 3.5
  1799. .sp
  1800. .EX
  1801. $ curl \-s http://localhost:8384/rest/svc/deviceid?id=1234 | json
  1802. {
  1803. \(dqerror\(dq: \(dqdevice ID invalid: incorrect length\(dq
  1804. }
  1805. $ curl \-s http://localhost:8384/rest/svc/deviceid?id=p56ioi7m\-\-zjnu2iq\-gdr\-eydm\-2mgtmgl3bxnpq6w5btbbz4tjxzwicq | json
  1806. {
  1807. \(dqid\(dq: \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq
  1808. }
  1809. .EE
  1810. .UNINDENT
  1811. .UNINDENT
  1812. .SS GET /rest/svc/lang
  1813. .sp
  1814. Returns a list of canonicalized localization codes, as picked up from
  1815. the \fBAccept\-Language\fP header sent by the browser.
  1816. .INDENT 0.0
  1817. .INDENT 3.5
  1818. .sp
  1819. .EX
  1820. [\(dqsv_sv\(dq,\(dqsv\(dq,\(dqen_us\(dq,\(dqen\(dq]
  1821. .EE
  1822. .UNINDENT
  1823. .UNINDENT
  1824. .SS GET /rest/svc/random/string
  1825. .sp
  1826. Returns a strong random generated string (alphanumeric) of the specified length. Takes the \fBlength\fP parameter.
  1827. .INDENT 0.0
  1828. .INDENT 3.5
  1829. .sp
  1830. .EX
  1831. {
  1832. \(dqrandom\(dq: \(dqFdPaEaZQ56sXEKYNxpgF\(dq
  1833. }
  1834. .EE
  1835. .UNINDENT
  1836. .UNINDENT
  1837. .SS GET /rest/svc/report
  1838. .sp
  1839. Returns the data sent in the anonymous usage report.
  1840. .INDENT 0.0
  1841. .INDENT 3.5
  1842. .sp
  1843. .EX
  1844. {
  1845. \(dqfolderMaxMiB\(dq : 0,
  1846. \(dqplatform\(dq : \(dqlinux\-amd64\(dq,
  1847. \(dqtotMiB\(dq : 0,
  1848. \(dqlongVersion\(dq : \(dqsyncthing v0.12.2 \e\(dqBeryllium Bedbug\e\(dq (go1.4.3 linux\-amd64 default) unknown\[email protected] 2015\-11\-09 13:23:26 UTC\(dq,
  1849. \(dqupgradeAllowedManual\(dq : true,
  1850. \(dqtotFiles\(dq : 3,
  1851. \(dqfolderUses\(dq : {
  1852. \(dqignorePerms\(dq : 0,
  1853. \(dqautoNormalize\(dq : 0,
  1854. \(dqsendonly\(dq : 0,
  1855. \(dqignoreDelete\(dq : 0
  1856. },
  1857. \(dqmemoryUsageMiB\(dq : 13,
  1858. \(dqversion\(dq : \(dqv0.12.2\(dq,
  1859. \(dqsha256Perf\(dq : 27.28,
  1860. \(dqnumFolders\(dq : 2,
  1861. \(dqmemorySize\(dq : 1992,
  1862. \(dqannounce\(dq : {
  1863. \(dqdefaultServersIP\(dq : 0,
  1864. \(dqotherServers\(dq : 0,
  1865. \(dqglobalEnabled\(dq : false,
  1866. \(dqdefaultServersDNS\(dq : 1,
  1867. \(dqlocalEnabled\(dq : false
  1868. },
  1869. \(dqusesRateLimit\(dq : false,
  1870. \(dqnumCPU\(dq : 2,
  1871. \(dquniqueID\(dq : \(dq\(dq,
  1872. \(dqurVersion\(dq : 2,
  1873. \(dqrescanIntvs\(dq : [
  1874. 60,
  1875. 60
  1876. ],
  1877. \(dqnumDevices\(dq : 2,
  1878. \(dqfolderMaxFiles\(dq : 3,
  1879. \(dqrelays\(dq : {
  1880. \(dqdefaultServers\(dq : 1,
  1881. \(dqenabled\(dq : true,
  1882. \(dqotherServers\(dq : 0
  1883. },
  1884. \(dqdeviceUses\(dq : {
  1885. \(dqcompressMetadata\(dq : 1,
  1886. \(dqcustomCertName\(dq : 0,
  1887. \(dqstaticAddr\(dq : 1,
  1888. \(dqcompressAlways\(dq : 0,
  1889. \(dqcompressNever\(dq : 1,
  1890. \(dqintroducer\(dq : 0,
  1891. \(dqdynamicAddr\(dq : 1
  1892. },
  1893. \(dqupgradeAllowedAuto\(dq : false
  1894. }
  1895. .EE
  1896. .UNINDENT
  1897. .UNINDENT
  1898. .SH DEBUG ENDPOINTS
  1899. .SS Debug Endpoints
  1900. .sp
  1901. These endpoints require the \fI\%gui.debugging\fP configuration option to
  1902. be enabled and yield an access denied error code otherwise.
  1903. .SS GET /rest/debug/peerCompletion
  1904. .sp
  1905. Summarizes the completion percentage for each remote device. Returns an object
  1906. with device IDs as keys and an integer percentage as values.
  1907. .SS GET /rest/debug/httpmetrics
  1908. .sp
  1909. Returns statistics about each served REST API endpoint, to diagnose how much
  1910. time was spent generating the responses.
  1911. .SS GET /rest/debug/cpuprof
  1912. .sp
  1913. Used to capture a profile of what Syncthing is doing on the CPU. See
  1914. \fI\%Profiling\fP\&.
  1915. .SS GET /rest/debug/heapprof
  1916. .sp
  1917. Used to capture a profile of what Syncthing is doing with the heap memory. See
  1918. \fI\%Profiling\fP\&.
  1919. .SS GET /rest/debug/support
  1920. .sp
  1921. Collects information about the running instance for troubleshooting purposes.
  1922. Returns a “support bundle” as a zipped archive, which should be sent to the
  1923. developers after verifying it contains no sensitive personal information.
  1924. Credentials for the web GUI and the API key are automatically redacted already.
  1925. .SS GET /rest/debug/file
  1926. .sp
  1927. Shows diagnostics about a certain file in a shared folder. Takes the \fBfolder\fP
  1928. (folder ID) and \fBfile\fP (folder relative path) parameters.
  1929. .INDENT 0.0
  1930. .INDENT 3.5
  1931. .sp
  1932. .EX
  1933. $ curl \-H X\-API\-Key:... \(dqhttp://localhost:8384/rest/debug/file?folder=default&file=foo/bar\(dq
  1934. .EE
  1935. .UNINDENT
  1936. .UNINDENT
  1937. .sp
  1938. The returned object contains the same info as \fI\%GET /rest/db/file\fP, plus a summary
  1939. of \fBglobalVersions\fP\&.
  1940. .SH NOAUTH ENDPOINTS
  1941. .sp
  1942. Calls that do not require authentication.
  1943. .SS GET /rest/noauth/health
  1944. .sp
  1945. Returns a \fB{\(dqstatus\(dq: \(dqOK\(dq}\fP object.
  1946. .INDENT 0.0
  1947. .INDENT 3.5
  1948. .sp
  1949. .EX
  1950. {
  1951. \(dqstatus\(dq: \(dqOK\(dq
  1952. }
  1953. .EE
  1954. .UNINDENT
  1955. .UNINDENT
  1956. .SH AUTHOR
  1957. The Syncthing Authors
  1958. .SH COPYRIGHT
  1959. 2014-2019, The Syncthing Authors
  1960. .\" Generated by docutils manpage writer.
  1961. .