syncthing-rest-api.7 49 KB

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