syncthing-rest-api.7 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-REST-API" "7" "Nov 23, 2017" "v0.14" "Syncthing"
  4. .SH NAME
  5. syncthing-rest-api \- REST API
  6. .
  7. .nr rst2man-indent-level 0
  8. .
  9. .de1 rstReportMargin
  10. \\$1 \\n[an-margin]
  11. level \\n[rst2man-indent-level]
  12. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  13. -
  14. \\n[rst2man-indent0]
  15. \\n[rst2man-indent1]
  16. \\n[rst2man-indent2]
  17. ..
  18. .de1 INDENT
  19. .\" .rstReportMargin pre:
  20. . RS \\$1
  21. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  22. . nr rst2man-indent-level +1
  23. .\" .rstReportMargin post:
  24. ..
  25. .de UNINDENT
  26. . RE
  27. .\" indent \\n[an-margin]
  28. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  29. .nr rst2man-indent-level -1
  30. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  31. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  32. ..
  33. .SH DESCRIPTION
  34. .sp
  35. Syncthing exposes a REST interface over HTTP on the GUI port. This is used by
  36. the GUI code (JavaScript) and can be used by other processes wishing to control
  37. Syncthing. In most cases both the input and output data is in JSON format. The
  38. interface is subject to change.
  39. .SH API KEY
  40. .sp
  41. To use the REST AP an API key must be set and used. The API key can be
  42. generated in the GUI, or set in the \fBconfiguration/gui/apikey\fP element in
  43. the configuration file. To use an API key, set the request header
  44. \fBX\-API\-Key\fP to the API key value. For example, \fBcurl \-X POST \-H
  45. "X\-API\-Key: abc123" http://localhost:8384/rest/...\fP can be used to invoke
  46. with \fBcurl\fP\&.
  47. .SH SYSTEM ENDPOINTS
  48. .SS GET /rest/system/browse
  49. .sp
  50. Returns a list of directories matching the path given by the optional parameter
  51. \fBcurrent\fP\&. The path can use \fI\%patterns as described in Go’s filepath package\fP <\fBhttps://golang.org/pkg/path/filepath/#Match\fP>\&. A ‘*’ will always be appended
  52. to the given path (e.g. \fB/tmp/\fP matches all its subdirectories). If the option
  53. \fBcurrent\fP is not given, filesystem root paths are returned.
  54. .INDENT 0.0
  55. .INDENT 3.5
  56. .sp
  57. .nf
  58. .ft C
  59. $ curl \-H "X\-API\-Key: yourkey" localhost:8384/rest/system/browse | json_pp
  60. [
  61. "/"
  62. ]
  63. $ curl \-H "X\-API\-Key: yourkey" localhost:8384/rest/system/browse?current=/var/ | json_pp
  64. [
  65. "/var/backups/",
  66. "/var/cache/",
  67. "/var/lib/",
  68. "/var/local/",
  69. "/var/lock/",
  70. "/var/log/",
  71. "/var/mail/",
  72. "/var/opt/",
  73. "/var/run/",
  74. "/var/spool/",
  75. "/var/tmp/"
  76. ]
  77. $ curl \-H "X\-API\-Key: yourkey" localhost:8384/rest/system/browse?current=/var/*o | json_pp
  78. [
  79. "/var/local/",
  80. "/var/lock/",
  81. "/var/log/",
  82. "/var/opt/",
  83. "/var/spool/"
  84. ]
  85. .ft P
  86. .fi
  87. .UNINDENT
  88. .UNINDENT
  89. .SS GET /rest/system/config
  90. .sp
  91. Returns the current configuration.
  92. .INDENT 0.0
  93. .INDENT 3.5
  94. .sp
  95. .nf
  96. .ft C
  97. {
  98. {
  99. "version": 15,
  100. "folders": [
  101. {
  102. "id": "GXWxf\-3zgnU",
  103. "label": "MyFolder",
  104. "path": "...",
  105. "type": "readwrite",
  106. "devices": [
  107. {
  108. "deviceID": "..."
  109. }
  110. ],
  111. "rescanIntervalS": 60,
  112. "ignorePerms": false,
  113. "autoNormalize": true,
  114. "minDiskFreePct": 1,
  115. "versioning": {
  116. "type": "simple",
  117. "params": {
  118. "keep": "5"
  119. }
  120. },
  121. "copiers": 0,
  122. "pullers": 0,
  123. "hashers": 0,
  124. "order": "random",
  125. "ignoreDelete": false,
  126. "scanProgressIntervalS": 0,
  127. "pullerSleepS": 0,
  128. "pullerPauseS": 0,
  129. "maxConflicts": 10,
  130. "disableSparseFiles": false,
  131. "disableTempIndexes": false,
  132. "fsync": false,
  133. "invalid": ""
  134. }
  135. ],
  136. "devices": [
  137. {
  138. "deviceID": "...",
  139. "name": "Laptop",
  140. "addresses": [
  141. "dynamic",
  142. "tcp://192.168.1.2:22000"
  143. ],
  144. "compression": "metadata",
  145. "certName": "",
  146. "introducer": false
  147. }
  148. ],
  149. "gui": {
  150. "enabled": true,
  151. "address": "127.0.0.1:8384",
  152. "user": "Username",
  153. "password": "$2a$10$ZFws69T4FlvWwsqeIwL.TOo5zOYqsa/.TxlUnsGYS.j3JvjFTmxo6",
  154. "useTLS": false,
  155. "apiKey": "pGahcht56664QU5eoFQW6szbEG6Ec2Cr",
  156. "insecureAdminAccess": false,
  157. "theme": "default"
  158. },
  159. "options": {
  160. "listenAddresses": [
  161. "default"
  162. ],
  163. "globalAnnounceServers": [
  164. "default"
  165. ],
  166. "globalAnnounceEnabled": true,
  167. "localAnnounceEnabled": true,
  168. "localAnnouncePort": 21027,
  169. "localAnnounceMCAddr": "[ff12::8384]:21027",
  170. "maxSendKbps": 0,
  171. "maxRecvKbps": 0,
  172. "reconnectionIntervalS": 60,
  173. "relaysEnabled": true,
  174. "relayReconnectIntervalM": 10,
  175. "startBrowser": false,
  176. "natEnabled": true,
  177. "natLeaseMinutes": 60,
  178. "natRenewalMinutes": 30,
  179. "natTimeoutSeconds": 10,
  180. "urAccepted": \-1,
  181. "urUniqueId": "",
  182. "urURL": "https://data.syncthing.net/newdata",
  183. "urPostInsecurely": false,
  184. "urInitialDelayS": 1800,
  185. "restartOnWakeup": true,
  186. "autoUpgradeIntervalH": 12,
  187. "keepTemporariesH": 24,
  188. "cacheIgnoredFiles": false,
  189. "progressUpdateIntervalS": 5,
  190. "limitBandwidthInLan": false,
  191. "minHomeDiskFreePct": 1,
  192. "releasesURL": "https://upgrades.syncthing.net/meta.json",
  193. "alwaysLocalNets": [],
  194. "overwriteRemoteDeviceNamesOnConnect": false,
  195. "tempIndexMinBlocks": 10
  196. },
  197. "ignoredDevices": []
  198. }
  199. }
  200. .ft P
  201. .fi
  202. .UNINDENT
  203. .UNINDENT
  204. .SS GET /rest/system/config/insync
  205. .sp
  206. Returns whether the config is in sync, i.e. whether the running
  207. configuration is the same as that on disk.
  208. .INDENT 0.0
  209. .INDENT 3.5
  210. .sp
  211. .nf
  212. .ft C
  213. {
  214. "configInSync": true
  215. }
  216. .ft P
  217. .fi
  218. .UNINDENT
  219. .UNINDENT
  220. .SS POST /rest/system/config
  221. .sp
  222. Post the full contents of the configuration, in the same format as returned by
  223. the corresponding GET request. The configuration will be saved to disk and the
  224. \fBconfigInSync\fP flag set to false. Restart Syncthing to activate.
  225. .SS GET /rest/system/connections
  226. .sp
  227. \fBNOTE:\fP
  228. .INDENT 0.0
  229. .INDENT 3.5
  230. Return format changed in 0.13.0.
  231. .UNINDENT
  232. .UNINDENT
  233. .sp
  234. Returns the list of configured devices and some metadata associated
  235. with them. The list also contains the local device itself as not connected.
  236. .sp
  237. The connection types are \fBTCP (Client)\fP, \fBTCP (Server)\fP, \fBRelay (Client)\fP and \fBRelay (Server)\fP\&.
  238. .INDENT 0.0
  239. .INDENT 3.5
  240. .sp
  241. .nf
  242. .ft C
  243. {
  244. "total" : {
  245. "paused" : false,
  246. "clientVersion" : "",
  247. "at" : "2015\-11\-07T17:29:47.691637262+01:00",
  248. "connected" : false,
  249. "inBytesTotal" : 1479,
  250. "type" : "",
  251. "outBytesTotal" : 1318,
  252. "address" : ""
  253. },
  254. "connections" : {
  255. "YZJBJFX\-RDBL7WY\-6ZGKJ2D\-4MJB4E7\-ZATSDUY\-LD6Y3L3\-MLFUYWE\-AEMXJAC" : {
  256. "connected" : true,
  257. "inBytesTotal" : 556,
  258. "paused" : false,
  259. "at" : "2015\-11\-07T17:29:47.691548971+01:00",
  260. "clientVersion" : "v0.12.1",
  261. "address" : "127.0.0.1:22002",
  262. "type" : "TCP (Client)",
  263. "outBytesTotal" : 550
  264. },
  265. "DOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA" : {
  266. "outBytesTotal" : 0,
  267. "type" : "",
  268. "address" : "",
  269. "at" : "0001\-01\-01T00:00:00Z",
  270. "clientVersion" : "",
  271. "paused" : false,
  272. "inBytesTotal" : 0,
  273. "connected" : false
  274. },
  275. "UYGDMA4\-TPHOFO5\-2VQYDCC\-7CWX7XW\-INZINQT\-LE4B42N\-4JUZTSM\-IWCSXA4" : {
  276. "address" : "",
  277. "type" : "",
  278. "outBytesTotal" : 0,
  279. "connected" : false,
  280. "inBytesTotal" : 0,
  281. "paused" : false,
  282. "at" : "0001\-01\-01T00:00:00Z",
  283. "clientVersion" : ""
  284. }
  285. }
  286. }
  287. .ft P
  288. .fi
  289. .UNINDENT
  290. .UNINDENT
  291. .SS GET /rest/system/debug
  292. .sp
  293. New in version 0.12.0.
  294. .sp
  295. Returns the set of debug facilities and which of them are currently enabled.
  296. .INDENT 0.0
  297. .INDENT 3.5
  298. .sp
  299. .nf
  300. .ft C
  301. {
  302. "enabled": [
  303. "beacon"
  304. ],
  305. "facilities": {
  306. "beacon": "Multicast and broadcast discovery",
  307. "config": "Configuration loading and saving",
  308. "connections": "Connection handling",
  309. "db": "The database layer",
  310. "dialer": "Dialing connections",
  311. "discover": "Remote device discovery",
  312. "events": "Event generation and logging",
  313. "http": "REST API",
  314. "main": "Main package",
  315. "model": "The root hub",
  316. "protocol": "The BEP protocol",
  317. "relay": "Relay connection handling",
  318. "scanner": "File change detection and hashing",
  319. "stats": "Persistent device and folder statistics",
  320. "sync": "Mutexes",
  321. "upgrade": "Binary upgrades",
  322. "upnp": "UPnP discovery and port mapping",
  323. "versioner": "File versioning"
  324. }
  325. }
  326. .ft P
  327. .fi
  328. .UNINDENT
  329. .UNINDENT
  330. .SS POST /rest/system/debug
  331. .sp
  332. New in version 0.12.0.
  333. .sp
  334. Enables or disables debugging for specified facilities. Give one or both of
  335. \fBenable\fP and \fBdisable\fP query parameters, with comma separated facility
  336. names. To disable debugging of the beacon and discovery packages, and enable it
  337. for config and db:
  338. .INDENT 0.0
  339. .INDENT 3.5
  340. .sp
  341. .nf
  342. .ft C
  343. $ curl \-H X\-API\-Key:abc123 \-X POST \(aqhttp://localhost:8384/rest/system/debug?disable=beacon,discovery&enable=config,db\(aq
  344. .ft P
  345. .fi
  346. .UNINDENT
  347. .UNINDENT
  348. .SS GET /rest/system/discovery
  349. .sp
  350. Returns the contents of the local discovery cache.
  351. .INDENT 0.0
  352. .INDENT 3.5
  353. .sp
  354. .nf
  355. .ft C
  356. {
  357. "LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q": [
  358. "192.162.129.11:22000"
  359. ]
  360. }
  361. .ft P
  362. .fi
  363. .UNINDENT
  364. .UNINDENT
  365. .SS POST /rest/system/discovery
  366. .sp
  367. \fBNOTE:\fP
  368. .INDENT 0.0
  369. .INDENT 3.5
  370. Removed in v0.12.0.
  371. .UNINDENT
  372. .UNINDENT
  373. .sp
  374. Post with the query parameters \fBdevice\fP and \fBaddr\fP to add entries to
  375. the discovery cache.
  376. .INDENT 0.0
  377. .INDENT 3.5
  378. .sp
  379. .nf
  380. .ft C
  381. curl \-X POST http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e&addr=192.162.129.11:22000
  382. # Or with the X\-API\-Key header:
  383. curl \-X POST \-\-header "X\-API\-Key: TcE28kVPdtJ8COws1JdM0b2nodj77WeQ" http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e&addr=192.162.129.11:22000
  384. .ft P
  385. .fi
  386. .UNINDENT
  387. .UNINDENT
  388. .SS POST /rest/system/error/clear
  389. .sp
  390. Post with empty to body to remove all recent errors.
  391. .SS GET /rest/system/error
  392. .sp
  393. \fBNOTE:\fP
  394. .INDENT 0.0
  395. .INDENT 3.5
  396. Return format changed in 0.12.0.
  397. .UNINDENT
  398. .UNINDENT
  399. .sp
  400. Returns the list of recent errors.
  401. .INDENT 0.0
  402. .INDENT 3.5
  403. .sp
  404. .nf
  405. .ft C
  406. {
  407. "errors": [
  408. {
  409. "when": "2014\-09\-18T12:59:26.549953186+02:00",
  410. "message": "This is an error string"
  411. }
  412. ]
  413. }
  414. .ft P
  415. .fi
  416. .UNINDENT
  417. .UNINDENT
  418. .SS POST /rest/system/error
  419. .sp
  420. Post with an error message in the body (plain text) to register a new
  421. error. The new error will be displayed on any active GUI clients.
  422. .SS GET /rest/system/log
  423. .sp
  424. New in version 0.12.0.
  425. .sp
  426. Returns the list of recent log entries.
  427. .INDENT 0.0
  428. .INDENT 3.5
  429. .sp
  430. .nf
  431. .ft C
  432. {
  433. "messages": [
  434. {
  435. "when": "2014\-09\-18T12:59:26.549953186+02:00",
  436. "message": "This is a log entry"
  437. }
  438. ]
  439. }
  440. .ft P
  441. .fi
  442. .UNINDENT
  443. .UNINDENT
  444. .SS POST /rest/system/pause
  445. .sp
  446. Pause the given device or all devices.
  447. .sp
  448. Takes the optional parameter \fBdevice\fP (device ID). When omitted,
  449. pauses all devices. Returns status 200 and no content upon success, or status
  450. 500 and a plain text error on failure.
  451. .SS GET /rest/system/ping
  452. .sp
  453. Returns a \fB{"ping": "pong"}\fP object.
  454. .INDENT 0.0
  455. .INDENT 3.5
  456. .sp
  457. .nf
  458. .ft C
  459. {
  460. "ping": "pong"
  461. }
  462. .ft P
  463. .fi
  464. .UNINDENT
  465. .UNINDENT
  466. .SS POST /rest/system/ping
  467. .sp
  468. Returns a \fB{"ping": "pong"}\fP object.
  469. .SS POST /rest/system/reset
  470. .sp
  471. Post with empty body to erase the current index database and restart
  472. Syncthing. With no query parameters, the entire database is erased from disk.
  473. By specifying the \fBfolder\fP parameter with a valid folder ID, only
  474. information for that folder will be erased:
  475. .INDENT 0.0
  476. .INDENT 3.5
  477. .sp
  478. .nf
  479. .ft C
  480. $ curl \-X POST \-H "X\-API\-Key: abc123" http://localhost:8384/rest/system/reset?folder=default
  481. .ft P
  482. .fi
  483. .UNINDENT
  484. .UNINDENT
  485. .SS POST /rest/system/restart
  486. .sp
  487. Post with empty body to immediately restart Syncthing.
  488. .SS POST /rest/system/resume
  489. .sp
  490. Resume the given device or all devices.
  491. .sp
  492. Takes the optional parameter \fBdevice\fP (device ID). When omitted,
  493. resumes all devices. Returns status 200 and no content upon success, or status
  494. 500 and a plain text error on failure.
  495. .SS POST /rest/system/shutdown
  496. .sp
  497. Post with empty body to cause Syncthing to exit and not restart.
  498. .SS GET /rest/system/status
  499. .sp
  500. Returns information about current system status and resource usage.
  501. .INDENT 0.0
  502. .INDENT 3.5
  503. .sp
  504. .nf
  505. .ft C
  506. {
  507. "alloc": 30618136,
  508. "connectionServiceStatus": {
  509. "dynamic+https://relays.syncthing.net/endpoint": {
  510. "lanAddresses": [
  511. "relay://23.92.71.120:443/?id=53STGR7\-YBM6FCX\-PAZ2RHM\-YPY6OEJ\-WYHVZO7\-PCKQRCK\-PZLTP7T\-434XCAD&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=canton7"
  512. ],
  513. "wanAddresses": [
  514. "relay://23.92.71.120:443/?id=53STGR7\-YBM6FCX\-PAZ2RHM\-YPY6OEJ\-WYHVZO7\-PCKQRCK\-PZLTP7T\-434XCAD&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=canton7"
  515. ]
  516. },
  517. "tcp://0.0.0.0:22000": {
  518. "lanAddresses": [
  519. "tcp://0.0.0.0:22000"
  520. ],
  521. "wanAddresses": [
  522. "tcp://0.0.0.0:22000"
  523. ]
  524. }
  525. },
  526. "cpuPercent": 0.006944836512046966,
  527. "discoveryEnabled": true,
  528. "discoveryErrors": {
  529. "global@https://discovery\-v4\-1.syncthing.net/v2/": "500 Internal Server Error",
  530. "global@https://discovery\-v4\-2.syncthing.net/v2/": "Post https://discovery\-v4\-2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)",
  531. "global@https://discovery\-v4\-3.syncthing.net/v2/": "Post https://discovery\-v4\-3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)",
  532. "global@https://discovery\-v6\-1.syncthing.net/v2/": "Post https://discovery\-v6\-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host",
  533. "global@https://discovery\-v6\-2.syncthing.net/v2/": "Post https://discovery\-v6\-2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host",
  534. "global@https://discovery\-v6\-3.syncthing.net/v2/": "Post https://discovery\-v6\-3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host"
  535. },
  536. "discoveryMethods": 8,
  537. "goroutines": 49,
  538. "myID": "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2",
  539. "pathSeparator": "/",
  540. "startTime": "2016\-06\-06T19:41:43.039284753+02:00",
  541. "sys": 42092792,
  542. "themes": [
  543. "default",
  544. "dark"
  545. ],
  546. "tilde": "/Users/jb",
  547. "uptime": 2635
  548. }
  549. .ft P
  550. .fi
  551. .UNINDENT
  552. .UNINDENT
  553. .SS GET /rest/system/upgrade
  554. .sp
  555. Checks for a possible upgrade and returns an object describing the
  556. newest version and upgrade possibility.
  557. .INDENT 0.0
  558. .INDENT 3.5
  559. .sp
  560. .nf
  561. .ft C
  562. {
  563. "latest": "v0.10.27",
  564. "newer": false,
  565. "running": "v0.10.27+5\-g36c93b7"
  566. }
  567. .ft P
  568. .fi
  569. .UNINDENT
  570. .UNINDENT
  571. .SS POST /rest/system/upgrade
  572. .sp
  573. Perform an upgrade to the newest released version and restart. Does
  574. nothing if there is no newer version than currently running.
  575. .SS GET /rest/system/version
  576. .sp
  577. Returns the current Syncthing version information.
  578. .INDENT 0.0
  579. .INDENT 3.5
  580. .sp
  581. .nf
  582. .ft C
  583. {
  584. "arch": "amd64",
  585. "longVersion": "syncthing v0.10.27+3\-gea8c3de (go1.4 darwin\-amd64 default) jb@syno 2015\-03\-16 11:01:29 UTC",
  586. "os": "darwin",
  587. "version": "v0.10.27+3\-gea8c3de"
  588. }
  589. .ft P
  590. .fi
  591. .UNINDENT
  592. .UNINDENT
  593. .SH DATABASE ENDPOINTS
  594. .SS GET /rest/db/browse
  595. .sp
  596. Returns the directory tree of the global model. Directories are always
  597. JSON objects (map/dictionary), and files are always arrays of
  598. modification time and size. The first integer is the files modification
  599. time, and the second integer is the file size.
  600. .sp
  601. The call takes one mandatory \fBfolder\fP parameter and two optional
  602. parameters. Optional parameter \fBlevels\fP defines how deep within the
  603. tree we want to dwell down (0 based, defaults to unlimited depth)
  604. Optional parameter \fBprefix\fP defines a prefix within the tree where to
  605. start building the structure.
  606. .INDENT 0.0
  607. .INDENT 3.5
  608. .sp
  609. .nf
  610. .ft C
  611. $ curl \-s http://localhost:8384/rest/db/browse?folder=default | json_pp
  612. {
  613. "directory": {
  614. "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
  615. "subdirectory": {
  616. "another file": ["2015\-04\-20T22:20:45+09:00", 130940928]
  617. }
  618. },
  619. "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
  620. }
  621. $ curl \-s http://localhost:8384/rest/db/browse?folder=default&levels=0 | json_pp
  622. {
  623. "directory": {},
  624. "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
  625. }
  626. $ curl \-s http://localhost:8384/rest/db/browse?folder=default&levels=1 | json_pp
  627. {
  628. "directory": {
  629. "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
  630. "subdirectory": {}
  631. },
  632. "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
  633. }
  634. $ curl \-s http://localhost:8384/rest/db/browse?folder=default&prefix=directory/subdirectory | json_pp
  635. {
  636. "another file": ["2015\-04\-20T22:20:45+09:00", 130940928]
  637. }
  638. $ curl \-s http://localhost:8384/rest/db/browse?folder=default&prefix=directory&levels=0 | json_pp
  639. {
  640. "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
  641. "subdirectory": {}
  642. }
  643. .ft P
  644. .fi
  645. .UNINDENT
  646. .UNINDENT
  647. .sp
  648. \fBNOTE:\fP
  649. .INDENT 0.0
  650. .INDENT 3.5
  651. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  652. .UNINDENT
  653. .UNINDENT
  654. .SS GET /rest/db/completion
  655. .sp
  656. Returns the completion percentage (0 to 100) for a given device and
  657. folder. Takes \fBdevice\fP and \fBfolder\fP parameters.
  658. .INDENT 0.0
  659. .INDENT 3.5
  660. .sp
  661. .nf
  662. .ft C
  663. {
  664. "completion": 100,
  665. "globalBytes": 156793013575,
  666. "needBytes": 0,
  667. "needDeletes": 0
  668. }
  669. .ft P
  670. .fi
  671. .UNINDENT
  672. .UNINDENT
  673. .sp
  674. \fBNOTE:\fP
  675. .INDENT 0.0
  676. .INDENT 3.5
  677. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  678. .UNINDENT
  679. .UNINDENT
  680. .SS GET /rest/db/file
  681. .sp
  682. Returns most data available about a given file, including version and
  683. availability. Takes \fBfolder\fP and \fBfile\fP parameters.
  684. .INDENT 0.0
  685. .INDENT 3.5
  686. .sp
  687. .nf
  688. .ft C
  689. {
  690. "availability": [
  691. "I6KAH76\-66SLLLB\-5PFXSOA\-UFJCDZC\-YAOMLEK\-CP2GB32\-BV5RQST\-3PSROAU"
  692. ],
  693. "global": {
  694. "flags": "0644",
  695. "sequence": 3,
  696. "modified": "2015\-04\-20T22:20:45+09:00",
  697. "name": "util.go",
  698. "numBlocks": 1,
  699. "size": 9642,
  700. "version": [
  701. "5407294127585413568:1"
  702. ]
  703. },
  704. "local": {
  705. "flags": "0644",
  706. "sequence": 4,
  707. "modified": "2015\-04\-20T22:20:45+09:00",
  708. "name": "util.go",
  709. "numBlocks": 1,
  710. "size": 9642,
  711. "version": [
  712. "5407294127585413568:1"
  713. ]
  714. }
  715. }
  716. .ft P
  717. .fi
  718. .UNINDENT
  719. .UNINDENT
  720. .SS GET /rest/db/ignores
  721. .sp
  722. Takes one parameter, \fBfolder\fP, and returns the content of the
  723. \fB\&.stignore\fP as the \fBignore\fP field. A second field, \fBexpanded\fP,
  724. 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.
  725. .INDENT 0.0
  726. .INDENT 3.5
  727. .sp
  728. .nf
  729. .ft C
  730. {
  731. "ignore": [
  732. "(?i)/Backups"
  733. ],
  734. "expanded": [
  735. "(?i)Backups",
  736. "(?i)Backups/**"
  737. ]
  738. }
  739. .ft P
  740. .fi
  741. .UNINDENT
  742. .UNINDENT
  743. .SS POST /rest/db/ignores
  744. .sp
  745. Expects a format similar to the output of \fBGET\fP call, but only
  746. containing the \fBignore\fP field (\fBexpanded\fP field should be omitted).
  747. It takes one parameter, \fBfolder\fP, and either updates the content of
  748. the \fB\&.stignore\fP echoing it back as a response, or returns an error.
  749. .SS GET /rest/db/need
  750. .sp
  751. Takes one mandatory parameter, \fBfolder\fP, and returns lists of files which are
  752. needed by this device in order for it to become in sync.
  753. .sp
  754. Furthermore takes an optional \fBpage\fP and \fBperpage\fP arguments for pagination.
  755. Pagination happens, across the union of all needed files, that is \- across all
  756. 3 sections of the response.
  757. For example, given the current need state is as follows:
  758. .INDENT 0.0
  759. .IP 1. 3
  760. \fBprogress\fP has 15 items
  761. .IP 2. 3
  762. \fBqueued\fP has 3 items
  763. .IP 3. 3
  764. \fBrest\fP has 12 items
  765. .UNINDENT
  766. .sp
  767. If you issue a query with \fBpage=1\fP and \fBperpage=10\fP, only the \fBprogress\fP
  768. section in the response will have 10 items. If you issue a request query with
  769. \fBpage=2\fP and \fBperpage=10\fP, \fBprogress\fP section will have the last 5 items,
  770. \fBqueued\fP section will have all 3 items, and \fBrest\fP section will have first
  771. 2 items. If you issue a query for \fBpage=3\fP and \fBperpage=10\fP, you will only
  772. have the last 10 items of the \fBrest\fP section.
  773. .sp
  774. In all these calls, \fBtotal\fP will be 30 to indicate the total number of
  775. available items.
  776. .INDENT 0.0
  777. .INDENT 3.5
  778. .sp
  779. .nf
  780. .ft C
  781. {
  782. # Files currently being downloaded
  783. "progress": [
  784. {
  785. "flags": "0755",
  786. "sequence": 6,
  787. "modified": "2015\-04\-20T23:06:12+09:00",
  788. "name": "ls",
  789. "size": 34640,
  790. "version": [
  791. "5157751870738175669:1"
  792. ]
  793. }
  794. ],
  795. # Files queued to be downloaded next (as per array order)
  796. "queued": [
  797. ...
  798. ],
  799. # Files to be downloaded after all queued files will be downloaded.
  800. # This happens when we start downloading files, and new files get added while we are downloading.
  801. "rest": [
  802. ...
  803. ],
  804. "page": 1,
  805. "perpage": 100,
  806. "total": 2000
  807. }
  808. .ft P
  809. .fi
  810. .UNINDENT
  811. .UNINDENT
  812. .sp
  813. \fBNOTE:\fP
  814. .INDENT 0.0
  815. .INDENT 3.5
  816. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  817. .UNINDENT
  818. .UNINDENT
  819. .SS POST /rest/db/override
  820. .sp
  821. Request override of a send\-only folder.
  822. Takes the mandatory parameter \fIfolder\fP (folder ID).
  823. .INDENT 0.0
  824. .INDENT 3.5
  825. .sp
  826. .nf
  827. .ft C
  828. curl \-X POST http://127.0.0.1:8384/rest/db/override?folder=default
  829. .ft P
  830. .fi
  831. .UNINDENT
  832. .UNINDENT
  833. .SS POST /rest/db/prio
  834. .sp
  835. Moves the file to the top of the download queue.
  836. .INDENT 0.0
  837. .INDENT 3.5
  838. .sp
  839. .nf
  840. .ft C
  841. curl \-X POST http://127.0.0.1:8384/rest/db/prio?folder=default&file=foo/bar
  842. .ft P
  843. .fi
  844. .UNINDENT
  845. .UNINDENT
  846. .sp
  847. Response contains the same output as \fBGET /rest/db/need\fP
  848. .SS POST /rest/db/scan
  849. .sp
  850. Request immediate scan. Takes the optional parameters \fBfolder\fP (folder ID),
  851. \fBsub\fP (path relative to the folder root) and \fBnext\fP (time in seconds). If
  852. \fBfolder\fP is omitted or empty all folders are scanned. If \fBsub\fP is given,
  853. only this path (and children, in case it’s a directory) is scanned. The \fBnext\fP
  854. argument delays Syncthing’s automated rescan interval for a given amount of
  855. seconds.
  856. .sp
  857. Requesting scan of a path that no longer exists, but previously did, is
  858. valid and will result in Syncthing noticing the deletion of the path in
  859. question.
  860. .sp
  861. Returns status 200 and no content upon success, or status 500 and a
  862. plain text error if an error occurred during scanning.
  863. .INDENT 0.0
  864. .INDENT 3.5
  865. .sp
  866. .nf
  867. .ft C
  868. curl \-X POST http://127.0.0.1:8384/rest/db/scan?folder=default&sub=foo/bar
  869. .ft P
  870. .fi
  871. .UNINDENT
  872. .UNINDENT
  873. .SS GET /rest/db/status
  874. .sp
  875. Returns information about the current status of a folder.
  876. .sp
  877. Parameters: \fBfolder\fP, the ID of a folder.
  878. .INDENT 0.0
  879. .INDENT 3.5
  880. .sp
  881. .nf
  882. .ft C
  883. {
  884. # latest version according to cluster:
  885. "globalBytes": 13173473780,
  886. "globalDeleted": 1847,
  887. "globalFiles": 42106,
  888. # what we have locally:
  889. "localBytes": 13173473780,
  890. "localDeleted": 1847,
  891. "localFiles": 42106,
  892. # which part of what we have locally is the latest cluster version:
  893. "inSyncBytes": 13173473780,
  894. "inSyncFiles": 42106,
  895. # which part of what we have locally should be fetched from the cluster:
  896. "needBytes": 0,
  897. "needFiles": 0,
  898. # various other metadata
  899. "ignorePatterns": true,
  900. "invalid": "",
  901. "state": "idle",
  902. "stateChanged": "2015\-03\-16T21:47:28.750853241+01:00",
  903. "version": 71989
  904. }
  905. .ft P
  906. .fi
  907. .UNINDENT
  908. .UNINDENT
  909. .sp
  910. \fBNOTE:\fP
  911. .INDENT 0.0
  912. .INDENT 3.5
  913. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  914. .UNINDENT
  915. .UNINDENT
  916. .SH EVENT ENDPOINTS
  917. .SS Event API
  918. .SS Description
  919. .sp
  920. Syncthing provides a simple long polling interface for exposing events from the
  921. core utility towards a GUI.
  922. .sp
  923. To receive events, perform a HTTP GET of \fB/rest/events\fP or
  924. \fB/rest/events/disk\fP\&. The latter returns only local\-change\-detected and
  925. remote\-change\-detected events, the former all other events unless filtered.
  926. .sp
  927. To filter the event list, in effect creating a specific subscription for
  928. only the desired event types, add a parameter
  929. \fBevents=EventTypeA,EventTypeB,...\fP where the event types are any from the
  930. list below.
  931. .sp
  932. The optional parameter \fBsince=<lastSeenID>\fP sets the ID of the last event
  933. you’ve already seen. Syncthing returns a JSON encoded array of event objects,
  934. starting at the event just after the one with this last seen ID. The default
  935. value is 0, which returns all events. There is a limit to the number of events
  936. buffered, so if the rate of events is high or the time between polling calls is
  937. long some events might be missed. This can be detected by noting a discontinuity
  938. in the event IDs.
  939. .sp
  940. If no new events are produced since \fB<lastSeenID>\fP, the HTTP call blocks and
  941. waits for new events to happen before returning. By default it times out after
  942. 60 seconds returning an empty array. The time out duration can be customized
  943. with the optional parameter \fBtimeout=seconds\fP\&.
  944. .sp
  945. To receive only a limited number of events, add the \fBlimit=n\fP parameter with a
  946. suitable value for \fBn\fP and only the \fIlast\fP \fBn\fP events will be returned. This
  947. can be used to catch up with the latest event ID after a disconnection for
  948. example: \fB/rest/events?since=0&limit=1\fP\&.
  949. .SS Event Structure
  950. .sp
  951. Each event is represented by an object similar to the following:
  952. .INDENT 0.0
  953. .INDENT 3.5
  954. .sp
  955. .nf
  956. .ft C
  957. {
  958. "id": 2,
  959. "globalID": 3,
  960. "type": "DeviceConnected",
  961. "time": "2014\-07\-13T21:04:33.687836696+02:00",
  962. "data": {
  963. "addr": "172.16.32.25:22000",
  964. "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  965. }
  966. }
  967. .ft P
  968. .fi
  969. .UNINDENT
  970. .UNINDENT
  971. .sp
  972. The top level keys \fBid\fP, \fBglobalID\fP, \fBtime\fP, \fBtype\fP and \fBdata\fP are always present,
  973. though \fBdata\fP may be \fBnull\fP\&.
  974. .INDENT 0.0
  975. .TP
  976. .B id
  977. A unique ID for this event on the events API. It always increases by 1: the first
  978. event generated has id \fB1\fP, the next has id \fB2\fP etc. If this increases by
  979. more than 1, then one or more events have been skipped by the events API.
  980. .TP
  981. .B globalID
  982. A global ID for this event, across the events API, the audit log, and any other
  983. sources. It may increase by more than 1, but it will always be greater
  984. than or equal to the id.
  985. .TP
  986. .B time
  987. The time the event was generated.
  988. .TP
  989. .B type
  990. Indicates the type of (i.e. reason for) the event and is one of the event
  991. types below.
  992. .TP
  993. .B data
  994. An object containing optional extra information; the exact structure is
  995. determined by the event type.
  996. .UNINDENT
  997. .SS Event Types
  998. .SS ConfigSaved
  999. .sp
  1000. Emitted after the config has been saved by the user or by Syncthing
  1001. itself.
  1002. .INDENT 0.0
  1003. .INDENT 3.5
  1004. .sp
  1005. .nf
  1006. .ft C
  1007. {
  1008. "id": 50,
  1009. "type": "ConfigSaved",
  1010. "time": "2014\-12\-13T00:09:13.5166486Z",
  1011. "data": {
  1012. "Version": 7,
  1013. "Options": {"..."},
  1014. "GUI": {"..."},
  1015. "Devices": [{"..."}],
  1016. "Folders": [{"..."}]
  1017. }
  1018. }
  1019. .ft P
  1020. .fi
  1021. .UNINDENT
  1022. .UNINDENT
  1023. .SS DeviceConnected
  1024. .sp
  1025. Generated each time a connection to a device has been established.
  1026. .INDENT 0.0
  1027. .INDENT 3.5
  1028. .sp
  1029. .nf
  1030. .ft C
  1031. {
  1032. "id": 2,
  1033. "type": "DeviceConnected",
  1034. "time": "2014\-07\-13T21:04:33.687836696+02:00",
  1035. "data": {
  1036. "addr": "172.16.32.25:22000",
  1037. "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG",
  1038. "deviceName": "Laptop",
  1039. "clientName": "syncthing",
  1040. "clientVersion": "v0.13.4",
  1041. "type": "TCP (Client)"
  1042. }
  1043. }
  1044. .ft P
  1045. .fi
  1046. .UNINDENT
  1047. .UNINDENT
  1048. .SS DeviceDisconnected
  1049. .sp
  1050. Generated each time a connection to a device has been terminated.
  1051. .INDENT 0.0
  1052. .INDENT 3.5
  1053. .sp
  1054. .nf
  1055. .ft C
  1056. {
  1057. "id": 48,
  1058. "type": "DeviceDisconnected",
  1059. "time": "2014\-07\-13T21:18:52.859929215+02:00",
  1060. "data": {
  1061. "error": "unexpected EOF",
  1062. "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  1063. }
  1064. }
  1065. .ft P
  1066. .fi
  1067. .UNINDENT
  1068. .UNINDENT
  1069. .sp
  1070. \fBNOTE:\fP
  1071. .INDENT 0.0
  1072. .INDENT 3.5
  1073. The error key contains the cause for disconnection, which might not
  1074. necessarily be an error as such. Specifically, “EOF” and “unexpected
  1075. EOF” both signify TCP connection termination, either due to the other
  1076. device restarting or going offline or due to a network change.
  1077. .UNINDENT
  1078. .UNINDENT
  1079. .SS DeviceDiscovered
  1080. .sp
  1081. Emitted when a new device is discovered using local discovery.
  1082. .INDENT 0.0
  1083. .INDENT 3.5
  1084. .sp
  1085. .nf
  1086. .ft C
  1087. {
  1088. "id": 13,
  1089. "type": "DeviceDiscovered",
  1090. "time": "2014\-07\-17T13:28:05.043465207+02:00",
  1091. "data": {
  1092. "addrs": [
  1093. "172.16.32.25:22000"
  1094. ],
  1095. "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  1096. }
  1097. }
  1098. .ft P
  1099. .fi
  1100. .UNINDENT
  1101. .UNINDENT
  1102. .SS DevicePaused
  1103. .sp
  1104. Emitted when a device was paused.
  1105. .INDENT 0.0
  1106. .INDENT 3.5
  1107. .sp
  1108. .nf
  1109. .ft C
  1110. {
  1111. "id": 13,
  1112. "type": "DevicePaused",
  1113. "time": "2014\-07\-17T13:28:05.043465207+02:00",
  1114. "data": {
  1115. "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  1116. }
  1117. }
  1118. .ft P
  1119. .fi
  1120. .UNINDENT
  1121. .UNINDENT
  1122. .SS DeviceRejected
  1123. .sp
  1124. Emitted when there is a connection from a device we are not configured
  1125. to talk to.
  1126. .INDENT 0.0
  1127. .INDENT 3.5
  1128. .sp
  1129. .nf
  1130. .ft C
  1131. {
  1132. "id": 24,
  1133. "type": "DeviceRejected",
  1134. "time": "2014\-08\-19T10:43:00.562821045+02:00",
  1135. "data": {
  1136. "address": "127.0.0.1:51807",
  1137. "device": "EJHMPAQ\-OGCVORE\-ISB4IS3\-SYYVJXF\-TKJGLTU\-66DIQPF\-GJ5D2GX\-GQ3OWQK"
  1138. }
  1139. }
  1140. .ft P
  1141. .fi
  1142. .UNINDENT
  1143. .UNINDENT
  1144. .SS DeviceResumed
  1145. .sp
  1146. Generated each time a device was resumed.
  1147. .INDENT 0.0
  1148. .INDENT 3.5
  1149. .sp
  1150. .nf
  1151. .ft C
  1152. {
  1153. "id": 2,
  1154. "type": "DeviceResumed",
  1155. "time": "2014\-07\-13T21:04:33.687836696+02:00",
  1156. "data": {
  1157. "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  1158. }
  1159. }
  1160. .ft P
  1161. .fi
  1162. .UNINDENT
  1163. .UNINDENT
  1164. .SS DownloadProgress
  1165. .sp
  1166. Emitted during file downloads for each folder for each file. By default
  1167. only a single file in a folder is handled at the same time, but custom
  1168. configuration can cause multiple files to be shown.
  1169. .INDENT 0.0
  1170. .INDENT 3.5
  1171. .sp
  1172. .nf
  1173. .ft C
  1174. {
  1175. "id": 221,
  1176. "type": "DownloadProgress",
  1177. "time": "2014\-12\-13T00:26:12.9876937Z",
  1178. "data": {
  1179. "folder1": {
  1180. "file1": {
  1181. "Total": 800,
  1182. "Pulling": 2,
  1183. "CopiedFromOrigin": 0,
  1184. "Reused": 633,
  1185. "CopiedFromElsewhere": 0,
  1186. "Pulled": 38,
  1187. "BytesTotal": 104792064,
  1188. "BytesDone": 87883776
  1189. },
  1190. "dir\e\efile2": {
  1191. "Total": 80,
  1192. "Pulling": 2,
  1193. "CopiedFromOrigin": 0,
  1194. "Reused": 0,
  1195. "CopiedFromElsewhere": 0,
  1196. "Pulled": 32,
  1197. "BytesTotal": 10420224,
  1198. "BytesDone": 4128768
  1199. }
  1200. },
  1201. "folder2": {
  1202. "file3": {
  1203. "Total": 800,
  1204. "Pulling": 2,
  1205. "CopiedFromOrigin": 0,
  1206. "Reused": 633,
  1207. "CopiedFromElsewhere": 0,
  1208. "Pulled": 38,
  1209. "BytesTotal": 104792064,
  1210. "BytesDone": 87883776
  1211. },
  1212. "dir\e\efile4": {
  1213. "Total": 80,
  1214. "Pulling": 2,
  1215. "CopiedFromOrigin": 0,
  1216. "Reused": 0,
  1217. "CopiedFromElsewhere": 0,
  1218. "Pulled": 32,
  1219. "BytesTotal": 10420224,
  1220. "BytesDone": 4128768
  1221. }
  1222. }
  1223. }
  1224. }
  1225. .ft P
  1226. .fi
  1227. .UNINDENT
  1228. .UNINDENT
  1229. .INDENT 0.0
  1230. .IP \(bu 2
  1231. \fBTotal\fP \- total number of blocks in the file
  1232. .IP \(bu 2
  1233. \fBPulling\fP \- number of blocks currently being downloaded
  1234. .IP \(bu 2
  1235. \fBCopiedFromOrigin\fP \- number of blocks copied from the file we are
  1236. about to replace
  1237. .IP \(bu 2
  1238. \fBReused\fP \- number of blocks reused from a previous temporary file
  1239. .IP \(bu 2
  1240. \fBCopiedFromElsewhere\fP \- number of blocks copied from other files or
  1241. potentially other folders
  1242. .IP \(bu 2
  1243. \fBPulled\fP \- number of blocks actually downloaded so far
  1244. .IP \(bu 2
  1245. \fBBytesTotal\fP \- approximate total file size
  1246. .IP \(bu 2
  1247. \fBBytesDone\fP \- approximate number of bytes already handled (already
  1248. reused, copied or pulled)
  1249. .UNINDENT
  1250. .sp
  1251. Where block size is 128KB.
  1252. .sp
  1253. Files/folders appearing in the event data imply that the download has
  1254. been started for that file/folder, where disappearing implies that the
  1255. downloads have been finished or failed for that file/folder. There is
  1256. always a last event emitted with no data, which implies all downloads
  1257. have finished/failed.
  1258. .SS FolderCompletion
  1259. .sp
  1260. The \fBFolderCompletion\fP event is emitted when the local or remote
  1261. contents for a folder changes. It contains the completion percentage for
  1262. a given remote device and is emitted once per currently connected remote
  1263. device.
  1264. .INDENT 0.0
  1265. .INDENT 3.5
  1266. .sp
  1267. .nf
  1268. .ft C
  1269. {
  1270. "id": 84,
  1271. "type": "FolderCompletion",
  1272. "time": "2015\-04\-17T14:14:27.043576583+09:00",
  1273. "data": {
  1274. "completion": 100,
  1275. "device": "I6KAH76\-66SLLLB\-5PFXSOA\-UFJCDZC\-YAOMLEK\-CP2GB32\-BV5RQST\-3PSROAU",
  1276. "folder": "default"
  1277. }
  1278. }
  1279. .ft P
  1280. .fi
  1281. .UNINDENT
  1282. .UNINDENT
  1283. .SS FolderErrors
  1284. .sp
  1285. The \fBFolderErrors\fP event is emitted when a folder cannot be successfully
  1286. synchronized. The event contains the ID of the affected folder and a list of
  1287. errors for files or directories therein. This list of errors is obsolete once
  1288. the folder changes state to \fBsyncing\fP \- if errors remain after the next
  1289. synchronization attempt, a new \fBFolderErrors\fP event is emitted.
  1290. .INDENT 0.0
  1291. .INDENT 3.5
  1292. .sp
  1293. .nf
  1294. .ft C
  1295. {
  1296. "id": 132,
  1297. "type": "FolderErrors",
  1298. "time": "2015\-06\-26T13:39:24.697401384+02:00",
  1299. "data": {
  1300. "errors": [
  1301. {
  1302. "error": "open /Users/jb/src/github.com/syncthing/syncthing/test/s2/h2j/.syncthing.aslkjd.tmp: permission denied",
  1303. "path": "h2j/aslkjd"
  1304. }
  1305. ],
  1306. "folder": "default"
  1307. }
  1308. }
  1309. .ft P
  1310. .fi
  1311. .UNINDENT
  1312. .UNINDENT
  1313. .sp
  1314. New in version 0.11.12.
  1315. .sp
  1316. \fBSEE ALSO:\fP
  1317. .INDENT 0.0
  1318. .INDENT 3.5
  1319. The statechanged event.
  1320. .UNINDENT
  1321. .UNINDENT
  1322. .SS FolderRejected
  1323. .sp
  1324. Emitted when a device sends index information for a folder we do not
  1325. have, or have but do not share with the device in question.
  1326. .INDENT 0.0
  1327. .INDENT 3.5
  1328. .sp
  1329. .nf
  1330. .ft C
  1331. {
  1332. "id": 27,
  1333. "type": "FolderRejected",
  1334. "time": "2014\-08\-19T10:41:06.761751399+02:00",
  1335. "data": {
  1336. "device": "EJHMPAQ\-OGCVORE\-ISB4IS3\-SYYVJXF\-TKJGLTU\-66DIQPF\-GJ5D2GX\-GQ3OWQK",
  1337. "folder": "GXWxf\-3zgnU",
  1338. "folderLabel": "My Pictures"
  1339. }
  1340. }
  1341. .ft P
  1342. .fi
  1343. .UNINDENT
  1344. .UNINDENT
  1345. .SS Folder Scan Progress
  1346. .sp
  1347. Emitted in regular intervals (folder setting ProgressIntervalS, 2s by default)
  1348. during scans giving the amount of bytes already scanned and to be scanned in
  1349. total , as well as the current scanning rates in bytes per second.
  1350. .INDENT 0.0
  1351. .INDENT 3.5
  1352. .sp
  1353. .nf
  1354. .ft C
  1355. {
  1356. "data" : {
  1357. "total" : 1,
  1358. "rate" : 0,
  1359. "current" : 0,
  1360. "folder" : "bd7q3\-zskm5"
  1361. },
  1362. "globalID" : 29,
  1363. "type" : "FolderScanProgress",
  1364. "time" : "2017\-03\-06T15:00:58.072004209+01:00",
  1365. "id" : 29
  1366. }
  1367. .ft P
  1368. .fi
  1369. .UNINDENT
  1370. .UNINDENT
  1371. .SS FolderSummary
  1372. .sp
  1373. The FolderSummary event is emitted when folder contents have changed
  1374. locally. This can be used to calculate the current local completion
  1375. state.
  1376. .INDENT 0.0
  1377. .INDENT 3.5
  1378. .sp
  1379. .nf
  1380. .ft C
  1381. {
  1382. "id": 16,
  1383. "type": "FolderSummary",
  1384. "time": "2015\-04\-17T14:12:20.460121585+09:00",
  1385. "data": {
  1386. "folder": "default",
  1387. "summary": {
  1388. "globalBytes": 0,
  1389. "globalDeleted": 0,
  1390. "globalFiles": 0,
  1391. "ignorePatterns": false,
  1392. "inSyncBytes": 0,
  1393. "inSyncFiles": 0,
  1394. "invalid": "",
  1395. "localBytes": 0,
  1396. "localDeleted": 0,
  1397. "localFiles": 0,
  1398. "needBytes": 0,
  1399. "needFiles": 0,
  1400. "state": "idle",
  1401. "stateChanged": "2015\-04\-17T14:12:12.455224687+09:00",
  1402. "version": 0
  1403. }
  1404. }
  1405. }
  1406. .ft P
  1407. .fi
  1408. .UNINDENT
  1409. .UNINDENT
  1410. .SS ItemFinished
  1411. .sp
  1412. Generated when Syncthing ends synchronizing a file to a newer version. A
  1413. successful operation:
  1414. .INDENT 0.0
  1415. .INDENT 3.5
  1416. .sp
  1417. .nf
  1418. .ft C
  1419. {
  1420. "id": 93,
  1421. "type": "ItemFinished",
  1422. "time": "2014\-07\-13T21:22:03.414609034+02:00",
  1423. "data": {
  1424. "item": "test.txt",
  1425. "folder": "default",
  1426. "error": null,
  1427. "type": "file",
  1428. "action": "update"
  1429. }
  1430. }
  1431. .ft P
  1432. .fi
  1433. .UNINDENT
  1434. .UNINDENT
  1435. .sp
  1436. An unsuccessful operation:
  1437. .INDENT 0.0
  1438. .INDENT 3.5
  1439. .sp
  1440. .nf
  1441. .ft C
  1442. {
  1443. "id": 44,
  1444. "type": "ItemFinished",
  1445. "time": "2015\-05\-27T11:21:05.711133004+02:00",
  1446. "data": {
  1447. "action": "update",
  1448. "error": "open /Users/jb/src/github.com/syncthing/syncthing/test/s2/foo/.syncthing.hej.tmp: permission denied",
  1449. "folder": "default",
  1450. "item": "foo/hej",
  1451. "type": "file"
  1452. }
  1453. }
  1454. .ft P
  1455. .fi
  1456. .UNINDENT
  1457. .UNINDENT
  1458. .sp
  1459. The \fBaction\fP field is either \fBupdate\fP (contents changed), \fBmetadata\fP (file metadata changed but not contents), or \fBdelete\fP\&.
  1460. .sp
  1461. New in version 0.11.10: The \fBmetadata\fP action.
  1462. .SS ItemStarted
  1463. .sp
  1464. Generated when Syncthing begins synchronizing a file to a newer version.
  1465. .INDENT 0.0
  1466. .INDENT 3.5
  1467. .sp
  1468. .nf
  1469. .ft C
  1470. {
  1471. "id": 93,
  1472. "type": "ItemStarted",
  1473. "time": "2014\-07\-13T21:22:03.414609034+02:00",
  1474. "data": {
  1475. "item": "test.txt",
  1476. "folder": "default",
  1477. "type": "file",
  1478. "action": "update"
  1479. }
  1480. }
  1481. .ft P
  1482. .fi
  1483. .UNINDENT
  1484. .UNINDENT
  1485. .sp
  1486. The \fBaction\fP field is either \fBupdate\fP (contents changed), \fBmetadata\fP (file metadata changed but not contents), or \fBdelete\fP\&.
  1487. .sp
  1488. New in version 0.11.10: The \fBmetadata\fP action.
  1489. .SS Listen Addresses Changed
  1490. .sp
  1491. This event is emitted when a listen address changes.
  1492. .INDENT 0.0
  1493. .INDENT 3.5
  1494. .sp
  1495. .nf
  1496. .ft C
  1497. {
  1498. "type" : "ListenAddressesChanged",
  1499. "id" : 70,
  1500. "time" : "2017\-03\-06T15:01:24.88340663+01:00",
  1501. "globalID" : 70,
  1502. "data" : {
  1503. "address" : {
  1504. "Fragment" : "",
  1505. "RawQuery" : "",
  1506. "Scheme" : "dynamic+https",
  1507. "Path" : "/endpoint",
  1508. "RawPath" : "",
  1509. "User" : null,
  1510. "ForceQuery" : false,
  1511. "Host" : "relays.syncthing.net",
  1512. "Opaque" : ""
  1513. },
  1514. "wan" : [
  1515. {
  1516. "ForceQuery" : false,
  1517. "User" : null,
  1518. "Host" : "31.15.66.212:443",
  1519. "Opaque" : "",
  1520. "Path" : "/",
  1521. "RawPath" : "",
  1522. "RawQuery" : "id=F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=",
  1523. "Scheme" : "relay",
  1524. "Fragment" : ""
  1525. }
  1526. ],
  1527. "lan" : [
  1528. {
  1529. "RawQuery" : "id=F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=",
  1530. "Scheme" : "relay",
  1531. "Fragment" : "",
  1532. "RawPath" : "",
  1533. "Path" : "/",
  1534. "Host" : "31.15.66.212:443",
  1535. "Opaque" : "",
  1536. "ForceQuery" : false,
  1537. "User" : null
  1538. }
  1539. ]
  1540. }
  1541. }
  1542. .ft P
  1543. .fi
  1544. .UNINDENT
  1545. .UNINDENT
  1546. .SS LocalChangeDetected
  1547. .sp
  1548. Generated upon scan whenever the local disk has discovered an updated file from the
  1549. previous scan. This does \fInot\fP include events that are discovered and copied from
  1550. other devices (remote\-change\-detected), only files that were changed on the
  1551. local filesystem.
  1552. .INDENT 0.0
  1553. .INDENT 3.5
  1554. .sp
  1555. .nf
  1556. .ft C
  1557. {
  1558. "id": 7,
  1559. "globalID": 59,
  1560. "time": "2016\-09\-26T22:07:10.7189141\-04:00",
  1561. "type": "LocalChangeDetected",
  1562. "data": {
  1563. "action": "deleted",
  1564. "folderID": "vitwy\-zjxqt",
  1565. "label": "TestSync",
  1566. "path": "C:\e\eUsers\e\eNate\e\eSync\e\etestfolder\e\etest file.rtf",
  1567. "type": "file"
  1568. }
  1569. }
  1570. .ft P
  1571. .fi
  1572. .UNINDENT
  1573. .UNINDENT
  1574. .SS LocalIndexUpdated
  1575. .sp
  1576. Generated when the local index information has changed, due to
  1577. synchronizing one or more items from the cluster or discovering local
  1578. changes during a scan.
  1579. .INDENT 0.0
  1580. .INDENT 3.5
  1581. .sp
  1582. .nf
  1583. .ft C
  1584. {
  1585. "id": 59,
  1586. "type": "LocalIndexUpdated",
  1587. "time": "2014\-07\-17T13:27:28.051369434+02:00",
  1588. "data": {
  1589. "folder": "default",
  1590. "items": 1000,
  1591. }
  1592. }
  1593. .ft P
  1594. .fi
  1595. .UNINDENT
  1596. .UNINDENT
  1597. .SS Login Attempt
  1598. .sp
  1599. When authentication is enabled for the GUI, this event is emitted on every
  1600. login attempt. If either the username or password are incorrect, \fBsuccess\fP
  1601. is false and in any case the given username is returned.
  1602. .INDENT 0.0
  1603. .INDENT 3.5
  1604. .sp
  1605. .nf
  1606. .ft C
  1607. {
  1608. "id" : 187,
  1609. "time" : "2017\-03\-07T00:19:24.420386143+01:00",
  1610. "data" : {
  1611. "username" : "somename",
  1612. "success" : false
  1613. },
  1614. "type" : "LoginAttempt",
  1615. "globalID" : 195
  1616. }
  1617. .ft P
  1618. .fi
  1619. .UNINDENT
  1620. .UNINDENT
  1621. .SS RemoteChangeDetected
  1622. .sp
  1623. Generated upon scan whenever a file is locally updated due to a remote change.
  1624. Files that are updated locally produce a local\-change\-detected event.
  1625. .INDENT 0.0
  1626. .INDENT 3.5
  1627. .sp
  1628. .nf
  1629. .ft C
  1630. {
  1631. "time" : "2017\-03\-06T23:58:21.844739891+01:00",
  1632. "globalID" : 123,
  1633. "data" : {
  1634. "type" : "file",
  1635. "action" : "deleted",
  1636. "path" : "/media/ntfs_data/Dokumente/testfile",
  1637. "label" : "Dokumente",
  1638. "folderID" : "Dokumente",
  1639. "modifiedBy" : "BPDFDTU"
  1640. },
  1641. "type" : "RemoteChangeDetected",
  1642. "id" : 2
  1643. }
  1644. .ft P
  1645. .fi
  1646. .UNINDENT
  1647. .UNINDENT
  1648. .SS Remote Download Progress
  1649. .sp
  1650. This event is emitted when a download\-progress message is
  1651. received. It returns a map \fBdata\fP of filenames with a count of
  1652. downloaded blocks. The files in questions are currently being
  1653. downloaded on the remote \fBdevice\fP and belong to \fBfolder\fP\&.
  1654. .INDENT 0.0
  1655. .INDENT 3.5
  1656. .sp
  1657. .nf
  1658. .ft C
  1659. {
  1660. "time" : "2017\-03\-07T00:11:37.65838955+01:00",
  1661. "globalID" : 170,
  1662. "data" : {
  1663. "state" : {
  1664. "tahr64\-6.0.5.iso" : 1784
  1665. },
  1666. "device" : "F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A",
  1667. "folder" : "Dokumente"
  1668. },
  1669. "type" : "RemoteDownloadProgress",
  1670. "id" : 163
  1671. }
  1672. .ft P
  1673. .fi
  1674. .UNINDENT
  1675. .UNINDENT
  1676. .SS RemoteIndexUpdated
  1677. .sp
  1678. Generated each time new index information is received from a device.
  1679. .INDENT 0.0
  1680. .INDENT 3.5
  1681. .sp
  1682. .nf
  1683. .ft C
  1684. {
  1685. "id": 44,
  1686. "type": "RemoteIndexUpdated",
  1687. "time": "2014\-07\-13T21:04:35.394184435+02:00",
  1688. "data": {
  1689. "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG",
  1690. "folder": "lightroom",
  1691. "items": 1000
  1692. }
  1693. }
  1694. .ft P
  1695. .fi
  1696. .UNINDENT
  1697. .UNINDENT
  1698. .SS Starting
  1699. .sp
  1700. Emitted exactly once, when Syncthing starts, before parsing
  1701. configuration etc.
  1702. .INDENT 0.0
  1703. .INDENT 3.5
  1704. .sp
  1705. .nf
  1706. .ft C
  1707. {
  1708. "id": 1,
  1709. "type": "Starting",
  1710. "time": "2014\-07\-17T13:13:32.044470055+02:00",
  1711. "data": {
  1712. "home": "/home/jb/.config/syncthing"
  1713. }
  1714. }
  1715. .ft P
  1716. .fi
  1717. .UNINDENT
  1718. .UNINDENT
  1719. .SS StartupComplete
  1720. .sp
  1721. Emitted exactly once, when initialization is complete and Syncthing is
  1722. ready to start exchanging data with other devices.
  1723. .INDENT 0.0
  1724. .INDENT 3.5
  1725. .sp
  1726. .nf
  1727. .ft C
  1728. {
  1729. "id": 1,
  1730. "type": "StartupComplete",
  1731. "time": "2014\-07\-13T21:03:18.383239179+02:00",
  1732. "data": null
  1733. }
  1734. .ft P
  1735. .fi
  1736. .UNINDENT
  1737. .UNINDENT
  1738. .SS StateChanged
  1739. .sp
  1740. Emitted when a folder changes state. Possible states are \fBidle\fP,
  1741. \fBscanning\fP, \fBsyncing\fP and \fBerror\fP\&. The field \fBduration\fP is
  1742. the number of seconds the folder spent in state \fBfrom\fP\&. In the example
  1743. below, the folder \fBdefault\fP was in state \fBscanning\fP for 0.198
  1744. seconds and is now in state \fBidle\fP\&.
  1745. .INDENT 0.0
  1746. .INDENT 3.5
  1747. .sp
  1748. .nf
  1749. .ft C
  1750. {
  1751. "id": 8,
  1752. "type": "StateChanged",
  1753. "time": "2014\-07\-17T13:14:28.697493016+02:00",
  1754. "data": {
  1755. "folder": "default",
  1756. "from": "scanning",
  1757. "duration": 0.19782869900000002,
  1758. "to": "idle"
  1759. }
  1760. }
  1761. .ft P
  1762. .fi
  1763. .UNINDENT
  1764. .UNINDENT
  1765. .SS GET /rest/events/disk
  1766. .sp
  1767. Returns local disk events that occur when the scanner detects local file system
  1768. changes (local\-change\-detected) or when files are pulled from a remote
  1769. device (remote\-change\-detected).
  1770. .INDENT 0.0
  1771. .TP
  1772. .B Optional GET parameters:
  1773. .INDENT 7.0
  1774. .IP \(bu 2
  1775. since (events starting after the given ID)
  1776. .IP \(bu 2
  1777. timeout (fail after given seconds if no event is available, 2s by default)
  1778. .IP \(bu 2
  1779. limit (return last x number of events)
  1780. .UNINDENT
  1781. .UNINDENT
  1782. .INDENT 0.0
  1783. .INDENT 3.5
  1784. .sp
  1785. .nf
  1786. .ft C
  1787. $ curl \-s http://localhost:8384/rest/events/disk?limit=4 | json
  1788. {
  1789. "id": 4,
  1790. "globalID": 45,
  1791. "time": "2016\-09\-26T22:06:10.4734536\-04:00",
  1792. "type": "LocalChangeDetected",
  1793. "data": {
  1794. "action": "added",
  1795. "folderID": "vitwy\-zxuqt",
  1796. "label": "TestSync",
  1797. "path": "C:\e\eUsers\e\eNate\e\eSync\e\etestfolder",
  1798. "type": "dir"
  1799. }
  1800. },
  1801. {
  1802. "id": 5,
  1803. "globalID": 46,
  1804. "time": "2016\-09\-26T22:06:10.4754548\-04:00",
  1805. "type": "LocalChangeDetected",
  1806. "data": {
  1807. "action": "added",
  1808. "folderID": "vitwy\-zxuqt",
  1809. "label": "TestSync",
  1810. "path": "C:\e\eUsers\e\eNate\e\eSync\e\edfghdfj\e\etest file.rtf",
  1811. "type": "file"
  1812. }
  1813. },
  1814. {
  1815. "id": 6,
  1816. "globalID": 58,
  1817. "time": "2016\-09\-26T22:07:10.7189141\-04:00",
  1818. "type": "LocalChangeDetected",
  1819. "data": {
  1820. "action": "deleted",
  1821. "folderID": "vitwy\-zxuqt",
  1822. "label": "TestSync",
  1823. "path": "C:\e\eUsers\e\eNate\e\eSync\e\etestfolder",
  1824. "type": "dir"
  1825. }
  1826. },
  1827. {
  1828. "id": 7,
  1829. "globalID": 59,
  1830. "time": "2016\-09\-26T22:07:10.7189141\-04:00",
  1831. "type": "LocalChangeDetected",
  1832. "data": {
  1833. "action": "deleted",
  1834. "folderID": "vitwy\-zxuqt",
  1835. "label": "TestSync",
  1836. "path": "C:\e\eUsers\e\eNate\e\eSync\e\edfghdfj\e\etest file.rtf",
  1837. "type": "file"
  1838. }
  1839. }
  1840. .ft P
  1841. .fi
  1842. .UNINDENT
  1843. .UNINDENT
  1844. .SH STATISTICS ENDPOINTS
  1845. .SS GET /rest/stats/device
  1846. .sp
  1847. Returns general statistics about devices. Currently, only contains the
  1848. time the device was last seen.
  1849. .INDENT 0.0
  1850. .INDENT 3.5
  1851. .sp
  1852. .nf
  1853. .ft C
  1854. $ curl \-s http://localhost:8384/rest/stats/device | json
  1855. {
  1856. "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2": {
  1857. "lastSeen" : "2015\-04\-18T11:21:31.3256277+01:00"
  1858. }
  1859. }
  1860. .ft P
  1861. .fi
  1862. .UNINDENT
  1863. .UNINDENT
  1864. .SS GET /rest/stats/folder
  1865. .sp
  1866. Returns general statistics about folders. Currently contains the
  1867. last scan time and the last synced file.
  1868. .INDENT 0.0
  1869. .INDENT 3.5
  1870. .sp
  1871. .nf
  1872. .ft C
  1873. $ curl \-s http://localhost:8384/rest/stats/folder | json
  1874. {
  1875. "folderid" : {
  1876. "lastScan": "2016\-06\-02T13:28:01.288181412\-04:00",
  1877. "lastFile" : {
  1878. "filename" : "file/name",
  1879. "at" : "2015\-04\-16T22:04:18.3066971+01:00"
  1880. }
  1881. }
  1882. }
  1883. .ft P
  1884. .fi
  1885. .UNINDENT
  1886. .UNINDENT
  1887. .SH MISC SERVICES ENDPOINTS
  1888. .SS GET /rest/svc/deviceid
  1889. .sp
  1890. Verifies and formats a device ID. Accepts all currently valid formats
  1891. (52 or 56 characters with or without separators, upper or lower case,
  1892. with trivial substitutions). Takes one parameter, \fBid\fP, and returns
  1893. either a valid device ID in modern format, or an error.
  1894. .INDENT 0.0
  1895. .INDENT 3.5
  1896. .sp
  1897. .nf
  1898. .ft C
  1899. $ curl \-s http://localhost:8384/rest/svc/deviceid?id=1234 | json
  1900. {
  1901. "error": "device ID invalid: incorrect length"
  1902. }
  1903. $ curl \-s http://localhost:8384/rest/svc/deviceid?id=p56ioi7m\-\-zjnu2iq\-gdr\-eydm\-2mgtmgl3bxnpq6w5btbbz4tjxzwicq | json
  1904. {
  1905. "id": "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2"
  1906. }
  1907. .ft P
  1908. .fi
  1909. .UNINDENT
  1910. .UNINDENT
  1911. .SS GET /rest/svc/lang
  1912. .sp
  1913. Returns a list of canonicalized localization codes, as picked up from
  1914. the \fBAccept\-Language\fP header sent by the browser.
  1915. .INDENT 0.0
  1916. .INDENT 3.5
  1917. .sp
  1918. .nf
  1919. .ft C
  1920. ["sv_sv","sv","en_us","en"]
  1921. .ft P
  1922. .fi
  1923. .UNINDENT
  1924. .UNINDENT
  1925. .SS GET /rest/svc/random/string
  1926. .sp
  1927. Returns a strong random generated string (alphanumeric) of the specified length. Takes the \fBlength\fP parameter.
  1928. .INDENT 0.0
  1929. .INDENT 3.5
  1930. .sp
  1931. .nf
  1932. .ft C
  1933. {
  1934. "random": "FdPaEaZQ56sXEKYNxpgF"
  1935. }
  1936. .ft P
  1937. .fi
  1938. .UNINDENT
  1939. .UNINDENT
  1940. .SS GET /rest/svc/report
  1941. .sp
  1942. Returns the data sent in the anonymous usage report.
  1943. .INDENT 0.0
  1944. .INDENT 3.5
  1945. .sp
  1946. .nf
  1947. .ft C
  1948. {
  1949. "folderMaxMiB" : 0,
  1950. "platform" : "linux\-amd64",
  1951. "totMiB" : 0,
  1952. "longVersion" : "syncthing v0.12.2 \e"Beryllium Bedbug\e" (go1.4.3 linux\-amd64 default) unknown\[email protected] 2015\-11\-09 13:23:26 UTC",
  1953. "upgradeAllowedManual" : true,
  1954. "totFiles" : 3,
  1955. "folderUses" : {
  1956. "ignorePerms" : 0,
  1957. "autoNormalize" : 0,
  1958. "readonly" : 0,
  1959. "ignoreDelete" : 0
  1960. },
  1961. "memoryUsageMiB" : 13,
  1962. "version" : "v0.12.2",
  1963. "sha256Perf" : 27.28,
  1964. "numFolders" : 2,
  1965. "memorySize" : 1992,
  1966. "announce" : {
  1967. "defaultServersIP" : 0,
  1968. "otherServers" : 0,
  1969. "globalEnabled" : false,
  1970. "defaultServersDNS" : 1,
  1971. "localEnabled" : false
  1972. },
  1973. "usesRateLimit" : false,
  1974. "numCPU" : 2,
  1975. "uniqueID" : "",
  1976. "urVersion" : 2,
  1977. "rescanIntvs" : [
  1978. 60,
  1979. 60
  1980. ],
  1981. "numDevices" : 2,
  1982. "folderMaxFiles" : 3,
  1983. "relays" : {
  1984. "defaultServers" : 1,
  1985. "enabled" : true,
  1986. "otherServers" : 0
  1987. },
  1988. "deviceUses" : {
  1989. "compressMetadata" : 1,
  1990. "customCertName" : 0,
  1991. "staticAddr" : 1,
  1992. "compressAlways" : 0,
  1993. "compressNever" : 1,
  1994. "introducer" : 0,
  1995. "dynamicAddr" : 1
  1996. },
  1997. "upgradeAllowedAuto" : false
  1998. }
  1999. .ft P
  2000. .fi
  2001. .UNINDENT
  2002. .UNINDENT
  2003. .SH AUTHOR
  2004. The Syncthing Authors
  2005. .SH COPYRIGHT
  2006. 2015, The Syncthing Authors
  2007. .\" Generated by docutils manpage writer.
  2008. .