syncthing-rest-api.7 61 KB

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