syncthing-rest-api.7 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972
  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" "Sep 04, 2024" "v1.27.11" "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. \(dqinsecureAllowOldTLSVersions\(dq: false
  281. },
  282. \(dqremoteIgnoredDevices\(dq: [
  283. {
  284. \(dqtime\(dq: \(dq2022\-01\-09T20:02:01Z\(dq,
  285. \(dqdeviceID\(dq: \(dq...\(dq,
  286. \(dqname\(dq: \(dq...\(dq,
  287. \(dqaddress\(dq: \(dq192.168.0.20:22000\(dq
  288. }
  289. ],
  290. \(dqdefaults\(dq: {
  291. \(dqfolder\(dq: {
  292. \(dqid\(dq: \(dq\(dq,
  293. \(dqlabel\(dq: \(dq\(dq,
  294. \(dqfilesystemType\(dq: \(dqbasic\(dq,
  295. \(dqpath\(dq: \(dq~\(dq,
  296. \(dqtype\(dq: \(dqsendreceive\(dq,
  297. \(dqdevices\(dq: [
  298. {
  299. \(dqdeviceID\(dq: \(dq...\(dq,
  300. \(dqintroducedBy\(dq: \(dq\(dq,
  301. \(dqencryptionPassword\(dq: \(dq\(dq
  302. }
  303. ],
  304. \(dqrescanIntervalS\(dq: 3600,
  305. \(dqfsWatcherEnabled\(dq: true,
  306. \(dqfsWatcherDelayS\(dq: 10,
  307. \(dqignorePerms\(dq: false,
  308. \(dqautoNormalize\(dq: true,
  309. \(dqminDiskFree\(dq: {
  310. \(dqvalue\(dq: 1,
  311. \(dqunit\(dq: \(dq%\(dq
  312. },
  313. \(dqversioning\(dq: {
  314. \(dqtype\(dq: \(dq\(dq,
  315. \(dqparams\(dq: {},
  316. \(dqcleanupIntervalS\(dq: 3600,
  317. \(dqfsPath\(dq: \(dq\(dq,
  318. \(dqfsType\(dq: \(dqbasic\(dq
  319. },
  320. \(dqcopiers\(dq: 0,
  321. \(dqpullerMaxPendingKiB\(dq: 0,
  322. \(dqhashers\(dq: 0,
  323. \(dqorder\(dq: \(dqrandom\(dq,
  324. \(dqignoreDelete\(dq: false,
  325. \(dqscanProgressIntervalS\(dq: 0,
  326. \(dqpullerPauseS\(dq: 0,
  327. \(dqmaxConflicts\(dq: 10,
  328. \(dqdisableSparseFiles\(dq: false,
  329. \(dqdisableTempIndexes\(dq: false,
  330. \(dqpaused\(dq: false,
  331. \(dqweakHashThresholdPct\(dq: 25,
  332. \(dqmarkerName\(dq: \(dq.stfolder\(dq,
  333. \(dqcopyOwnershipFromParent\(dq: false,
  334. \(dqmodTimeWindowS\(dq: 0,
  335. \(dqmaxConcurrentWrites\(dq: 2,
  336. \(dqdisableFsync\(dq: false,
  337. \(dqblockPullOrder\(dq: \(dqstandard\(dq,
  338. \(dqcopyRangeMethod\(dq: \(dqstandard\(dq,
  339. \(dqcaseSensitiveFS\(dq: false,
  340. \(dqjunctionsAsDirs\(dq: false
  341. },
  342. \(dqdevice\(dq: {
  343. \(dqdeviceID\(dq: \(dq\(dq,
  344. \(dqname\(dq: \(dq\(dq,
  345. \(dqaddresses\(dq: [
  346. \(dqdynamic\(dq
  347. ],
  348. \(dqcompression\(dq: \(dqmetadata\(dq,
  349. \(dqcertName\(dq: \(dq\(dq,
  350. \(dqintroducer\(dq: false,
  351. \(dqskipIntroductionRemovals\(dq: false,
  352. \(dqintroducedBy\(dq: \(dq\(dq,
  353. \(dqpaused\(dq: false,
  354. \(dqallowedNetworks\(dq: [],
  355. \(dqautoAcceptFolders\(dq: false,
  356. \(dqmaxSendKbps\(dq: 0,
  357. \(dqmaxRecvKbps\(dq: 0,
  358. \(dqignoredFolders\(dq: [],
  359. \(dqmaxRequestKiB\(dq: 0,
  360. \(dquntrusted\(dq: false,
  361. \(dqremoteGUIPort\(dq: 0
  362. }
  363. }
  364. }
  365. .EE
  366. .UNINDENT
  367. .UNINDENT
  368. .SS GET /rest/system/config/insync (DEPRECATED)
  369. .sp
  370. Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use
  371. \fI\%/rest/config/restart\-required\fP instead.
  372. .sp
  373. Returns whether the config is in sync, i.e. whether the running
  374. configuration is the same as that on disk.
  375. .INDENT 0.0
  376. .INDENT 3.5
  377. .sp
  378. .EX
  379. {
  380. \(dqconfigInSync\(dq: true
  381. }
  382. .EE
  383. .UNINDENT
  384. .UNINDENT
  385. .SS POST /rest/system/config (DEPRECATED)
  386. .sp
  387. Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use \fI\%Config Endpoints\fP
  388. instead.
  389. .sp
  390. Post the full contents of the configuration, in the same format as returned by
  391. the corresponding GET request. When posting the configuration succeeds,
  392. the posted configuration is immediately applied, except for changes that require a restart. Query
  393. \fI\%/rest/config/restart\-required\fP to check if a restart is required.
  394. .sp
  395. This endpoint is the main point to control Syncthing, even if the change only
  396. concerns a very small part of the config: The usual workflow is to get the
  397. config, modify the needed parts and post it again.
  398. .SS GET /rest/system/connections
  399. .sp
  400. \fBNOTE:\fP
  401. .INDENT 0.0
  402. .INDENT 3.5
  403. Return format changed in versions 0.13.0, 1.19.0 and 1.23.0.
  404. .UNINDENT
  405. .UNINDENT
  406. .sp
  407. Returns the list of configured devices and some metadata associated
  408. with them. The list also contains the local device itself as not connected.
  409. .sp
  410. The connection types are \fBTCP (Client)\fP, \fBTCP (Server)\fP, \fBRelay (Client)\fP and \fBRelay (Server)\fP\&.
  411. .INDENT 0.0
  412. .INDENT 3.5
  413. .sp
  414. .EX
  415. {
  416. \(dqconnections\(dq: {
  417. \(dqDOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA\(dq: {
  418. \(dqaddress\(dq: \(dq\(dq,
  419. \(dqat\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  420. \(dqclientVersion\(dq: \(dq\(dq,
  421. \(dqconnected\(dq: false,
  422. \(dqinBytesTotal\(dq: 0,
  423. \(dqisLocal\(dq: false,
  424. \(dqoutBytesTotal\(dq: 0,
  425. \(dqpaused\(dq: false,
  426. \(dqstartedAt\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  427. \(dqtype\(dq: \(dq\(dq
  428. },
  429. \(dqUYGDMA4\-TPHOFO5\-2VQYDCC\-7CWX7XW\-INZINQT\-LE4B42N\-4JUZTSM\-IWCSXA4\(dq: {
  430. \(dqaddress\(dq: \(dq\(dq,
  431. \(dqat\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  432. \(dqclientVersion\(dq: \(dq\(dq,
  433. \(dqconnected\(dq: false,
  434. \(dqinBytesTotal\(dq: 0,
  435. \(dqisLocal\(dq: false,
  436. \(dqoutBytesTotal\(dq: 0,
  437. \(dqpaused\(dq: false,
  438. \(dqstartedAt\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  439. \(dqtype\(dq: \(dq\(dq
  440. },
  441. \(dqYZJBJFX\-RDBL7WY\-6ZGKJ2D\-4MJB4E7\-ZATSDUY\-LD6Y3L3\-MLFUYWE\-AEMXJAC\(dq: {
  442. \(dqaddress\(dq: \(dq127.0.0.1:22002\(dq,
  443. \(dqat\(dq: \(dq2015\-11\-07T17:29:47.691548971+01:00\(dq,
  444. \(dqclientVersion\(dq: \(dqv0.12.1\(dq,
  445. \(dqconnected\(dq: true,
  446. \(dqinBytesTotal\(dq: 556,
  447. \(dqisLocal\(dq: true,
  448. \(dqoutBytesTotal\(dq: 550,
  449. \(dqpaused\(dq: false,
  450. \(dqstartedAt\(dq: \(dq2015\-11\-07T00:09:47Z\(dq,
  451. \(dqtype\(dq: \(dqTCP (Client)\(dq
  452. }
  453. },
  454. \(dqtotal\(dq: {
  455. \(dqat\(dq: \(dq2015\-11\-07T17:29:47.691637262+01:00\(dq,
  456. \(dqinBytesTotal\(dq: 1479,
  457. \(dqoutBytesTotal\(dq: 1318
  458. }
  459. }
  460. .EE
  461. .UNINDENT
  462. .UNINDENT
  463. .SS GET /rest/system/debug
  464. .sp
  465. Added in version 0.12.0.
  466. .sp
  467. Returns the set of debug facilities and which of them are currently enabled.
  468. .INDENT 0.0
  469. .INDENT 3.5
  470. .sp
  471. .EX
  472. {
  473. \(dqenabled\(dq: [
  474. \(dqbeacon\(dq
  475. ],
  476. \(dqfacilities\(dq: {
  477. \(dqbeacon\(dq: \(dqMulticast and broadcast discovery\(dq,
  478. \(dqconfig\(dq: \(dqConfiguration loading and saving\(dq,
  479. \(dqconnections\(dq: \(dqConnection handling\(dq,
  480. \(dqdb\(dq: \(dqThe database layer\(dq,
  481. \(dqdialer\(dq: \(dqDialing connections\(dq,
  482. \(dqdiscover\(dq: \(dqRemote device discovery\(dq,
  483. \(dqevents\(dq: \(dqEvent generation and logging\(dq,
  484. \(dqhttp\(dq: \(dqREST API\(dq,
  485. \(dqmain\(dq: \(dqMain package\(dq,
  486. \(dqmodel\(dq: \(dqThe root hub\(dq,
  487. \(dqprotocol\(dq: \(dqThe BEP protocol\(dq,
  488. \(dqrelay\(dq: \(dqRelay connection handling\(dq,
  489. \(dqscanner\(dq: \(dqFile change detection and hashing\(dq,
  490. \(dqstats\(dq: \(dqPersistent device and folder statistics\(dq,
  491. \(dqsync\(dq: \(dqMutexes\(dq,
  492. \(dqupgrade\(dq: \(dqBinary upgrades\(dq,
  493. \(dqupnp\(dq: \(dqUPnP discovery and port mapping\(dq,
  494. \(dqversioner\(dq: \(dqFile versioning\(dq
  495. }
  496. }
  497. .EE
  498. .UNINDENT
  499. .UNINDENT
  500. .SS POST /rest/system/debug
  501. .sp
  502. Added in version 0.12.0.
  503. .sp
  504. Enables or disables debugging for specified facilities. Give one or both of
  505. \fBenable\fP and \fBdisable\fP query parameters, with comma separated facility
  506. names. To disable debugging of the beacon and discovery packages, and enable it
  507. for config and db:
  508. .INDENT 0.0
  509. .INDENT 3.5
  510. .sp
  511. .EX
  512. $ curl \-H X\-API\-Key:abc123 \-X POST \(aqhttp://localhost:8384/rest/system/debug?disable=beacon,discovery&enable=config,db\(aq
  513. .EE
  514. .UNINDENT
  515. .UNINDENT
  516. .SS GET /rest/system/discovery
  517. .sp
  518. Returns the contents of the local discovery cache.
  519. .INDENT 0.0
  520. .INDENT 3.5
  521. .sp
  522. .EX
  523. {
  524. \(dqLGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\(dq: [
  525. \(dq192.162.129.11:22000\(dq
  526. ]
  527. }
  528. .EE
  529. .UNINDENT
  530. .UNINDENT
  531. .SS POST /rest/system/discovery
  532. .sp
  533. \fBNOTE:\fP
  534. .INDENT 0.0
  535. .INDENT 3.5
  536. Removed in v0.12.0.
  537. .UNINDENT
  538. .UNINDENT
  539. .sp
  540. Post with the query parameters \fBdevice\fP and \fBaddr\fP to add entries to
  541. the discovery cache.
  542. .INDENT 0.0
  543. .INDENT 3.5
  544. .sp
  545. .EX
  546. curl \-X POST http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e&addr=192.162.129.11:22000
  547. # Or with the X\-API\-Key header:
  548. 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
  549. .EE
  550. .UNINDENT
  551. .UNINDENT
  552. .SS POST /rest/system/error/clear
  553. .sp
  554. Post with empty to body to remove all recent errors.
  555. .SS GET /rest/system/error
  556. .sp
  557. \fBNOTE:\fP
  558. .INDENT 0.0
  559. .INDENT 3.5
  560. Return format changed in 0.12.0.
  561. .UNINDENT
  562. .UNINDENT
  563. .sp
  564. Returns the list of recent errors.
  565. .INDENT 0.0
  566. .INDENT 3.5
  567. .sp
  568. .EX
  569. {
  570. \(dqerrors\(dq: [
  571. {
  572. \(dqwhen\(dq: \(dq2014\-09\-18T12:59:26.549953186+02:00\(dq,
  573. \(dqmessage\(dq: \(dqThis is an error string\(dq
  574. }
  575. ]
  576. }
  577. .EE
  578. .UNINDENT
  579. .UNINDENT
  580. .SS POST /rest/system/error
  581. .sp
  582. Post with an error message in the body (plain text) to register a new
  583. error. The new error will be displayed on any active GUI clients.
  584. .SS GET /rest/system/log
  585. .sp
  586. Added in version 0.12.0.
  587. .sp
  588. Returns the list of recent log entries. The optional \fBsince\fP parameter limits
  589. 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.
  590. .INDENT 0.0
  591. .INDENT 3.5
  592. .sp
  593. .EX
  594. {
  595. \(dqmessages\(dq: [
  596. {
  597. \(dqwhen\(dq: \(dq2014\-09\-18T12:59:26.549953186+02:00\(dq,
  598. \(dqmessage\(dq: \(dqThis is a log entry\(dq
  599. }
  600. ]
  601. }
  602. .EE
  603. .UNINDENT
  604. .UNINDENT
  605. .SS GET /rest/system/log.txt
  606. .sp
  607. Returns the same information, formatted as a text log instead of a JSON object.
  608. .SS GET /rest/system/paths
  609. .sp
  610. Added in version 1.21.0.
  611. .sp
  612. Returns the path locations used internally for storing configuration, database,
  613. and others.
  614. .INDENT 0.0
  615. .INDENT 3.5
  616. .sp
  617. .EX
  618. {
  619. \(dqauditLog\(dq: \(dq/home/user/.local/share/syncthing/audit\-${timestamp}.log\(dq,
  620. \(dqbaseDir\-config\(dq: \(dq/home/user/.config/syncthing\(dq,
  621. \(dqbaseDir\-data\(dq: \(dq/home/user/.local/share/syncthing\(dq,
  622. \(dqbaseDir\-userHome\(dq: \(dq/home/user\(dq,
  623. \(dqcertFile\(dq: \(dq/home/user/.config/syncthing/cert.pem\(dq,
  624. \(dqconfig\(dq: \(dq/home/user/.config/syncthing/config.xml\(dq,
  625. \(dqcsrfTokens\(dq: \(dq/home/user/.config/syncthing/csrftokens.txt\(dq,
  626. \(dqdatabase\(dq: \(dq/home/user/.local/share/syncthing/index\-v0.14.0.db\(dq,
  627. \(dqdefFolder\(dq: \(dq/home/user/Sync\(dq,
  628. \(dqguiAssets\(dq: \(dq/home/user/src/syncthing/gui\(dq,
  629. \(dqhttpsCertFile\(dq: \(dq/home/user/.config/syncthing/https\-cert.pem\(dq,
  630. \(dqhttpsKeyFile\(dq: \(dq/home/user/.config/syncthing/https\-key.pem\(dq,
  631. \(dqkeyFile\(dq: \(dq/home/user/.config/syncthing/key.pem\(dq,
  632. \(dqlogFile\(dq: \(dq\-\(dq,
  633. \(dqpanicLog\(dq: \(dq/home/user/.local/share/syncthing/panic\-${timestamp}.log\(dq
  634. }
  635. .EE
  636. .UNINDENT
  637. .UNINDENT
  638. .SS POST /rest/system/pause
  639. .sp
  640. Pause the given device or all devices.
  641. .sp
  642. Takes the optional parameter \fBdevice\fP (device ID). When omitted,
  643. pauses all devices. Returns status 200 and no content upon success, or status
  644. 500 and a plain text error on failure.
  645. .SS GET /rest/system/ping
  646. .sp
  647. Returns a \fB{\(dqping\(dq: \(dqpong\(dq}\fP object.
  648. .INDENT 0.0
  649. .INDENT 3.5
  650. .sp
  651. .EX
  652. {
  653. \(dqping\(dq: \(dqpong\(dq
  654. }
  655. .EE
  656. .UNINDENT
  657. .UNINDENT
  658. .SS POST /rest/system/ping
  659. .sp
  660. Returns a \fB{\(dqping\(dq: \(dqpong\(dq}\fP object.
  661. .SS POST /rest/system/reset
  662. .sp
  663. Post with empty body to erase the current index database and restart
  664. Syncthing. With no query parameters, the entire database is erased from disk.
  665. By specifying the \fBfolder\fP parameter with a valid folder ID, only
  666. information for that folder will be erased:
  667. .INDENT 0.0
  668. .INDENT 3.5
  669. .sp
  670. .EX
  671. curl \-X POST \-H \(dqX\-API\-Key: abc123\(dq http://localhost:8384/rest/system/reset?folder=ab1c2\-def3g
  672. .EE
  673. .UNINDENT
  674. .UNINDENT
  675. .sp
  676. \fBCaution\fP: See \fI\%\-\-reset\-database\fP for \fB\&.stfolder\fP creation
  677. side\-effect and caution regarding mountpoints.
  678. .SS POST /rest/system/restart
  679. .sp
  680. Post with empty body to immediately restart Syncthing.
  681. .SS POST /rest/system/resume
  682. .sp
  683. Resume the given device or all devices.
  684. .sp
  685. Takes the optional parameter \fBdevice\fP (device ID). When omitted,
  686. resumes all devices. Returns status 200 and no content upon success, or status
  687. 500 and a plain text error on failure.
  688. .SS POST /rest/system/shutdown
  689. .sp
  690. Post with empty body to cause Syncthing to exit and not restart.
  691. .SS GET /rest/system/status
  692. .sp
  693. Returns information about current system status and resource usage. The CPU percent value has been deprecated from the API and will always report 0.
  694. .INDENT 0.0
  695. .INDENT 3.5
  696. .sp
  697. .EX
  698. {
  699. \(dqalloc\(dq: 30618136,
  700. \(dqconnectionServiceStatus\(dq: {
  701. \(dqdynamic+https://relays.syncthing.net/endpoint\(dq: {
  702. \(dqerror\(dq: null,
  703. \(dqlanAddresses\(dq: [
  704. \(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
  705. ],
  706. \(dqwanAddresses\(dq: [
  707. \(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
  708. ]
  709. },
  710. \(dqtcp://0.0.0.0:22000\(dq: {
  711. \(dqerror\(dq: null,
  712. \(dqlanAddresses\(dq: [
  713. \(dqtcp://0.0.0.0:22000\(dq
  714. ],
  715. \(dqwanAddresses\(dq: [
  716. \(dqtcp://0.0.0.0:22000\(dq
  717. ]
  718. }
  719. },
  720. \(dqcpuPercent\(dq: 0,
  721. \(dqdiscoveryEnabled\(dq: true,
  722. \(dqdiscoveryErrors\(dq: {
  723. \(dqglobal@https://discovery\-v4\-1.syncthing.net/v2/\(dq: \(dq500 Internal Server Error\(dq,
  724. \(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,
  725. \(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,
  726. \(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,
  727. \(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,
  728. \(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
  729. },
  730. \(dqdiscoveryStatus\(dq: {
  731. \(dqIPv4 local\(dq: {
  732. \(dqerror\(dq: null
  733. },
  734. \(dqIPv6 local\(dq: {
  735. \(dqerror\(dq: null
  736. },
  737. \(dqglobal@https://discovery\-v4\-1.syncthing.net/v2/\(dq: {
  738. \(dqerror\(dq: \(dq500 Internal Server Error\(dq
  739. },
  740. \(dqglobal@https://discovery\-v4\-2.syncthing.net/v2/\(dq: {
  741. \(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
  742. },
  743. \(dqglobal@https://discovery\-v4\-3.syncthing.net/v2/\(dq: {
  744. \(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
  745. },
  746. \(dqglobal@https://discovery\-v6\-1.syncthing.net/v2/\(dq: {
  747. \(dqerror\(dq: \(dqPost https://discovery\-v6\-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host\(dq
  748. },
  749. \(dqglobal@https://discovery\-v6\-2.syncthing.net/v2/\(dq: {
  750. \(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
  751. },
  752. \(dqglobal@https://discovery\-v6\-3.syncthing.net/v2/\(dq: {
  753. \(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
  754. }
  755. },
  756. \(dqdiscoveryMethods\(dq: 8,
  757. \(dqgoroutines\(dq: 49,
  758. \(dqlastDialStatus\(dq: {
  759. \(dqtcp://10.20.30.40\(dq: {
  760. \(dqwhen\(dq: \(dq2019\-05\-16T07:41:23Z\(dq,
  761. \(dqerror\(dq: \(dqdial tcp 10.20.30.40:22000: i/o timeout\(dq
  762. },
  763. \(dqtcp://172.16.33.3:22000\(dq: {
  764. \(dqwhen\(dq: \(dq2019\-05\-16T07:40:43Z\(dq,
  765. \(dqok\(dq: true
  766. },
  767. \(dqtcp://83.233.120.221:22000\(dq: {
  768. \(dqwhen\(dq: \(dq2019\-05\-16T07:41:13Z\(dq,
  769. \(dqerror\(dq: \(dqdial tcp 83.233.120.221:22000: connect: connection refused\(dq
  770. }
  771. },
  772. \(dqmyID\(dq: \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq,
  773. \(dqpathSeparator\(dq: \(dq/\(dq,
  774. \(dqstartTime\(dq: \(dq2016\-06\-06T19:41:43.039284753+02:00\(dq,
  775. \(dqsys\(dq: 42092792,
  776. \(dqthemes\(dq: [
  777. \(dqdefault\(dq,
  778. \(dqdark\(dq
  779. ],
  780. \(dqtilde\(dq: \(dq/Users/jb\(dq,
  781. \(dquptime\(dq: 2635
  782. }
  783. .EE
  784. .UNINDENT
  785. .UNINDENT
  786. .sp
  787. Added in version 1.2.0: The \fBlastDialStatus\fP dictionary contains the last error (or \fBnull\fP for
  788. success) for each peer address that Syncthing has attempted to contact.
  789. The \fBconnectionServiceStatus\fP entries gained \fB\(dqerror\(dq: null\fP
  790. attributes where previously there would be no \fBerror\fP attribute at all
  791. in the success case.
  792. .sp
  793. Added in version 1.18.0: The \fBdiscoveryStatus\fP dictionary lists all configured discovery methods, not
  794. only failed ones like the now deprecated \fBdiscoveryErrors\fP\&. Each entry is
  795. an object itself (for consistency with other fields), where a \fBnull\fP value
  796. for the \fBerror\fP attribute means the method is running successfully. This
  797. effectively deprecates the \fBdiscoveryMethods\fP attribute as well, which now
  798. always matches the number of entries in \fBdiscoveryStatus\fP\&.
  799. .SS GET /rest/system/upgrade
  800. .sp
  801. Checks for a possible upgrade and returns an object describing the
  802. newest version and upgrade possibility.
  803. .INDENT 0.0
  804. .INDENT 3.5
  805. .sp
  806. .EX
  807. {
  808. \(dqlatest\(dq: \(dqv0.14.47\(dq,
  809. \(dqmajorNewer\(dq: false,
  810. \(dqnewer\(dq: true,
  811. \(dqrunning\(dq: \(dqv0.14.46\(dq
  812. }
  813. .EE
  814. .UNINDENT
  815. .UNINDENT
  816. .SS POST /rest/system/upgrade
  817. .sp
  818. Perform an upgrade to the newest released version and restart. Does
  819. nothing if there is no newer version than currently running.
  820. .SS GET /rest/system/version
  821. .sp
  822. Returns the current Syncthing version information.
  823. .INDENT 0.0
  824. .INDENT 3.5
  825. .sp
  826. .EX
  827. {
  828. \(dqarch\(dq: \(dqamd64\(dq,
  829. \(dqlongVersion\(dq: \(dqsyncthing v0.10.27+3\-gea8c3de (go1.4 darwin\-amd64 default) jb@syno 2015\-03\-16 11:01:29 UTC\(dq,
  830. \(dqos\(dq: \(dqdarwin\(dq,
  831. \(dqversion\(dq: \(dqv0.10.27+3\-gea8c3de\(dq
  832. }
  833. .EE
  834. .UNINDENT
  835. .UNINDENT
  836. .SH CONFIG ENDPOINTS
  837. .SS Config Endpoints
  838. .sp
  839. Added in version 1.12.0.
  840. .sp
  841. These endpoints facilitate access and modification of the \fI\%configuration\fP in a granular way. Config sent to the endpoints must be in the
  842. same format as returned by the corresponding GET request. When posting the
  843. configuration succeeds, the posted configuration is immediately applied, except
  844. for changes that require a restart. Query \fI\%/rest/config/restart\-required\fP to check if
  845. a restart is required.
  846. .sp
  847. For all endpoints supporting \fBPATCH\fP, it takes the existing config and
  848. unmarshals the given JSON object on top of it. This means all child objects will
  849. replace the existing objects, not extend them. For example for
  850. \fBRawListenAddresses\fP in options, which is an array of strings, sending
  851. \fB{RawListenAddresses: [\(dqtcp://10.0.0.2\(dq]}\fP will replace all existing listen
  852. addresses.
  853. .SS /rest/config
  854. .sp
  855. \fBGET\fP returns the entire config and \fBPUT\fP replaces it.
  856. .SS /rest/config/restart\-required
  857. .sp
  858. \fBGET\fP returns whether a restart of Syncthing is required for the current
  859. config to take effect.
  860. .SS /rest/config/folders, /rest/config/devices
  861. .sp
  862. \fBGET\fP returns all folders respectively devices as an array. \fBPUT\fP takes an array and
  863. \fBPOST\fP a single object. In both cases if a given folder/device already exists,
  864. it’s replaced, otherwise a new one is added.
  865. .SS /rest/config/folders/*id*, /rest/config/devices/*id*
  866. .sp
  867. Put the desired folder\- respectively device\-ID in place of *id*. \fBGET\fP
  868. returns the folder/device for the given ID, \fBPUT\fP replaces the entire config,
  869. \fBPATCH\fP replaces only the given child objects and \fBDELETE\fP removes the
  870. folder/device.
  871. .SS /rest/config/defaults/folder, /rest/config/defaults/device
  872. .sp
  873. \fBGET\fP returns a template folder / device configuration object with all default
  874. values, which only needs a unique ID to be applied. \fBPUT\fP replaces the
  875. default config (omitted values are reset to the hard\-coded defaults), \fBPATCH\fP
  876. replaces only the given child objects.
  877. .SS /rest/config/defaults/ignores
  878. .sp
  879. Added in version 1.19.0.
  880. .sp
  881. \fBGET\fP returns an object with a single \fBlines\fP attribute listing ignore
  882. patterns to be used by default on folders, as an array of single\-line strings.
  883. \fBPUT\fP replaces the default ignore patterns from an object of the same format.
  884. .SS /rest/config/options, /rest/config/ldap, /rest/config/gui
  885. .sp
  886. \fBGET\fP returns the respective object, \fBPUT\fP replaces the entire object and
  887. \fBPATCH\fP replaces only the given child objects.
  888. .sp
  889. \fBNOTE:\fP
  890. .INDENT 0.0
  891. .INDENT 3.5
  892. The \fI\%gui.password\fP configuration option has special handling to
  893. accept already hashed passwords. Any valid bcrypt hash is stored verbatim,
  894. while a plaintext password is first hashed.
  895. .UNINDENT
  896. .UNINDENT
  897. .SH CLUSTER ENDPOINTS
  898. .sp
  899. Concerns the mesh network structure.
  900. .SS DELETE /rest/cluster/pending/devices
  901. .sp
  902. Added in version 1.18.0.
  903. .sp
  904. Remove records about a pending remote device which tried to connect. Valid
  905. values for the \fBdevice\fP parameter are those from the corresponding
  906. \fI\%GET /rest/cluster/pending/devices\fP endpoint.
  907. .INDENT 0.0
  908. .INDENT 3.5
  909. .sp
  910. .EX
  911. $ 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
  912. .EE
  913. .UNINDENT
  914. .UNINDENT
  915. .sp
  916. Returns status 200 and no content upon success, or status 500 and a
  917. plain text error on failure. A \fI\%PendingDevicesChanged\fP
  918. event will be generated in response.
  919. .sp
  920. For a more permanent effect, also for future connections from the same
  921. device ID, the device should be ignored in the \fI\%configuration\fP instead.
  922. .SS GET /rest/cluster/pending/devices
  923. .sp
  924. Added in version 1.13.0.
  925. .sp
  926. Lists remote devices which have tried to connect, but are not yet
  927. configured in our instance.
  928. .INDENT 0.0
  929. .INDENT 3.5
  930. .sp
  931. .EX
  932. {
  933. \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
  934. \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
  935. \(dqname\(dq: \(dqFriend Joe\(dq,
  936. \(dqaddress\(dq: \(dq192.168.1.2:22000\(dq
  937. }
  938. }
  939. .EE
  940. .UNINDENT
  941. .UNINDENT
  942. .SS DELETE /rest/cluster/pending/folders
  943. .sp
  944. Added in version 1.18.0.
  945. .sp
  946. Remove records about a pending folder announced from a remote device. Valid
  947. values for the \fBfolder\fP and \fBdevice\fP parameters are those from the
  948. corresponding \fI\%GET /rest/cluster/pending/folders\fP endpoint. The \fBdevice\fP
  949. parameter is optional and affects announcements of this folder from the given
  950. device, or from \fIany\fP device if omitted.
  951. .INDENT 0.0
  952. .INDENT 3.5
  953. .sp
  954. .EX
  955. $ 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
  956. .EE
  957. .UNINDENT
  958. .UNINDENT
  959. .sp
  960. Returns status 200 and no content upon success, or status 500 and a plain text
  961. error on failure. A \fI\%PendingFoldersChanged\fP event will be
  962. generated in response.
  963. .sp
  964. For a more permanent effect, also for future announcements of the same folder
  965. ID, the folder should be ignored in the \fI\%configuration\fP
  966. instead.
  967. .SS GET /rest/cluster/pending/folders
  968. .sp
  969. Added in version 1.13.0.
  970. .sp
  971. Lists folders which remote devices have offered to us, but are not yet
  972. shared from our instance to them. Takes the optional \fBdevice\fP
  973. parameter to only return folders offered by a specific remote device.
  974. Other offering devices are also omitted from the result.
  975. .INDENT 0.0
  976. .INDENT 3.5
  977. .sp
  978. .EX
  979. {
  980. \(dqcpkn4\-57ysy\(dq: {
  981. \(dqofferedBy\(dq: {
  982. \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
  983. \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
  984. \(dqlabel\(dq: \(dqJoe\(aqs folder\(dq,
  985. \(dqreceiveEncrypted\(dq: true,
  986. \(dqremoteEncrypted\(dq: false
  987. },
  988. \(dqDOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA\(dq: {
  989. \(dqtime\(dq: \(dq2020\-03\-01T10:12:13Z\(dq,
  990. \(dqlabel\(dq: \(dqJane\(aqs and Joe\(aqs folder\(dq,
  991. \(dqreceiveEncrypted\(dq: false,
  992. \(dqremoteEncrypted\(dq: false
  993. }
  994. }
  995. },
  996. \(dqabcde\-fghij\(dq: {
  997. \(dqofferedBy\(dq: {
  998. \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
  999. \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
  1000. \(dqlabel\(dq: \(dqMyPics\(dq,
  1001. \(dqreceiveEncrypted\(dq: false,
  1002. \(dqremoteEncrypted\(dq: false
  1003. }
  1004. }
  1005. }
  1006. }
  1007. .EE
  1008. .UNINDENT
  1009. .UNINDENT
  1010. .SH FOLDER ENDPOINTS
  1011. .sp
  1012. Runtime state of the individual shared folders.
  1013. .SS GET /rest/folder/errors
  1014. .sp
  1015. Added in version 0.14.53.
  1016. .sp
  1017. Takes one mandatory parameter, \fBfolder\fP, and returns the list of errors
  1018. encountered during scanning or pulling.
  1019. .sp
  1020. The results can be paginated using the \fI\%common pagination parameters\fP\&.
  1021. .INDENT 0.0
  1022. .INDENT 3.5
  1023. .sp
  1024. .EX
  1025. {
  1026. \(dqfolder\(dq: \(dqnnhic\-sxuae\(dq,
  1027. \(dqerrors\(dq: [
  1028. {
  1029. \(dqpath\(dq: \(dqnoperm.txt\(dq,
  1030. \(dqerror\(dq: \(dqhashing: open /path/to/folder/noperm.txt: permission denied\(dq
  1031. }
  1032. ],
  1033. \(dqpage\(dq: 1,
  1034. \(dqperpage\(dq: 100
  1035. }
  1036. .EE
  1037. .UNINDENT
  1038. .UNINDENT
  1039. .SS GET /rest/folder/pullerrors (DEPRECATED)
  1040. .sp
  1041. Deprecated since version v0.14.53: This endpoint still works as before but is deprecated. Use
  1042. \fI\%GET /rest/folder/errors\fP instead, which returns the same information.
  1043. .sp
  1044. See \X'tty: link https://github.com/syncthing/syncthing/commit/d510e3cca3d5caae42121fa206b3decc981ae59e'\fI\%https://github.com/syncthing/syncthing/commit/d510e3cca3d5caae42121fa206b3decc981ae59e\fP\X'tty: link'
  1045. .SS GET /rest/folder/versions
  1046. .sp
  1047. Added in version 0.14.44.
  1048. .sp
  1049. Takes one mandatory parameter, \fBfolder\fP, and returns the list of archived
  1050. files that could be recovered. How many versions are available depends on the
  1051. \fI\%File Versioning\fP configuration. Each entry specifies when the file
  1052. version was archived as the \fBversionTime\fP, the \fBmodTime\fP when it was last
  1053. modified before being archived, and the size in bytes.
  1054. .INDENT 0.0
  1055. .INDENT 3.5
  1056. .sp
  1057. .EX
  1058. {
  1059. \(dqdir1/dir2/bar\(dq: [
  1060. {
  1061. \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:12+01:00\(dq,
  1062. \(dqmodTime\(dq: \(dq2021\-01\-14T13:21:22+01:00\(dq,
  1063. \(dqsize\(dq: 4
  1064. }
  1065. ],
  1066. \(dqbaz\(dq: [
  1067. {
  1068. \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq,
  1069. \(dqmodTime\(dq: \(dq2021\-01\-14T13:23:49+01:00\(dq,
  1070. \(dqsize\(dq: 4
  1071. }
  1072. ],
  1073. \(dqfoo\(dq: [
  1074. {
  1075. \(dqversionTime\(dq: \(dq2022\-02\-06T20:55:31+01:00\(dq,
  1076. \(dqmodTime\(dq: \(dq2022\-02\-06T20:44:13+01:00\(dq,
  1077. \(dqsize\(dq: 4
  1078. },
  1079. {
  1080. \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq,
  1081. \(dqmodTime\(dq: \(dq2021\-01\-14T13:21:16+01:00\(dq,
  1082. \(dqsize\(dq: 4
  1083. }
  1084. ]
  1085. }
  1086. .EE
  1087. .UNINDENT
  1088. .UNINDENT
  1089. .SS POST /rest/folder/versions
  1090. .sp
  1091. Restore archived versions of a given set of files. Expects an object with
  1092. attributes named after the relative file paths, with timestamps as values
  1093. matching valid \fBversionTime\fP entries in the corresponding
  1094. \fI\%GET /rest/folder/versions\fP response object.
  1095. .sp
  1096. Takes the mandatory parameter \fBfolder\fP (folder ID). Returns an object
  1097. containing any error messages that occurred during restoration of the file, with
  1098. the file path as attribute name.
  1099. .INDENT 0.0
  1100. .INDENT 3.5
  1101. .sp
  1102. .EX
  1103. curl \-X POST \-H X\-API\-key:... http://127.0.0.1:8384/rest/folder/versions?folder=default \-d \(aq{
  1104. \(dqdir1/dir2/bar\(dq: \(dq2022\-02\-06T20:44:12+01:00\(dq,
  1105. \(dqbaz\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq
  1106. }\(aq
  1107. .EE
  1108. .UNINDENT
  1109. .UNINDENT
  1110. .SH DATABASE ENDPOINTS
  1111. .SS GET /rest/db/browse
  1112. .sp
  1113. Returns the directory tree of the global model. Directories are always
  1114. JSON objects (map/dictionary), and files are always arrays of
  1115. modification time and size. The first integer is the files modification
  1116. time, and the second integer is the file size.
  1117. .sp
  1118. The call takes one mandatory \fBfolder\fP parameter and two optional
  1119. parameters. Optional parameter \fBlevels\fP defines how deep within the
  1120. tree we want to dwell down (0 based, defaults to unlimited depth)
  1121. Optional parameter \fBprefix\fP defines a prefix within the tree where to
  1122. start building the structure.
  1123. .INDENT 0.0
  1124. .INDENT 3.5
  1125. .sp
  1126. .EX
  1127. $ curl \-s http://localhost:8384/rest/db/browse?folder=j663y\-3ct3e&prefix=DCIM&levels=2
  1128. [
  1129. {
  1130. \(dqmodTime\(dq : \(dq2020\-10\-02T23:48:52.076996974+02:00\(dq,
  1131. \(dqname\(dq : \(dq100ANDRO\(dq,
  1132. \(dqsize\(dq : 128,
  1133. \(dqtype\(dq : \(dqFILE_INFO_TYPE_DIRECTORY\(dq
  1134. },
  1135. {
  1136. \(dqchildren\(dq : [
  1137. {
  1138. \(dqmodTime\(dq : \(dq2020\-12\-16T23:31:34.5009668+01:00\(dq,
  1139. \(dqname\(dq : \(dqIMG_20201114_124821.jpg\(dq,
  1140. \(dqsize\(dq : 10682189,
  1141. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1142. },
  1143. {
  1144. \(dqmodTime\(dq : \(dq2020\-12\-16T23:31:35.0106367+01:00\(dq,
  1145. \(dqname\(dq : \(dqIMG_20201213_122451.jpg\(dq,
  1146. \(dqsize\(dq : 7936351,
  1147. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1148. },
  1149. {
  1150. \(dqmodTime\(dq : \(dq2020\-12\-13T12:25:05.017097469+01:00\(dq,
  1151. \(dqname\(dq : \(dqIMG_20201213_122504.jpg\(dq,
  1152. \(dqsize\(dq : 8406507,
  1153. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1154. },
  1155. {
  1156. \(dqmodTime\(dq : \(dq2020\-12\-13T12:25:06.127097469+01:00\(dq,
  1157. \(dqname\(dq : \(dqIMG_20201213_122505.jpg\(dq,
  1158. \(dqsize\(dq : 8381931,
  1159. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1160. },
  1161. {
  1162. \(dqmodTime\(dq : \(dq2020\-12\-13T12:53:29.707298401+01:00\(dq,
  1163. \(dqname\(dq : \(dqIMG_20201213_125329.jpg\(dq,
  1164. \(dqsize\(dq : 4388331,
  1165. \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
  1166. },
  1167. ],
  1168. \(dqmodTime\(dq : \(dq2020\-10\-09T13:04:42.4410738+02:00\(dq,
  1169. \(dqname\(dq : \(dqCamera\(dq,
  1170. \(dqsize\(dq : 128,
  1171. \(dqtype\(dq : \(dqFILE_INFO_TYPE_DIRECTORY\(dq
  1172. },
  1173. ]
  1174. .EE
  1175. .UNINDENT
  1176. .UNINDENT
  1177. .sp
  1178. \fBNOTE:\fP
  1179. .INDENT 0.0
  1180. .INDENT 3.5
  1181. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  1182. .UNINDENT
  1183. .UNINDENT
  1184. .SS GET /rest/db/completion
  1185. .sp
  1186. Returns the completion percentage (0 to 100) and byte / item counts. Takes
  1187. optional \fBdevice\fP and \fBfolder\fP parameters:
  1188. .INDENT 0.0
  1189. .IP \(bu 2
  1190. \fBfolder\fP specifies the folder ID to calculate completion for. An empty
  1191. or absent \fBfolder\fP parameter means all folders as an aggregate.
  1192. .IP \(bu 2
  1193. \fBdevice\fP specifies the device ID to calculate completion for. An empty
  1194. or absent \fBdevice\fP parameter means the local device.
  1195. .UNINDENT
  1196. .sp
  1197. If a device is specified but no folder, completion is calculated for all
  1198. folders shared with that device.
  1199. .SS Example Queries
  1200. .sp
  1201. Completion status for folder \fBabcd\-1234\fP on device \fBI6KAH76\-...\-3PSROAU\fP:
  1202. .INDENT 0.0
  1203. .INDENT 3.5
  1204. .sp
  1205. .EX
  1206. /rest/db/completion?folder=abcd\-1234&device=I6KAH76\-...\-3PSROAU
  1207. .EE
  1208. .UNINDENT
  1209. .UNINDENT
  1210. .sp
  1211. Aggregated completion status for device \fBI6KAH76\-...\-3PSROAU\fP (all folders shared with them):
  1212. .INDENT 0.0
  1213. .INDENT 3.5
  1214. .sp
  1215. .EX
  1216. /rest/db/completion?device=I6KAH76\-...\-3PSROAU
  1217. .EE
  1218. .UNINDENT
  1219. .UNINDENT
  1220. .sp
  1221. Completion status for folder \fBabcd\-1234\fP on the local device:
  1222. .INDENT 0.0
  1223. .INDENT 3.5
  1224. .sp
  1225. .EX
  1226. /rest/db/completion?folder=abcd\-1234
  1227. .EE
  1228. .UNINDENT
  1229. .UNINDENT
  1230. .sp
  1231. Aggregated completion status for all folders on the local device:
  1232. .INDENT 0.0
  1233. .INDENT 3.5
  1234. .sp
  1235. .EX
  1236. /rest/db/completion
  1237. .EE
  1238. .UNINDENT
  1239. .UNINDENT
  1240. .SS Example Response
  1241. .INDENT 0.0
  1242. .INDENT 3.5
  1243. .sp
  1244. .EX
  1245. {
  1246. \(dqcompletion\(dq: 99.9937565835,
  1247. \(dqglobalBytes\(dq: 156793013575,
  1248. \(dqneedBytes\(dq: 9789241,
  1249. \(dqglobalItems\(dq: 7823,
  1250. \(dqneedItems\(dq: 412,
  1251. \(dqneedDeletes\(dq: 0,
  1252. \(dqremoteState\(dq: \(dqvalid\(dq,
  1253. \(dqsequence\(dq: 12
  1254. }
  1255. .EE
  1256. .UNINDENT
  1257. .UNINDENT
  1258. .sp
  1259. Added in version 1.8.0: The ability to aggregate multiple folders by leaving out the folder ID.
  1260. Querying data for the local device by leaving out the device ID. Returning
  1261. the \fBglobalItems\fP counter in the response.
  1262. .sp
  1263. Added in version 1.20.0: Indication whether the remote device has accepted the folder (shares it with
  1264. us) as well, and whether it is paused. The \fBremoteState\fP field is
  1265. meaningless for aggregated responses, \fBunknown\fP when the remote device is
  1266. not connected. Otherwise it can be either \fBpaused\fP, \fBnotSharing\fP, or
  1267. \fBvalid\fP if the remote is sharing back.
  1268. .SS GET /rest/db/file
  1269. .sp
  1270. Returns most data available about a given file, including version and
  1271. availability. Takes \fBfolder\fP and \fBfile\fP parameters. \fBlocal\fP and
  1272. \fBglobal\fP refer to the current file on disk and the globally newest file,
  1273. respectively.
  1274. .INDENT 0.0
  1275. .INDENT 3.5
  1276. .sp
  1277. .EX
  1278. {
  1279. \(dqavailability\(dq: [
  1280. {
  1281. \(dqid\(dq: \(dqITZRNXE\-YNROGBZ\-HXTH5P7\-VK5NYE5\-QHRQGE2\-7JQ6VNJ\-KZUEDIU\-5PPR5AM\(dq,
  1282. \(dqfromTemporary\(dq: false
  1283. }
  1284. ],
  1285. \(dqglobal\(dq: { /* a file entry */ },
  1286. \(dqlocal\(dq: { /* a file entry */ }
  1287. }
  1288. .EE
  1289. .UNINDENT
  1290. .UNINDENT
  1291. .sp
  1292. A file entry looks like this:
  1293. .INDENT 0.0
  1294. .INDENT 3.5
  1295. .sp
  1296. .EX
  1297. {
  1298. {
  1299. \(dqdeleted\(dq: false,
  1300. \(dqignored\(dq: false,
  1301. \(dqinodeChange\(dq: \(dq1970\-01\-01T01:00:00+01:00\(dq,
  1302. \(dqinvalid\(dq: false,
  1303. \(dqlocalFlags\(dq: 0,
  1304. \(dqmodified\(dq: \(dq2022\-09\-28T08:07:19.979723+02:00\(dq,
  1305. \(dqmodifiedBy\(dq: \(dq523ITIE\(dq,
  1306. \(dqmustRescan\(dq: false,
  1307. \(dqname\(dq: \(dqimg\(dq,
  1308. \(dqnoPermissions\(dq: false,
  1309. \(dqnumBlocks\(dq: 0,
  1310. \(dqpermissions\(dq: \(dq0755\(dq,
  1311. \(dqplatform\(dq: { /* platform specific data */ },
  1312. \(dqsequence\(dq: 914,
  1313. \(dqsize\(dq: 128,
  1314. \(dqtype\(dq: \(dqFILE_INFO_TYPE_DIRECTORY\(dq,
  1315. \(dqversion\(dq: [
  1316. \(dq523ITIE:1664345275\(dq
  1317. ]
  1318. },
  1319. \(dqmtime\(dq: {
  1320. \(dqerr\(dq: null,
  1321. \(dqvalue\(dq: {
  1322. \(dqreal\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
  1323. \(dqvirtual\(dq: \(dq0001\-01\-01T00:00:00Z\(dq
  1324. }
  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
  1333. entry containing ownership information for Unix systems and an extended
  1334. attribute for 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\-user@build2.syncthing.net 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. .sp
  1885. These endpoints require the \fI\%gui.debugging\fP configuration option to
  1886. be enabled and yield an access denied error code otherwise.
  1887. .SS GET /rest/debug/peerCompletion
  1888. .sp
  1889. Summarizes the completion percentage for each remote device. Returns an object
  1890. with device IDs as keys and an integer percentage as values.
  1891. .SS GET /rest/debug/httpmetrics
  1892. .sp
  1893. Returns statistics about each served REST API endpoint, to diagnose how much
  1894. time was spent generating the responses.
  1895. .SS GET /rest/debug/cpuprof
  1896. .sp
  1897. Used to capture a profile of what Syncthing is doing on the CPU. See
  1898. \fI\%Profiling\fP\&.
  1899. .SS GET /rest/debug/heapprof
  1900. .sp
  1901. Used to capture a profile of what Syncthing is doing with the heap memory. See
  1902. \fI\%Profiling\fP\&.
  1903. .SS GET /rest/debug/support
  1904. .sp
  1905. Collects information about the running instance for troubleshooting purposes.
  1906. Returns a “support bundle” as a zipped archive, which should be sent to the
  1907. developers after verifying it contains no sensitive personal information.
  1908. Credentials for the web GUI and the API key are automatically redacted already.
  1909. .SS GET /rest/debug/file
  1910. .sp
  1911. Shows diagnostics about a certain file in a shared folder. Takes the \fBfolder\fP
  1912. (folder ID) and \fBfile\fP (folder relative path) parameters.
  1913. .INDENT 0.0
  1914. .INDENT 3.5
  1915. .sp
  1916. .EX
  1917. $ curl \-H X\-API\-Key:... \(dqhttp://localhost:8384/rest/debug/file?folder=default&file=foo/bar\(dq
  1918. .EE
  1919. .UNINDENT
  1920. .UNINDENT
  1921. .sp
  1922. The returned object contains the same info as \fI\%GET /rest/db/file\fP, plus a summary
  1923. of \fBglobalVersions\fP\&.
  1924. .SH NOAUTH ENDPOINTS
  1925. .sp
  1926. Calls that do not require authentication.
  1927. .SS GET /rest/noauth/health
  1928. .sp
  1929. Returns a \fB{\(dqstatus\(dq: \(dqOK\(dq}\fP object.
  1930. .INDENT 0.0
  1931. .INDENT 3.5
  1932. .sp
  1933. .EX
  1934. {
  1935. \(dqstatus\(dq: \(dqOK\(dq
  1936. }
  1937. .EE
  1938. .UNINDENT
  1939. .UNINDENT
  1940. .SH AUTHOR
  1941. The Syncthing Authors
  1942. .SH COPYRIGHT
  1943. 2014-2019, The Syncthing Authors
  1944. .\" Generated by docutils manpage writer.
  1945. .