syncthing-event-api.7 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  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-EVENT-API" "7" "Oct 07, 2022" "v1.22.0" "Syncthing"
  31. .SH NAME
  32. syncthing-event-api \- Event API
  33. .SH DESCRIPTION
  34. .sp
  35. Syncthing provides a simple long polling interface for exposing events from the
  36. core utility towards a GUI. To receive events, see /rest/events\-get\&.
  37. .SH EVENT STRUCTURE
  38. .sp
  39. Each event is represented by an object similar to the following:
  40. .INDENT 0.0
  41. .INDENT 3.5
  42. .sp
  43. .nf
  44. .ft C
  45. {
  46. "id": 2,
  47. "globalID": 3,
  48. "type": "DeviceConnected",
  49. "time": "2014\-07\-13T21:04:33.687836696+02:00",
  50. "data": {
  51. "addr": "172.16.32.25:22000",
  52. "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  53. }
  54. }
  55. .ft P
  56. .fi
  57. .UNINDENT
  58. .UNINDENT
  59. .sp
  60. The top level keys \fBid\fP, \fBglobalID\fP, \fBtime\fP, \fBtype\fP and \fBdata\fP are always present,
  61. though \fBdata\fP may be \fBnull\fP\&.
  62. .INDENT 0.0
  63. .TP
  64. .B id
  65. A unique ID for this event on the events API. It always increases by 1: the first
  66. event generated has id \fB1\fP, the next has id \fB2\fP etc. If this increases by
  67. more than 1, then one or more events have been skipped by the events API.
  68. .TP
  69. .B globalID
  70. A global ID for this event, across the events API, the audit log, and any other
  71. sources. It may increase by more than 1, but it will always be greater
  72. than or equal to the id.
  73. .TP
  74. .B time
  75. The time the event was generated.
  76. .TP
  77. .B type
  78. Indicates the type of (i.e. reason for) the event and is one of the event
  79. types below.
  80. .TP
  81. .B data
  82. An object containing optional extra information; the exact structure is
  83. determined by the event type.
  84. .UNINDENT
  85. .SH EVENT TYPES
  86. .SS ClusterConfigReceived
  87. .sp
  88. New in version 1.20.0.
  89. .sp
  90. The \fBClusterConfigReceived\fP event is emitted after processing such a protocol
  91. message received from a remote device. It is mainly used for internal purposes.
  92. .INDENT 0.0
  93. .INDENT 3.5
  94. .sp
  95. .nf
  96. .ft C
  97. {
  98. "id": 84,
  99. "globalID": 84,
  100. "type": "ClusterConfigReceived",
  101. "time": "2022\-04\-27T14:14:27.043576583+09:00",
  102. "data": {
  103. "device": "I6KAH76\-66SLLLB\-5PFXSOA\-UFJCDZC\-YAOMLEK\-CP2GB32\-BV5RQST\-3PSROAU"
  104. }
  105. }
  106. .ft P
  107. .fi
  108. .UNINDENT
  109. .UNINDENT
  110. .SS ConfigSaved
  111. .sp
  112. Emitted after the config has been saved by the user or by Syncthing
  113. itself.
  114. .INDENT 0.0
  115. .INDENT 3.5
  116. .sp
  117. .nf
  118. .ft C
  119. {
  120. "id": 50,
  121. "globalID": 50,
  122. "type": "ConfigSaved",
  123. "time": "2014\-12\-13T00:09:13.5166486Z",
  124. "data": {
  125. "version": 7,
  126. "folders": [{"..."}],
  127. "devices": [{"..."}],
  128. "gui": {"..."},
  129. "ldap": {"..."},
  130. "options": {"..."},
  131. "remoteIgnoredDevices": [{"..."}],
  132. "defaults": {"..."}
  133. }
  134. }
  135. .ft P
  136. .fi
  137. .UNINDENT
  138. .UNINDENT
  139. .SS DeviceConnected
  140. .sp
  141. Generated each time a connection to a device has been established.
  142. .INDENT 0.0
  143. .INDENT 3.5
  144. .sp
  145. .nf
  146. .ft C
  147. {
  148. "id": 2,
  149. "globalID": 2,
  150. "type": "DeviceConnected",
  151. "time": "2014\-07\-13T21:04:33.687836696+02:00",
  152. "data": {
  153. "addr": "172.16.32.25:22000",
  154. "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG",
  155. "deviceName": "Laptop",
  156. "clientName": "syncthing",
  157. "clientVersion": "v0.13.4",
  158. "type": "TCP (Client)"
  159. }
  160. }
  161. .ft P
  162. .fi
  163. .UNINDENT
  164. .UNINDENT
  165. .SS DeviceDisconnected
  166. .sp
  167. Generated each time a connection to a device has been terminated.
  168. .INDENT 0.0
  169. .INDENT 3.5
  170. .sp
  171. .nf
  172. .ft C
  173. {
  174. "id": 48,
  175. "globalID": 48,
  176. "type": "DeviceDisconnected",
  177. "time": "2014\-07\-13T21:18:52.859929215+02:00",
  178. "data": {
  179. "error": "unexpected EOF",
  180. "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  181. }
  182. }
  183. .ft P
  184. .fi
  185. .UNINDENT
  186. .UNINDENT
  187. .sp
  188. \fBNOTE:\fP
  189. .INDENT 0.0
  190. .INDENT 3.5
  191. The error key contains the cause for disconnection, which might not
  192. necessarily be an error as such. Specifically, “EOF” and “unexpected
  193. EOF” both signify TCP connection termination, either due to the other
  194. device restarting or going offline or due to a network change.
  195. .UNINDENT
  196. .UNINDENT
  197. .SS DeviceDiscovered
  198. .sp
  199. Emitted when a new device is discovered using local discovery.
  200. .INDENT 0.0
  201. .INDENT 3.5
  202. .sp
  203. .nf
  204. .ft C
  205. {
  206. "id": 13,
  207. "globalID": 13,
  208. "type": "DeviceDiscovered",
  209. "time": "2014\-07\-17T13:28:05.043465207+02:00",
  210. "data": {
  211. "addrs": [
  212. "172.16.32.25:22000"
  213. ],
  214. "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  215. }
  216. }
  217. .ft P
  218. .fi
  219. .UNINDENT
  220. .UNINDENT
  221. .SS DevicePaused
  222. .sp
  223. Emitted when a device was paused.
  224. .INDENT 0.0
  225. .INDENT 3.5
  226. .sp
  227. .nf
  228. .ft C
  229. {
  230. "id": 13,
  231. "globalID": 13,
  232. "type": "DevicePaused",
  233. "time": "2014\-07\-17T13:28:05.043465207+02:00",
  234. "data": {
  235. "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  236. }
  237. }
  238. .ft P
  239. .fi
  240. .UNINDENT
  241. .UNINDENT
  242. .SS DeviceRejected (DEPRECATED)
  243. .sp
  244. Deprecated since version v1.13.0: This event is still emitted for compatibility, but deprecated. Use
  245. the replacement pendingdeviceschanged event instead.
  246. .sp
  247. Emitted when there is a connection from a device we are not configured
  248. to talk to.
  249. .INDENT 0.0
  250. .INDENT 3.5
  251. .sp
  252. .nf
  253. .ft C
  254. {
  255. "id": 24,
  256. "globalID": 24,
  257. "type": "DeviceRejected",
  258. "time": "2014\-08\-19T10:43:00.562821045+02:00",
  259. "data": {
  260. "address": "127.0.0.1:51807",
  261. "name": "My dusty computer",
  262. "device": "EJHMPAQ\-OGCVORE\-ISB4IS3\-SYYVJXF\-TKJGLTU\-66DIQPF\-GJ5D2GX\-GQ3OWQK"
  263. }
  264. }
  265. .ft P
  266. .fi
  267. .UNINDENT
  268. .UNINDENT
  269. .SS DeviceResumed
  270. .sp
  271. Generated each time a device was resumed.
  272. .INDENT 0.0
  273. .INDENT 3.5
  274. .sp
  275. .nf
  276. .ft C
  277. {
  278. "id": 2,
  279. "globalID": 2,
  280. "type": "DeviceResumed",
  281. "time": "2014\-07\-13T21:04:33.687836696+02:00",
  282. "data": {
  283. "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
  284. }
  285. }
  286. .ft P
  287. .fi
  288. .UNINDENT
  289. .UNINDENT
  290. .SS DownloadProgress
  291. .sp
  292. Emitted during file downloads for each folder for each file. By default
  293. only a single file in a folder is handled at the same time, but custom
  294. configuration can cause multiple files to be shown.
  295. .INDENT 0.0
  296. .INDENT 3.5
  297. .sp
  298. .nf
  299. .ft C
  300. {
  301. "id": 221,
  302. "globalID": 221,
  303. "type": "DownloadProgress",
  304. "time": "2014\-12\-13T00:26:12.9876937Z",
  305. "data": {
  306. "folder1": {
  307. "file1": {
  308. "total": 800,
  309. "pulling": 2,
  310. "copiedFromOrigin": 0,
  311. "reused": 633,
  312. "copiedFromElsewhere": 0,
  313. "pulled": 38,
  314. "bytesTotal": 104792064,
  315. "bytesDone": 87883776
  316. },
  317. "dir\e\efile2": {
  318. "total": 80,
  319. "pulling": 2,
  320. "copiedFromOrigin": 0,
  321. "reused": 0,
  322. "copiedFromElsewhere": 0,
  323. "pulled": 32,
  324. "bytesTotal": 10420224,
  325. "bytesDone": 4128768
  326. }
  327. },
  328. "folder2": {
  329. "file3": {
  330. "total": 800,
  331. "pulling": 2,
  332. "copiedFromOrigin": 0,
  333. "reused": 633,
  334. "copiedFromElsewhere": 0,
  335. "pulled": 38,
  336. "bytesTotal": 104792064,
  337. "bytesDone": 87883776
  338. },
  339. "dir\e\efile4": {
  340. "total": 80,
  341. "pulling": 2,
  342. "copiedFromOrigin": 0,
  343. "reused": 0,
  344. "copiedFromElsewhere": 0,
  345. "pulled": 32,
  346. "bytesTotal": 10420224,
  347. "bytesDone": 4128768
  348. }
  349. }
  350. }
  351. }
  352. .ft P
  353. .fi
  354. .UNINDENT
  355. .UNINDENT
  356. .INDENT 0.0
  357. .IP \(bu 2
  358. \fBtotal\fP \- total number of blocks in the file
  359. .IP \(bu 2
  360. \fBpulling\fP \- number of blocks currently being downloaded
  361. .IP \(bu 2
  362. \fBcopiedFromOrigin\fP \- number of blocks copied from the file we are
  363. about to replace
  364. .IP \(bu 2
  365. \fBreused\fP \- number of blocks reused from a previous temporary file
  366. .IP \(bu 2
  367. \fBcopiedFromElsewhere\fP \- number of blocks copied from other files or
  368. potentially other folders
  369. .IP \(bu 2
  370. \fBpulled\fP \- number of blocks actually downloaded so far
  371. .IP \(bu 2
  372. \fBbytesTotal\fP \- approximate total file size
  373. .IP \(bu 2
  374. \fBbytesDone\fP \- approximate number of bytes already handled (already
  375. reused, copied or pulled)
  376. .UNINDENT
  377. .sp
  378. Where block size is 128KB.
  379. .sp
  380. Files/folders appearing in the event data imply that the download has
  381. been started for that file/folder, where disappearing implies that the
  382. downloads have been finished or failed for that file/folder. There is
  383. always a last event emitted with no data, which implies all downloads
  384. have finished/failed.
  385. .SS Failure
  386. .sp
  387. Generated for specific errors that will also be sent to the usage
  388. reporting server, if enabled in the configuration. These are usually
  389. of special interest to the developers to troubleshoot complex errors.
  390. The \fBdata\fP field contains a textual error message.
  391. .INDENT 0.0
  392. .INDENT 3.5
  393. .sp
  394. .nf
  395. .ft C
  396. {
  397. "id": 93,
  398. "globalID": 93,
  399. "type": "Failure",
  400. "time": "2021\-06\-07T21:22:03.414609034+02:00",
  401. "data": "index handler got paused while already paused"
  402. }
  403. .ft P
  404. .fi
  405. .UNINDENT
  406. .UNINDENT
  407. .SS FolderCompletion
  408. .sp
  409. The \fBFolderCompletion\fP event is emitted when the local or remote
  410. contents for a folder changes. It contains the completion percentage for
  411. a given remote device and is emitted once per currently connected remote
  412. device.
  413. .sp
  414. New in version 1.20.0: Indication whether the remote device has accepted the folder (shares it with
  415. us) as well, and whether it is paused. The \fBremoteState\fP field is
  416. \fBunknown\fP when the remote device is not connected. Otherwise it can be
  417. either \fBpaused\fP, \fBnotSharing\fP, or \fBvalid\fP if the remote is sharing back.
  418. .INDENT 0.0
  419. .INDENT 3.5
  420. .sp
  421. .nf
  422. .ft C
  423. {
  424. "id": 84,
  425. "globalID": 84,
  426. "type": "FolderCompletion",
  427. "time": "2022\-04\-27T14:14:27.043576583+09:00",
  428. "data": {
  429. "completion": 100,
  430. "device": "I6KAH76\-66SLLLB\-5PFXSOA\-UFJCDZC\-YAOMLEK\-CP2GB32\-BV5RQST\-3PSROAU",
  431. "folder": "default",
  432. "globalBytes": 17,
  433. "globalItems": 4,
  434. "needBytes": 0,
  435. "needDeletes": 0,
  436. "needItems": 0,
  437. "remoteState": "valid",
  438. "sequence": 12
  439. }
  440. }
  441. .ft P
  442. .fi
  443. .UNINDENT
  444. .UNINDENT
  445. .SS FolderErrors
  446. .sp
  447. The \fBFolderErrors\fP event is emitted when a folder cannot be successfully
  448. synchronized. The event contains the ID of the affected folder and a list of
  449. errors for files or directories therein. This list of errors is obsolete once
  450. the folder changes state to \fBsyncing\fP \- if errors remain after the next
  451. synchronization attempt, a new \fBFolderErrors\fP event is emitted.
  452. .INDENT 0.0
  453. .INDENT 3.5
  454. .sp
  455. .nf
  456. .ft C
  457. {
  458. "id": 132,
  459. "type": "FolderErrors",
  460. "time": "2015\-06\-26T13:39:24.697401384+02:00",
  461. "data": {
  462. "errors": [
  463. {
  464. "error": "open /Users/jb/src/github.com/syncthing/syncthing/test/s2/h2j/.syncthing.aslkjd.tmp: permission denied",
  465. "path": "h2j/aslkjd"
  466. }
  467. ],
  468. "folder": "default"
  469. }
  470. }
  471. .ft P
  472. .fi
  473. .UNINDENT
  474. .UNINDENT
  475. .sp
  476. New in version 0.11.12.
  477. .sp
  478. \fBSEE ALSO:\fP
  479. .INDENT 0.0
  480. .INDENT 3.5
  481. The statechanged event.
  482. .UNINDENT
  483. .UNINDENT
  484. .SS FolderPaused
  485. .sp
  486. Generated when the configuration changes regarding the “paused” state
  487. of a folder. Sent repeatedly for each changed folder.
  488. .INDENT 0.0
  489. .INDENT 3.5
  490. .sp
  491. .nf
  492. .ft C
  493. {
  494. "id": 93,
  495. "globalID": 93,
  496. "type": "FolderPaused",
  497. "time": "2021\-06\-07T23:45:03.414609034+02:00",
  498. "data": {
  499. "id": "abcde\-fghij",
  500. "label": "My folder"
  501. }
  502. }
  503. .ft P
  504. .fi
  505. .UNINDENT
  506. .UNINDENT
  507. .SS FolderRejected (DEPRECATED)
  508. .sp
  509. Deprecated since version v1.13.0: This event is still emitted for compatibility, but deprecated. Use
  510. the replacement pendingfolderschanged event instead.
  511. .sp
  512. Emitted when a device sends index information for a folder we do not
  513. have, or have but do not share with the device in question.
  514. .INDENT 0.0
  515. .INDENT 3.5
  516. .sp
  517. .nf
  518. .ft C
  519. {
  520. "id": 27,
  521. "globalID": 27,
  522. "type": "FolderRejected",
  523. "time": "2014\-08\-19T10:41:06.761751399+02:00",
  524. "data": {
  525. "device": "EJHMPAQ\-OGCVORE\-ISB4IS3\-SYYVJXF\-TKJGLTU\-66DIQPF\-GJ5D2GX\-GQ3OWQK",
  526. "folder": "GXWxf\-3zgnU",
  527. "folderLabel": "My Pictures"
  528. }
  529. }
  530. .ft P
  531. .fi
  532. .UNINDENT
  533. .UNINDENT
  534. .SS FolderResumed
  535. .sp
  536. Generated when the configuration changes regarding the “paused” state
  537. of a folder. Sent repeatedly for each changed folder.
  538. .INDENT 0.0
  539. .INDENT 3.5
  540. .sp
  541. .nf
  542. .ft C
  543. {
  544. "id": 93,
  545. "globalID": 93,
  546. "type": "FolderResumed",
  547. "time": "2021\-06\-07T23:45:03.414609034+02:00",
  548. "data": {
  549. "id": "abcde\-fghij",
  550. "label": "My folder"
  551. }
  552. }
  553. .ft P
  554. .fi
  555. .UNINDENT
  556. .UNINDENT
  557. .SS FolderScanProgress
  558. .sp
  559. Emitted in regular intervals (folder setting ProgressIntervalS, 2s by default)
  560. during scans giving the amount of bytes already scanned and to be scanned in
  561. total , as well as the current scanning rates in bytes per second.
  562. .INDENT 0.0
  563. .INDENT 3.5
  564. .sp
  565. .nf
  566. .ft C
  567. {
  568. "data" : {
  569. "total" : 1,
  570. "rate" : 0,
  571. "current" : 0,
  572. "folder" : "bd7q3\-zskm5"
  573. },
  574. "globalID" : 29,
  575. "type" : "FolderScanProgress",
  576. "time" : "2017\-03\-06T15:00:58.072004209+01:00",
  577. "id" : 29
  578. }
  579. .ft P
  580. .fi
  581. .UNINDENT
  582. .UNINDENT
  583. .SS FolderSummary
  584. .sp
  585. The FolderSummary event is emitted when folder contents have changed
  586. locally. This can be used to calculate the current local completion
  587. state.
  588. .INDENT 0.0
  589. .INDENT 3.5
  590. .sp
  591. .nf
  592. .ft C
  593. {
  594. "id": 16,
  595. "globalID": 16,
  596. "type": "FolderSummary",
  597. "time": "2015\-04\-17T14:12:20.460121585+09:00",
  598. "data": {
  599. "folder": "default",
  600. "summary": {
  601. "globalBytes": 0,
  602. "globalDeleted": 0,
  603. "globalFiles": 0,
  604. "ignorePatterns": false,
  605. "inSyncBytes": 0,
  606. "inSyncFiles": 0,
  607. "invalid": "",
  608. "localBytes": 0,
  609. "localDeleted": 0,
  610. "localFiles": 0,
  611. "needBytes": 0,
  612. "needFiles": 0,
  613. "state": "idle",
  614. "stateChanged": "2015\-04\-17T14:12:12.455224687+09:00",
  615. "version": 0
  616. }
  617. }
  618. }
  619. .ft P
  620. .fi
  621. .UNINDENT
  622. .UNINDENT
  623. .SS FolderWatchStateChanged
  624. .sp
  625. The \fBFolderWatchStateChanged\fP event is emitted when a folder’s watcher routine
  626. encounters a new error, or when a previous error disappeared after retrying.
  627. The event contains the ID of the affected folder and textual error messages
  628. describing the previous (\fBfrom\fP) and the updated (\fBto\fP) error conditions.
  629. If there was no error in either of these, the respective field is omitted.
  630. .INDENT 0.0
  631. .INDENT 3.5
  632. .sp
  633. .nf
  634. .ft C
  635. {
  636. "id": 123,
  637. "type": "FolderWatchStateChanged",
  638. "time": "2022\-03\-14T12:34:56.890000000+01:00",
  639. "data": {
  640. "folder": "default",
  641. "from": "Something bad happened.",
  642. "to": "Something worse happened."
  643. }
  644. }
  645. .ft P
  646. .fi
  647. .UNINDENT
  648. .UNINDENT
  649. .SS ItemFinished
  650. .sp
  651. Generated when Syncthing ends synchronizing a file to a newer version. A
  652. successful operation:
  653. .INDENT 0.0
  654. .INDENT 3.5
  655. .sp
  656. .nf
  657. .ft C
  658. {
  659. "id": 93,
  660. "globalID": 93,
  661. "type": "ItemFinished",
  662. "time": "2014\-07\-13T21:22:03.414609034+02:00",
  663. "data": {
  664. "item": "test.txt",
  665. "folder": "default",
  666. "error": null,
  667. "type": "file",
  668. "action": "update"
  669. }
  670. }
  671. .ft P
  672. .fi
  673. .UNINDENT
  674. .UNINDENT
  675. .sp
  676. An unsuccessful operation:
  677. .INDENT 0.0
  678. .INDENT 3.5
  679. .sp
  680. .nf
  681. .ft C
  682. {
  683. "id": 44,
  684. "globalID": 44,
  685. "type": "ItemFinished",
  686. "time": "2015\-05\-27T11:21:05.711133004+02:00",
  687. "data": {
  688. "action": "update",
  689. "error": "open /Users/jb/src/github.com/syncthing/syncthing/test/s2/foo/.syncthing.hej.tmp: permission denied",
  690. "folder": "default",
  691. "item": "foo/hej",
  692. "type": "file"
  693. }
  694. }
  695. .ft P
  696. .fi
  697. .UNINDENT
  698. .UNINDENT
  699. .sp
  700. The \fBaction\fP field is either \fBupdate\fP (contents changed), \fBmetadata\fP (file metadata changed but not contents), or \fBdelete\fP\&.
  701. .sp
  702. New in version 0.11.10: The \fBmetadata\fP action.
  703. .SS ItemStarted
  704. .sp
  705. Generated when Syncthing begins synchronizing a file to a newer version.
  706. .INDENT 0.0
  707. .INDENT 3.5
  708. .sp
  709. .nf
  710. .ft C
  711. {
  712. "id": 93,
  713. "globalID": 93,
  714. "type": "ItemStarted",
  715. "time": "2014\-07\-13T21:22:03.414609034+02:00",
  716. "data": {
  717. "item": "test.txt",
  718. "folder": "default",
  719. "type": "file",
  720. "action": "update"
  721. }
  722. }
  723. .ft P
  724. .fi
  725. .UNINDENT
  726. .UNINDENT
  727. .sp
  728. The \fBaction\fP field is either \fBupdate\fP (contents changed), \fBmetadata\fP (file metadata changed but not contents), or \fBdelete\fP\&.
  729. .sp
  730. New in version 0.11.10: The \fBmetadata\fP action.
  731. .SS ListenAddressesChanged
  732. .sp
  733. This event is emitted when a listen address changes.
  734. .INDENT 0.0
  735. .INDENT 3.5
  736. .sp
  737. .nf
  738. .ft C
  739. {
  740. "type" : "ListenAddressesChanged",
  741. "id" : 70,
  742. "time" : "2017\-03\-06T15:01:24.88340663+01:00",
  743. "globalID" : 70,
  744. "data" : {
  745. "address" : {
  746. "Fragment" : "",
  747. "RawQuery" : "",
  748. "Scheme" : "dynamic+https",
  749. "Path" : "/endpoint",
  750. "RawPath" : "",
  751. "User" : null,
  752. "ForceQuery" : false,
  753. "Host" : "relays.syncthing.net",
  754. "Opaque" : ""
  755. },
  756. "wan" : [
  757. {
  758. "ForceQuery" : false,
  759. "User" : null,
  760. "Host" : "31.15.66.212:443",
  761. "Opaque" : "",
  762. "Path" : "/",
  763. "RawPath" : "",
  764. "RawQuery" : "id=F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=",
  765. "Scheme" : "relay",
  766. "Fragment" : ""
  767. }
  768. ],
  769. "lan" : [
  770. {
  771. "RawQuery" : "id=F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=",
  772. "Scheme" : "relay",
  773. "Fragment" : "",
  774. "RawPath" : "",
  775. "Path" : "/",
  776. "Host" : "31.15.66.212:443",
  777. "Opaque" : "",
  778. "ForceQuery" : false,
  779. "User" : null
  780. }
  781. ]
  782. }
  783. }
  784. .ft P
  785. .fi
  786. .UNINDENT
  787. .UNINDENT
  788. .SS LocalChangeDetected
  789. .sp
  790. Generated upon scan whenever the local disk has discovered an updated file from the
  791. previous scan. This does \fInot\fP include events that are discovered and copied from
  792. other devices (remotechangedetected), only files that were changed on the
  793. local filesystem.
  794. .sp
  795. \fBNOTE:\fP
  796. .INDENT 0.0
  797. .INDENT 3.5
  798. This event is not included in /rest/events\-get endpoint without
  799. a mask specified, but needs to be selected explicitly.
  800. .UNINDENT
  801. .UNINDENT
  802. .INDENT 0.0
  803. .INDENT 3.5
  804. .sp
  805. .nf
  806. .ft C
  807. {
  808. "id": 7,
  809. "globalID": 59,
  810. "time": "2016\-09\-26T22:07:10.7189141\-04:00",
  811. "type": "LocalChangeDetected",
  812. "data": {
  813. "action": "deleted",
  814. "folder": "vitwy\-zjxqt",
  815. "folderID": "vitwy\-zjxqt",
  816. "label": "TestSync",
  817. "path": "C:\e\eUsers\e\eNate\e\eSync\e\etestfolder\e\etest file.rtf",
  818. "type": "file"
  819. }
  820. }
  821. .ft P
  822. .fi
  823. .UNINDENT
  824. .UNINDENT
  825. .sp
  826. Deprecated since version v1.1.2: The \fBfolderID\fP field is a legacy name kept only for compatibility. Use the
  827. \fBfolder\fP field with identical content instead.
  828. .SS LocalIndexUpdated
  829. .sp
  830. Generated when the local index information has changed, due to
  831. synchronizing one or more items from the cluster or discovering local
  832. changes during a scan.
  833. .INDENT 0.0
  834. .INDENT 3.5
  835. .sp
  836. .nf
  837. .ft C
  838. {
  839. "id": 59,
  840. "globalID": 59,
  841. "type": "LocalIndexUpdated",
  842. "time": "2014\-07\-17T13:27:28.051369434+02:00",
  843. "data": {
  844. "folder": "default",
  845. "items": 1000,
  846. "filenames": [
  847. "foo",
  848. "bar",
  849. "baz"
  850. ],
  851. "sequence": 12345,
  852. "version": 12345
  853. }
  854. }
  855. .ft P
  856. .fi
  857. .UNINDENT
  858. .UNINDENT
  859. .sp
  860. Deprecated since version v1.10.0: The \fBversion\fP field is a legacy name kept only for compatibility. Use the
  861. \fBsequence\fP field with identical content instead.
  862. .SS LoginAttempt
  863. .sp
  864. When authentication is enabled for the GUI, this event is emitted on every
  865. login attempt. If either the username or password are incorrect, \fBsuccess\fP
  866. is false and in any case the given username is returned. The included
  867. remote address concerns the immediate connecting host, which may not be the
  868. origin of the request, but e.g. a reverse proxy.
  869. .INDENT 0.0
  870. .INDENT 3.5
  871. .sp
  872. .nf
  873. .ft C
  874. {
  875. "id" : 187,
  876. "time" : "2017\-03\-07T00:19:24.420386143+01:00",
  877. "data" : {
  878. "remoteAddress" : "127.0.0.1:55530",
  879. "username" : "somename",
  880. "success" : false
  881. },
  882. "type" : "LoginAttempt",
  883. "globalID" : 195
  884. }
  885. .ft P
  886. .fi
  887. .UNINDENT
  888. .UNINDENT
  889. .SS PendingDevicesChanged
  890. .sp
  891. New in version 1.14.0.
  892. .sp
  893. Emitted when pending devices were added / updated (connection from
  894. unknown ID) or removed (device is ignored, dismissed or added).
  895. .INDENT 0.0
  896. .INDENT 3.5
  897. .sp
  898. .nf
  899. .ft C
  900. {
  901. "id": 87,
  902. "type": "PendingDevicesChanged",
  903. "time": "2020\-12\-22T22:24:37.578586718+01:00",
  904. "data": {
  905. "added": [
  906. {
  907. "address": "127.0.0.1:51807",
  908. "deviceID": "EJHMPAQ\-OGCVORE\-ISB4IS3\-SYYVJXF\-TKJGLTU\-66DIQPF\-GJ5D2GX\-GQ3OWQK",
  909. "name": "My dusty computer"
  910. }
  911. ],
  912. "removed": [
  913. {
  914. "deviceID": "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2"
  915. }
  916. ]
  917. }
  918. }
  919. .ft P
  920. .fi
  921. .UNINDENT
  922. .UNINDENT
  923. .SS PendingFoldersChanged
  924. .sp
  925. New in version 1.14.0.
  926. .sp
  927. Emitted when pending folders were added / updated (offered by some
  928. device, but not shared to them) or removed (folder ignored, dismissed
  929. or added or no longer offered from the remote device). A removed
  930. entry without a \fBdeviceID\fP attribute means that the folder is no
  931. longer pending for any device.
  932. .INDENT 0.0
  933. .INDENT 3.5
  934. .sp
  935. .nf
  936. .ft C
  937. {
  938. "id": 101,
  939. "type": "PendingFoldersChanged",
  940. "time": "2020\-12\-22T22:36:55.66744317+01:00",
  941. "data": {
  942. "added": [
  943. {
  944. "deviceID": "EJHMPAQ\-OGCVORE\-ISB4IS3\-SYYVJXF\-TKJGLTU\-66DIQPF\-GJ5D2GX\-GQ3OWQK",
  945. "folderID": "GXWxf\-3zgnU",
  946. "folderLabel": "My Pictures"
  947. "receiveEncrypted": "false"
  948. "remoteEncrypted": "false"
  949. }
  950. ],
  951. "removed": [
  952. {
  953. "deviceID": "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2",
  954. "folderID": "neyfh\-sa2nu"
  955. },
  956. {
  957. "folderID": "abcde\-fghij"
  958. }
  959. ]
  960. }
  961. }
  962. .ft P
  963. .fi
  964. .UNINDENT
  965. .UNINDENT
  966. .SS RemoteChangeDetected
  967. .sp
  968. Generated upon scan whenever a file is locally updated due to a remote change.
  969. Files that are updated locally produce a localchangedetected event.
  970. .sp
  971. \fBNOTE:\fP
  972. .INDENT 0.0
  973. .INDENT 3.5
  974. This event is not included in /rest/events\-get endpoint without
  975. a mask specified, but needs to be selected explicitly.
  976. .UNINDENT
  977. .UNINDENT
  978. .INDENT 0.0
  979. .INDENT 3.5
  980. .sp
  981. .nf
  982. .ft C
  983. {
  984. "time" : "2017\-03\-06T23:58:21.844739891+01:00",
  985. "globalID" : 123,
  986. "data" : {
  987. "type" : "file",
  988. "action" : "deleted",
  989. "folder": "Dokumente",
  990. "folderID" : "Dokumente",
  991. "path" : "/media/ntfs_data/Dokumente/testfile",
  992. "label" : "Dokumente",
  993. "modifiedBy" : "BPDFDTU"
  994. },
  995. "type" : "RemoteChangeDetected",
  996. "id" : 2
  997. }
  998. .ft P
  999. .fi
  1000. .UNINDENT
  1001. .UNINDENT
  1002. .sp
  1003. Deprecated since version v1.1.2: The \fBfolderID\fP field is a legacy name kept only for compatibility. Use the
  1004. \fBfolder\fP field with identical content instead.
  1005. .SS RemoteDownloadProgress
  1006. .sp
  1007. This event is emitted when a download\-progress message is
  1008. received. It returns a map \fBdata\fP of filenames with a count of
  1009. downloaded blocks. The files in questions are currently being
  1010. downloaded on the remote \fBdevice\fP and belong to \fBfolder\fP\&.
  1011. .INDENT 0.0
  1012. .INDENT 3.5
  1013. .sp
  1014. .nf
  1015. .ft C
  1016. {
  1017. "time" : "2017\-03\-07T00:11:37.65838955+01:00",
  1018. "globalID" : 170,
  1019. "data" : {
  1020. "state" : {
  1021. "tahr64\-6.0.5.iso" : 1784
  1022. },
  1023. "device" : "F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A",
  1024. "folder" : "Dokumente"
  1025. },
  1026. "type" : "RemoteDownloadProgress",
  1027. "id" : 163
  1028. }
  1029. .ft P
  1030. .fi
  1031. .UNINDENT
  1032. .UNINDENT
  1033. .SS RemoteIndexUpdated
  1034. .sp
  1035. Generated each time new index information is received from a device.
  1036. .INDENT 0.0
  1037. .INDENT 3.5
  1038. .sp
  1039. .nf
  1040. .ft C
  1041. {
  1042. "id": 44,
  1043. "globalID": 44,
  1044. "type": "RemoteIndexUpdated",
  1045. "time": "2014\-07\-13T21:04:35.394184435+02:00",
  1046. "data": {
  1047. "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG",
  1048. "folder": "lightroom",
  1049. "items": 1000
  1050. }
  1051. }
  1052. .ft P
  1053. .fi
  1054. .UNINDENT
  1055. .UNINDENT
  1056. .SS Starting
  1057. .sp
  1058. Emitted exactly once, when Syncthing starts, before parsing
  1059. configuration etc.
  1060. .INDENT 0.0
  1061. .INDENT 3.5
  1062. .sp
  1063. .nf
  1064. .ft C
  1065. {
  1066. "id": 1,
  1067. "globalID": 1,
  1068. "type": "Starting",
  1069. "time": "2014\-07\-17T13:13:32.044470055+02:00",
  1070. "data": {
  1071. "home": "/home/jb/.config/syncthing"
  1072. }
  1073. }
  1074. .ft P
  1075. .fi
  1076. .UNINDENT
  1077. .UNINDENT
  1078. .SS StartupComplete
  1079. .sp
  1080. Emitted exactly once, when initialization is complete and Syncthing is
  1081. ready to start exchanging data with other devices.
  1082. .INDENT 0.0
  1083. .INDENT 3.5
  1084. .sp
  1085. .nf
  1086. .ft C
  1087. {
  1088. "id": 1,
  1089. "globalID": 1,
  1090. "type": "StartupComplete",
  1091. "time": "2014\-07\-13T21:03:18.383239179+02:00",
  1092. "data": null
  1093. }
  1094. .ft P
  1095. .fi
  1096. .UNINDENT
  1097. .UNINDENT
  1098. .SS StateChanged
  1099. .sp
  1100. Emitted when a folder changes state. Possible states are \fBidle\fP,
  1101. \fBscanning\fP, \fBsyncing\fP and \fBerror\fP\&. The field \fBduration\fP is
  1102. the number of seconds the folder spent in state \fBfrom\fP\&. In the example
  1103. below, the folder \fBdefault\fP was in state \fBscanning\fP for 0.198
  1104. seconds and is now in state \fBidle\fP\&.
  1105. .INDENT 0.0
  1106. .INDENT 3.5
  1107. .sp
  1108. .nf
  1109. .ft C
  1110. {
  1111. "id": 8,
  1112. "globalID": 8,
  1113. "type": "StateChanged",
  1114. "time": "2014\-07\-17T13:14:28.697493016+02:00",
  1115. "data": {
  1116. "folder": "default",
  1117. "from": "scanning",
  1118. "duration": 0.19782869900000002,
  1119. "to": "idle"
  1120. }
  1121. }
  1122. .ft P
  1123. .fi
  1124. .UNINDENT
  1125. .UNINDENT
  1126. .SH AUTHOR
  1127. The Syncthing Authors
  1128. .SH COPYRIGHT
  1129. 2014-2019, The Syncthing Authors
  1130. .\" Generated by docutils manpage writer.
  1131. .