syncthing-rest-api.7 60 KB

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