syncthing-rest-api.7 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .TH "SYNCTHING-REST-API" "7" "Jul 14, 2020" "v1" "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. .sp
  34. Syncthing exposes a REST interface over HTTP on the GUI port. This is used by
  35. the GUI (from Javascript) and can be used by other processes wishing to control
  36. Syncthing. In most cases both the input and output data is in JSON format. The
  37. interface is subject to change.
  38. .SH API KEY
  39. .sp
  40. To use the REST API an API key must be set and used. The API key can be
  41. generated in the GUI, or set in the \fBconfiguration/gui/apikey\fP element in
  42. the configuration file. To use an API key, set the request header
  43. \fBX\-API\-Key\fP to the API key value. For example, \fBcurl \-X POST \-H
  44. "X\-API\-Key: abc123" http://localhost:8384/rest/...\fP can be used to invoke
  45. with \fBcurl\fP (add \fB\-k\fP flag when using HTTPS with a Syncthing generated or self signed certificate).
  46. .SH SYSTEM ENDPOINTS
  47. .SS GET /rest/system/browse
  48. .sp
  49. Returns a list of directories matching the path given by the optional parameter
  50. \fBcurrent\fP\&. The path can use \fI\%patterns as described in Go’s filepath package\fP <\fBhttps://golang.org/pkg/path/filepath/#Match\fP>\&. A ‘*’ will always be appended
  51. to the given path (e.g. \fB/tmp/\fP matches all its subdirectories). If the option
  52. \fBcurrent\fP is not given, filesystem root paths are returned.
  53. .INDENT 0.0
  54. .INDENT 3.5
  55. .sp
  56. .nf
  57. .ft C
  58. $ curl \-H "X\-API\-Key: yourkey" localhost:8384/rest/system/browse | json_pp
  59. [
  60. "/"
  61. ]
  62. $ curl \-H "X\-API\-Key: yourkey" localhost:8384/rest/system/browse?current=/var/ | json_pp
  63. [
  64. "/var/backups/",
  65. "/var/cache/",
  66. "/var/lib/",
  67. "/var/local/",
  68. "/var/lock/",
  69. "/var/log/",
  70. "/var/mail/",
  71. "/var/opt/",
  72. "/var/run/",
  73. "/var/spool/",
  74. "/var/tmp/"
  75. ]
  76. $ curl \-H "X\-API\-Key: yourkey" localhost:8384/rest/system/browse?current=/var/*o | json_pp
  77. [
  78. "/var/local/",
  79. "/var/lock/",
  80. "/var/log/",
  81. "/var/opt/",
  82. "/var/spool/"
  83. ]
  84. .ft P
  85. .fi
  86. .UNINDENT
  87. .UNINDENT
  88. .SS GET /rest/system/config
  89. .sp
  90. Returns the current configuration.
  91. .INDENT 0.0
  92. .INDENT 3.5
  93. .sp
  94. .nf
  95. .ft C
  96. {
  97. "version": 30,
  98. "folders": [
  99. {
  100. "id": "GXWxf\-3zgnU",
  101. "label": "MyFolder",
  102. "filesystemType": "basic",
  103. "path": "...",
  104. "type": "sendreceive",
  105. "devices": [
  106. {
  107. "deviceID": "...",
  108. "introducedBy": ""
  109. }
  110. ],
  111. "rescanIntervalS": 60,
  112. "fsWatcherEnabled": false,
  113. "fsWatcherDelayS": 10,
  114. "ignorePerms": false,
  115. "autoNormalize": true,
  116. "minDiskFree": {
  117. "value": 1,
  118. "unit": "%"
  119. },
  120. "versioning": {
  121. "type": "simple",
  122. "params": {
  123. "keep": "5"
  124. }
  125. },
  126. "copiers": 0,
  127. "pullerMaxPendingKiB": 0,
  128. "hashers": 0,
  129. "order": "random",
  130. "ignoreDelete": false,
  131. "scanProgressIntervalS": 0,
  132. "pullerPauseS": 0,
  133. "maxConflicts": 10,
  134. "disableSparseFiles": false,
  135. "disableTempIndexes": false,
  136. "paused": false,
  137. "weakHashThresholdPct": 25,
  138. "markerName": ".stfolder",
  139. "copyOwnershipFromParent": false,
  140. "modTimeWindowS": 0
  141. }
  142. ],
  143. "devices": [
  144. {
  145. "deviceID": "...",
  146. "name": "Laptop",
  147. "addresses": [
  148. "dynamic",
  149. "tcp://192.168.1.2:22000"
  150. ],
  151. "compression": "metadata",
  152. "certName": "",
  153. "introducer": false,
  154. "skipIntroductionRemovals": false,
  155. "introducedBy": "",
  156. "paused": false,
  157. "allowedNetworks": [],
  158. "autoAcceptFolders": false,
  159. "maxSendKbps": 0,
  160. "maxRecvKbps": 0,
  161. "ignoredFolders": [],
  162. "pendingFolders": [
  163. {
  164. "time": "2019\-06\-05T10:21:22+02:00",
  165. "id": "cpkn4\-57ysy",
  166. "label": "SomeonesFolder"
  167. }
  168. ],
  169. "maxRequestKiB": 0
  170. }
  171. ],
  172. "gui": {
  173. "enabled": true,
  174. "address": "127.0.0.1:8384",
  175. "user": "Username",
  176. "password": "$2a$10$ZFws69T4FlvWwsqeIwL.TOo5zOYqsa/.TxlUnsGYS.j3JvjFTmxo6",
  177. "authMode": "static",
  178. "useTLS": false,
  179. "apiKey": "pGahcht56664QU5eoFQW6szbEG6Ec2Cr",
  180. "insecureAdminAccess": false,
  181. "theme": "default",
  182. "debugging": false,
  183. "insecureSkipHostcheck": false,
  184. "insecureAllowFrameLoading": false
  185. },
  186. "ldap": {
  187. "addresd": "",
  188. "bindDN": "",
  189. "transport": "plain",
  190. "insecureSkipVerify": false
  191. },
  192. "options": {
  193. "listenAddresses": [
  194. "default"
  195. ],
  196. "globalAnnounceServers": [
  197. "default"
  198. ],
  199. "globalAnnounceEnabled": true,
  200. "localAnnounceEnabled": true,
  201. "localAnnouncePort": 21027,
  202. "localAnnounceMCAddr": "[ff12::8384]:21027",
  203. "maxSendKbps": 0,
  204. "maxRecvKbps": 0,
  205. "reconnectionIntervalS": 60,
  206. "relaysEnabled": true,
  207. "relayReconnectIntervalM": 10,
  208. "startBrowser": false,
  209. "natEnabled": true,
  210. "natLeaseMinutes": 60,
  211. "natRenewalMinutes": 30,
  212. "natTimeoutSeconds": 10,
  213. "urAccepted": \-1,
  214. "urSeen": 2,
  215. "urUniqueId": "",
  216. "urURL": "https://data.syncthing.net/newdata",
  217. "urPostInsecurely": false,
  218. "urInitialDelayS": 1800,
  219. "restartOnWakeup": true,
  220. "autoUpgradeIntervalH": 12,
  221. "upgradeToPreReleases": false,
  222. "keepTemporariesH": 24,
  223. "cacheIgnoredFiles": false,
  224. "progressUpdateIntervalS": 5,
  225. "limitBandwidthInLan": false,
  226. "minHomeDiskFree": {
  227. "value": 1,
  228. "unit": "%"
  229. },
  230. "releasesURL": "https://upgrades.syncthing.net/meta.json",
  231. "alwaysLocalNets": [],
  232. "overwriteRemoteDeviceNamesOnConnect": false,
  233. "tempIndexMinBlocks": 10,
  234. "unackedNotificationIDs": [],
  235. "trafficClass": 0,
  236. "defaultFolderPath": "~",
  237. "setLowPriority": true,
  238. "maxFolderConcurrency": 0,
  239. "crURL": "https://crash.syncthing.net/newcrash",
  240. "crashReportingEnabled": true,
  241. "stunKeepaliveStartS": 180,
  242. "stunKeepaliveMinS": 20,
  243. "stunServers": [
  244. "default"
  245. ],
  246. "databaseTuning": "auto",
  247. "maxConcurrentIncomingRequestKiB": 0
  248. },
  249. "remoteIgnoredDevices": [],
  250. "pendingDevices": []
  251. }
  252. .ft P
  253. .fi
  254. .UNINDENT
  255. .UNINDENT
  256. .SS GET /rest/system/config/insync
  257. .sp
  258. Returns whether the config is in sync, i.e. whether the running
  259. configuration is the same as that on disk.
  260. .INDENT 0.0
  261. .INDENT 3.5
  262. .sp
  263. .nf
  264. .ft C
  265. {
  266. "configInSync": true
  267. }
  268. .ft P
  269. .fi
  270. .UNINDENT
  271. .UNINDENT
  272. .SS POST /rest/system/config
  273. .sp
  274. Post the full contents of the configuration, in the same format as returned by
  275. the corresponding GET request. When posting the configuration succeeds,
  276. the posted configuration is immediately applied, except for changes that require a restart. Query
  277. rest\-config\-insync to check if a restart is required.
  278. .sp
  279. This endpoint is the main point to control Syncthing, even if the change only
  280. concerns a very small part of the config: The usual workflow is to get the
  281. config, modify the needed parts and post it again.
  282. .SS GET /rest/system/connections
  283. .sp
  284. \fBNOTE:\fP
  285. .INDENT 0.0
  286. .INDENT 3.5
  287. Return format changed in 0.13.0.
  288. .UNINDENT
  289. .UNINDENT
  290. .sp
  291. Returns the list of configured devices and some metadata associated
  292. with them. The list also contains the local device itself as not connected.
  293. .sp
  294. The connection types are \fBTCP (Client)\fP, \fBTCP (Server)\fP, \fBRelay (Client)\fP and \fBRelay (Server)\fP\&.
  295. .INDENT 0.0
  296. .INDENT 3.5
  297. .sp
  298. .nf
  299. .ft C
  300. {
  301. "total" : {
  302. "paused" : false,
  303. "clientVersion" : "",
  304. "at" : "2015\-11\-07T17:29:47.691637262+01:00",
  305. "connected" : false,
  306. "inBytesTotal" : 1479,
  307. "type" : "",
  308. "outBytesTotal" : 1318,
  309. "address" : ""
  310. },
  311. "connections" : {
  312. "YZJBJFX\-RDBL7WY\-6ZGKJ2D\-4MJB4E7\-ZATSDUY\-LD6Y3L3\-MLFUYWE\-AEMXJAC" : {
  313. "connected" : true,
  314. "inBytesTotal" : 556,
  315. "paused" : false,
  316. "at" : "2015\-11\-07T17:29:47.691548971+01:00",
  317. "clientVersion" : "v0.12.1",
  318. "address" : "127.0.0.1:22002",
  319. "type" : "TCP (Client)",
  320. "outBytesTotal" : 550
  321. },
  322. "DOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA" : {
  323. "outBytesTotal" : 0,
  324. "type" : "",
  325. "address" : "",
  326. "at" : "0001\-01\-01T00:00:00Z",
  327. "clientVersion" : "",
  328. "paused" : false,
  329. "inBytesTotal" : 0,
  330. "connected" : false
  331. },
  332. "UYGDMA4\-TPHOFO5\-2VQYDCC\-7CWX7XW\-INZINQT\-LE4B42N\-4JUZTSM\-IWCSXA4" : {
  333. "address" : "",
  334. "type" : "",
  335. "outBytesTotal" : 0,
  336. "connected" : false,
  337. "inBytesTotal" : 0,
  338. "paused" : false,
  339. "at" : "0001\-01\-01T00:00:00Z",
  340. "clientVersion" : ""
  341. }
  342. }
  343. }
  344. .ft P
  345. .fi
  346. .UNINDENT
  347. .UNINDENT
  348. .SS GET /rest/system/debug
  349. .sp
  350. New in version 0.12.0.
  351. .sp
  352. Returns the set of debug facilities and which of them are currently enabled.
  353. .INDENT 0.0
  354. .INDENT 3.5
  355. .sp
  356. .nf
  357. .ft C
  358. {
  359. "enabled": [
  360. "beacon"
  361. ],
  362. "facilities": {
  363. "beacon": "Multicast and broadcast discovery",
  364. "config": "Configuration loading and saving",
  365. "connections": "Connection handling",
  366. "db": "The database layer",
  367. "dialer": "Dialing connections",
  368. "discover": "Remote device discovery",
  369. "events": "Event generation and logging",
  370. "http": "REST API",
  371. "main": "Main package",
  372. "model": "The root hub",
  373. "protocol": "The BEP protocol",
  374. "relay": "Relay connection handling",
  375. "scanner": "File change detection and hashing",
  376. "stats": "Persistent device and folder statistics",
  377. "sync": "Mutexes",
  378. "upgrade": "Binary upgrades",
  379. "upnp": "UPnP discovery and port mapping",
  380. "versioner": "File versioning"
  381. }
  382. }
  383. .ft P
  384. .fi
  385. .UNINDENT
  386. .UNINDENT
  387. .SS POST /rest/system/debug
  388. .sp
  389. New in version 0.12.0.
  390. .sp
  391. Enables or disables debugging for specified facilities. Give one or both of
  392. \fBenable\fP and \fBdisable\fP query parameters, with comma separated facility
  393. names. To disable debugging of the beacon and discovery packages, and enable it
  394. for config and db:
  395. .INDENT 0.0
  396. .INDENT 3.5
  397. .sp
  398. .nf
  399. .ft C
  400. $ curl \-H X\-API\-Key:abc123 \-X POST \(aqhttp://localhost:8384/rest/system/debug?disable=beacon,discovery&enable=config,db\(aq
  401. .ft P
  402. .fi
  403. .UNINDENT
  404. .UNINDENT
  405. .SS GET /rest/system/discovery
  406. .sp
  407. Returns the contents of the local discovery cache.
  408. .INDENT 0.0
  409. .INDENT 3.5
  410. .sp
  411. .nf
  412. .ft C
  413. {
  414. "LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q": [
  415. "192.162.129.11:22000"
  416. ]
  417. }
  418. .ft P
  419. .fi
  420. .UNINDENT
  421. .UNINDENT
  422. .SS POST /rest/system/discovery
  423. .sp
  424. \fBNOTE:\fP
  425. .INDENT 0.0
  426. .INDENT 3.5
  427. Removed in v0.12.0.
  428. .UNINDENT
  429. .UNINDENT
  430. .sp
  431. Post with the query parameters \fBdevice\fP and \fBaddr\fP to add entries to
  432. the discovery cache.
  433. .INDENT 0.0
  434. .INDENT 3.5
  435. .sp
  436. .nf
  437. .ft C
  438. curl \-X POST http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e&addr=192.162.129.11:22000
  439. # Or with the X\-API\-Key header:
  440. 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
  441. .ft P
  442. .fi
  443. .UNINDENT
  444. .UNINDENT
  445. .SS POST /rest/system/error/clear
  446. .sp
  447. Post with empty to body to remove all recent errors.
  448. .SS GET /rest/system/error
  449. .sp
  450. \fBNOTE:\fP
  451. .INDENT 0.0
  452. .INDENT 3.5
  453. Return format changed in 0.12.0.
  454. .UNINDENT
  455. .UNINDENT
  456. .sp
  457. Returns the list of recent errors.
  458. .INDENT 0.0
  459. .INDENT 3.5
  460. .sp
  461. .nf
  462. .ft C
  463. {
  464. "errors": [
  465. {
  466. "when": "2014\-09\-18T12:59:26.549953186+02:00",
  467. "message": "This is an error string"
  468. }
  469. ]
  470. }
  471. .ft P
  472. .fi
  473. .UNINDENT
  474. .UNINDENT
  475. .SS POST /rest/system/error
  476. .sp
  477. Post with an error message in the body (plain text) to register a new
  478. error. The new error will be displayed on any active GUI clients.
  479. .SS GET /rest/system/log
  480. .sp
  481. New in version 0.12.0.
  482. .sp
  483. Returns the list of recent log entries.
  484. .INDENT 0.0
  485. .INDENT 3.5
  486. .sp
  487. .nf
  488. .ft C
  489. {
  490. "messages": [
  491. {
  492. "when": "2014\-09\-18T12:59:26.549953186+02:00",
  493. "message": "This is a log entry"
  494. }
  495. ]
  496. }
  497. .ft P
  498. .fi
  499. .UNINDENT
  500. .UNINDENT
  501. .SS POST /rest/system/pause
  502. .sp
  503. Pause the given device or all devices.
  504. .sp
  505. Takes the optional parameter \fBdevice\fP (device ID). When omitted,
  506. pauses all devices. Returns status 200 and no content upon success, or status
  507. 500 and a plain text error on failure.
  508. .SS GET /rest/system/ping
  509. .sp
  510. Returns a \fB{"ping": "pong"}\fP object.
  511. .INDENT 0.0
  512. .INDENT 3.5
  513. .sp
  514. .nf
  515. .ft C
  516. {
  517. "ping": "pong"
  518. }
  519. .ft P
  520. .fi
  521. .UNINDENT
  522. .UNINDENT
  523. .SS POST /rest/system/ping
  524. .sp
  525. Returns a \fB{"ping": "pong"}\fP object.
  526. .SS POST /rest/system/reset
  527. .sp
  528. Post with empty body to erase the current index database and restart
  529. Syncthing. With no query parameters, the entire database is erased from disk.
  530. By specifying the \fBfolder\fP parameter with a valid folder ID, only
  531. information for that folder will be erased:
  532. .INDENT 0.0
  533. .INDENT 3.5
  534. .sp
  535. .nf
  536. .ft C
  537. $ curl \-X POST \-H "X\-API\-Key: abc123" http://localhost:8384/rest/system/reset?folder=default
  538. .ft P
  539. .fi
  540. .UNINDENT
  541. .UNINDENT
  542. .sp
  543. \fBCaution\fP: See \fB\-reset\-database\fP for \fB\&.stfolder\fP creation side\-effect and caution regarding mountpoints.
  544. .SS POST /rest/system/restart
  545. .sp
  546. Post with empty body to immediately restart Syncthing.
  547. .SS POST /rest/system/resume
  548. .sp
  549. Resume the given device or all devices.
  550. .sp
  551. Takes the optional parameter \fBdevice\fP (device ID). When omitted,
  552. resumes all devices. Returns status 200 and no content upon success, or status
  553. 500 and a plain text error on failure.
  554. .SS POST /rest/system/shutdown
  555. .sp
  556. Post with empty body to cause Syncthing to exit and not restart.
  557. .SS GET /rest/system/status
  558. .sp
  559. Returns information about current system status and resource usage. The CPU percent value has been deprecated from the API and will always report 0.
  560. .INDENT 0.0
  561. .INDENT 3.5
  562. .sp
  563. .nf
  564. .ft C
  565. {
  566. "alloc": 30618136,
  567. "connectionServiceStatus": {
  568. "dynamic+https://relays.syncthing.net/endpoint": {
  569. "error": null,
  570. "lanAddresses": [
  571. "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"
  572. ],
  573. "wanAddresses": [
  574. "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"
  575. ]
  576. },
  577. "tcp://0.0.0.0:22000": {
  578. "error": null,
  579. "lanAddresses": [
  580. "tcp://0.0.0.0:22000"
  581. ],
  582. "wanAddresses": [
  583. "tcp://0.0.0.0:22000"
  584. ]
  585. }
  586. },
  587. "cpuPercent": 0,
  588. "discoveryEnabled": true,
  589. "discoveryErrors": {
  590. "global@https://discovery\-v4\-1.syncthing.net/v2/": "500 Internal Server Error",
  591. "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)",
  592. "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)",
  593. "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",
  594. "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",
  595. "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"
  596. },
  597. "discoveryMethods": 8,
  598. "goroutines": 49,
  599. "lastDialStatus": {
  600. "tcp://10.20.30.40": {
  601. "when": "2019\-05\-16T07:41:23Z",
  602. "error": "dial tcp 10.20.30.40:22000: i/o timeout"
  603. },
  604. "tcp://172.16.33.3:22000": {
  605. "when": "2019\-05\-16T07:40:43Z",
  606. "ok": true
  607. },
  608. "tcp://83.233.120.221:22000": {
  609. "when": "2019\-05\-16T07:41:13Z",
  610. "error": "dial tcp 83.233.120.221:22000: connect: connection refused"
  611. }
  612. },
  613. "myID": "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2",
  614. "pathSeparator": "/",
  615. "startTime": "2016\-06\-06T19:41:43.039284753+02:00",
  616. "sys": 42092792,
  617. "themes": [
  618. "default",
  619. "dark"
  620. ],
  621. "tilde": "/Users/jb",
  622. "uptime": 2635
  623. }
  624. .ft P
  625. .fi
  626. .UNINDENT
  627. .UNINDENT
  628. .sp
  629. New in version 1.2.0: The \fBlastDialStatus\fP dictionary contains the last error (or \fBnull\fP for
  630. success) for each peer address that Syncthing has attempted to contact.
  631. The \fBconnectionServiceStatus\fP entries gained \fB"error": null\fP
  632. attributes where previously there would be no \fBerror\fP attribute at all
  633. in the success case.
  634. .SS GET /rest/system/upgrade
  635. .sp
  636. Checks for a possible upgrade and returns an object describing the
  637. newest version and upgrade possibility.
  638. .INDENT 0.0
  639. .INDENT 3.5
  640. .sp
  641. .nf
  642. .ft C
  643. {
  644. "latest": "v0.14.47",
  645. "majorNewer": false,
  646. "newer": true,
  647. "running": "v0.14.46"
  648. }
  649. .ft P
  650. .fi
  651. .UNINDENT
  652. .UNINDENT
  653. .SS POST /rest/system/upgrade
  654. .sp
  655. Perform an upgrade to the newest released version and restart. Does
  656. nothing if there is no newer version than currently running.
  657. .SS GET /rest/system/version
  658. .sp
  659. Returns the current Syncthing version information.
  660. .INDENT 0.0
  661. .INDENT 3.5
  662. .sp
  663. .nf
  664. .ft C
  665. {
  666. "arch": "amd64",
  667. "longVersion": "syncthing v0.10.27+3\-gea8c3de (go1.4 darwin\-amd64 default) jb@syno 2015\-03\-16 11:01:29 UTC",
  668. "os": "darwin",
  669. "version": "v0.10.27+3\-gea8c3de"
  670. }
  671. .ft P
  672. .fi
  673. .UNINDENT
  674. .UNINDENT
  675. .SH DATABASE ENDPOINTS
  676. .SS GET /rest/db/browse
  677. .sp
  678. Returns the directory tree of the global model. Directories are always
  679. JSON objects (map/dictionary), and files are always arrays of
  680. modification time and size. The first integer is the files modification
  681. time, and the second integer is the file size.
  682. .sp
  683. The call takes one mandatory \fBfolder\fP parameter and two optional
  684. parameters. Optional parameter \fBlevels\fP defines how deep within the
  685. tree we want to dwell down (0 based, defaults to unlimited depth)
  686. Optional parameter \fBprefix\fP defines a prefix within the tree where to
  687. start building the structure.
  688. .INDENT 0.0
  689. .INDENT 3.5
  690. .sp
  691. .nf
  692. .ft C
  693. $ curl \-s http://localhost:8384/rest/db/browse?folder=default | json_pp
  694. {
  695. "directory": {
  696. "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
  697. "subdirectory": {
  698. "another file": ["2015\-04\-20T22:20:45+09:00", 130940928]
  699. }
  700. },
  701. "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
  702. }
  703. $ curl \-s http://localhost:8384/rest/db/browse?folder=default&levels=0 | json_pp
  704. {
  705. "directory": {},
  706. "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
  707. }
  708. $ curl \-s http://localhost:8384/rest/db/browse?folder=default&levels=1 | json_pp
  709. {
  710. "directory": {
  711. "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
  712. "subdirectory": {}
  713. },
  714. "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
  715. }
  716. $ curl \-s http://localhost:8384/rest/db/browse?folder=default&prefix=directory/subdirectory | json_pp
  717. {
  718. "another file": ["2015\-04\-20T22:20:45+09:00", 130940928]
  719. }
  720. $ curl \-s http://localhost:8384/rest/db/browse?folder=default&prefix=directory&levels=0 | json_pp
  721. {
  722. "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
  723. "subdirectory": {}
  724. }
  725. .ft P
  726. .fi
  727. .UNINDENT
  728. .UNINDENT
  729. .sp
  730. \fBNOTE:\fP
  731. .INDENT 0.0
  732. .INDENT 3.5
  733. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  734. .UNINDENT
  735. .UNINDENT
  736. .SS GET /rest/db/completion
  737. .sp
  738. Returns the completion percentage (0 to 100) and byte / item counts. Takes
  739. optional \fBdevice\fP and \fBfolder\fP parameters:
  740. .INDENT 0.0
  741. .IP \(bu 2
  742. \fBfolder\fP specifies the folder ID to calculate completion for. An empty
  743. or absent \fBfolder\fP parameter means all folders as an aggregate.
  744. .IP \(bu 2
  745. \fBdevice\fP specifies the device ID to calculate completion for. An empty
  746. or absent \fBdevice\fP parameter means the local device.
  747. .UNINDENT
  748. .sp
  749. If a device is specified but no folder, completion is calculated for all
  750. folders shared with that device.
  751. .SS Example Queries
  752. .sp
  753. Completion status for folder \fBabcd\-1234\fP on device \fBI6KAH76\-...\-3PSROAU\fP:
  754. .INDENT 0.0
  755. .INDENT 3.5
  756. .sp
  757. .nf
  758. .ft C
  759. /rest/db/completion?folder=abcd\-1234&device=I6KAH76\-...\-3PSROAU
  760. .ft P
  761. .fi
  762. .UNINDENT
  763. .UNINDENT
  764. .sp
  765. Aggregated completion status for device \fBI6KAH76\-...\-3PSROAU\fP (all folders shared with them):
  766. .INDENT 0.0
  767. .INDENT 3.5
  768. .sp
  769. .nf
  770. .ft C
  771. /rest/db/completion?device=I6KAH76\-...\-3PSROAU
  772. .ft P
  773. .fi
  774. .UNINDENT
  775. .UNINDENT
  776. .sp
  777. Completion status for folder \fBabcd\-1234\fP on the local device:
  778. .INDENT 0.0
  779. .INDENT 3.5
  780. .sp
  781. .nf
  782. .ft C
  783. /rest/db/completion?folder=abcd\-1234
  784. .ft P
  785. .fi
  786. .UNINDENT
  787. .UNINDENT
  788. .sp
  789. Aggregated completion status for all folders on the local device:
  790. .INDENT 0.0
  791. .INDENT 3.5
  792. .sp
  793. .nf
  794. .ft C
  795. /rest/db/completion
  796. .ft P
  797. .fi
  798. .UNINDENT
  799. .UNINDENT
  800. .SS Example Response
  801. .INDENT 0.0
  802. .INDENT 3.5
  803. .sp
  804. .nf
  805. .ft C
  806. {
  807. "completion": 99.9937565835,
  808. "globalBytes": 156793013575,
  809. "needBytes": 9789241,
  810. "globalItems": 7823,
  811. "needItems": 412,
  812. "needDeletes": 0
  813. }
  814. .ft P
  815. .fi
  816. .UNINDENT
  817. .UNINDENT
  818. .sp
  819. New in version 1.8.0: The ability to aggregate multiple folders by leaving out the folder ID.
  820. Querying data for the local device by leaving out the device ID. Returning
  821. the \fBglobalItems\fP counter in the response.
  822. .SS GET /rest/db/file
  823. .sp
  824. Returns most data available about a given file, including version and
  825. availability. Takes \fBfolder\fP and \fBfile\fP parameters.
  826. .INDENT 0.0
  827. .INDENT 3.5
  828. .sp
  829. .nf
  830. .ft C
  831. {
  832. "availability": [
  833. {
  834. "id": "ITZRNXE\-YNROGBZ\-HXTH5P7\-VK5NYE5\-QHRQGE2\-7JQ6VNJ\-KZUEDIU\-5PPR5AM",
  835. "fromTemporary": false
  836. }
  837. ],
  838. "global": {
  839. "deleted": false,
  840. "ignored": false,
  841. "invalid": false,
  842. "localFlags": 0,
  843. "modified": "2018\-08\-18T12:21:13.836784059+02:00",
  844. "modifiedBy": "SYNO4VL",
  845. "mustRescan": false,
  846. "name": "testfile",
  847. "noPermissions": false,
  848. "numBlocks": 1,
  849. "permissions": "0755",
  850. "sequence": 107499,
  851. "size": 1234,
  852. "type": 0,
  853. "version": [
  854. "SYNO4VL:1"
  855. ]
  856. },
  857. "local": {
  858. "deleted": false,
  859. "ignored": false,
  860. "invalid": false,
  861. "localFlags": 0,
  862. "modified": "2018\-08\-18T12:21:13.836784059+02:00",
  863. "modifiedBy": "SYNO4VL",
  864. "mustRescan": false,
  865. "name": "testfile",
  866. "noPermissions": false,
  867. "numBlocks": 1,
  868. "permissions": "0755",
  869. "sequence": 111038,
  870. "size": 1234,
  871. "type": 0,
  872. "version": [
  873. "SYNO4VL:1"
  874. ]
  875. }
  876. }
  877. .ft P
  878. .fi
  879. .UNINDENT
  880. .UNINDENT
  881. .SS GET /rest/db/ignores
  882. .sp
  883. Takes one parameter, \fBfolder\fP, and returns the content of the
  884. \fB\&.stignore\fP as the \fBignore\fP field. A second field, \fBexpanded\fP,
  885. 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.
  886. .INDENT 0.0
  887. .INDENT 3.5
  888. .sp
  889. .nf
  890. .ft C
  891. {
  892. "ignore": [
  893. "(?i)/Backups"
  894. ],
  895. "expanded": [
  896. "(?i)Backups",
  897. "(?i)Backups/**"
  898. ]
  899. }
  900. .ft P
  901. .fi
  902. .UNINDENT
  903. .UNINDENT
  904. .SS POST /rest/db/ignores
  905. .sp
  906. Expects a format similar to the output of \fBGET\fP call, but only
  907. containing the \fBignore\fP field (\fBexpanded\fP field should be omitted).
  908. It takes one parameter, \fBfolder\fP, and either updates the content of
  909. the \fB\&.stignore\fP echoing it back as a response, or returns an error.
  910. .SS GET /rest/db/need
  911. .sp
  912. Takes one mandatory parameter, \fBfolder\fP, and returns lists of files which are
  913. needed by this device in order for it to become in sync.
  914. .sp
  915. Furthermore takes an optional \fBpage\fP and \fBperpage\fP arguments for pagination.
  916. Pagination happens, across the union of all needed files, that is \- across all
  917. 3 sections of the response.
  918. For example, given the current need state is as follows:
  919. .INDENT 0.0
  920. .IP 1. 3
  921. \fBprogress\fP has 15 items
  922. .IP 2. 3
  923. \fBqueued\fP has 3 items
  924. .IP 3. 3
  925. \fBrest\fP has 12 items
  926. .UNINDENT
  927. .sp
  928. If you issue a query with \fBpage=1\fP and \fBperpage=10\fP, only the \fBprogress\fP
  929. section in the response will have 10 items. If you issue a request query with
  930. \fBpage=2\fP and \fBperpage=10\fP, \fBprogress\fP section will have the last 5 items,
  931. \fBqueued\fP section will have all 3 items, and \fBrest\fP section will have first
  932. 2 items. If you issue a query for \fBpage=3\fP and \fBperpage=10\fP, you will only
  933. have the last 10 items of the \fBrest\fP section.
  934. .sp
  935. In all these calls, \fBtotal\fP will be 30 to indicate the total number of
  936. available items.
  937. .INDENT 0.0
  938. .INDENT 3.5
  939. .sp
  940. .nf
  941. .ft C
  942. {
  943. # Files currently being downloaded
  944. "progress": [
  945. {
  946. "flags": "0755",
  947. "sequence": 6,
  948. "modified": "2015\-04\-20T23:06:12+09:00",
  949. "name": "ls",
  950. "size": 34640,
  951. "version": [
  952. "5157751870738175669:1"
  953. ]
  954. }
  955. ],
  956. # Files queued to be downloaded next (as per array order)
  957. "queued": [
  958. ...
  959. ],
  960. # Files to be downloaded after all queued files will be downloaded.
  961. # This happens when we start downloading files, and new files get added while we are downloading.
  962. "rest": [
  963. ...
  964. ],
  965. "page": 1,
  966. "perpage": 100,
  967. "total": 2000
  968. }
  969. .ft P
  970. .fi
  971. .UNINDENT
  972. .UNINDENT
  973. .sp
  974. \fBNOTE:\fP
  975. .INDENT 0.0
  976. .INDENT 3.5
  977. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  978. .UNINDENT
  979. .UNINDENT
  980. .SS POST /rest/db/override
  981. .sp
  982. Request override of a send only folder. Override means to make the local
  983. version latest, overriding changes made on other devices. This API call does
  984. nothing if the folder is not a send only folder.
  985. .sp
  986. Takes the mandatory parameter \fIfolder\fP (folder ID).
  987. .INDENT 0.0
  988. .INDENT 3.5
  989. .sp
  990. .nf
  991. .ft C
  992. curl \-X POST \-H X\-API\-key:... http://127.0.0.1:8384/rest/db/override?folder=default
  993. .ft P
  994. .fi
  995. .UNINDENT
  996. .UNINDENT
  997. .SS POST /rest/db/prio
  998. .sp
  999. Moves the file to the top of the download queue.
  1000. .INDENT 0.0
  1001. .INDENT 3.5
  1002. .sp
  1003. .nf
  1004. .ft C
  1005. curl \-X POST http://127.0.0.1:8384/rest/db/prio?folder=default&file=foo/bar
  1006. .ft P
  1007. .fi
  1008. .UNINDENT
  1009. .UNINDENT
  1010. .sp
  1011. Response contains the same output as \fBGET /rest/db/need\fP
  1012. .SS POST /rest/db/revert
  1013. .sp
  1014. New in version 0.14.50.
  1015. .sp
  1016. Request revert of a receive only folder. Reverting a folder means to undo
  1017. all local changes. This API call does nothing if the folder is not a receive
  1018. only folder.
  1019. .sp
  1020. Takes the mandatory parameter \fIfolder\fP (folder ID).
  1021. .INDENT 0.0
  1022. .INDENT 3.5
  1023. .sp
  1024. .nf
  1025. .ft C
  1026. curl \-X POST \-H X\-API\-Key:... http://127.0.0.1:8384/rest/db/revert?folder=default
  1027. .ft P
  1028. .fi
  1029. .UNINDENT
  1030. .UNINDENT
  1031. .SS POST /rest/db/scan
  1032. .sp
  1033. Request immediate scan. Takes the optional parameters \fBfolder\fP (folder ID),
  1034. \fBsub\fP (path relative to the folder root) and \fBnext\fP (time in seconds). If
  1035. \fBfolder\fP is omitted or empty all folders are scanned. If \fBsub\fP is given,
  1036. only this path (and children, in case it’s a directory) is scanned. The \fBnext\fP
  1037. argument delays Syncthing’s automated rescan interval for a given amount of
  1038. seconds.
  1039. .sp
  1040. Requesting scan of a path that no longer exists, but previously did, is
  1041. valid and will result in Syncthing noticing the deletion of the path in
  1042. question.
  1043. .sp
  1044. Returns status 200 and no content upon success, or status 500 and a
  1045. plain text error if an error occurred during scanning.
  1046. .INDENT 0.0
  1047. .INDENT 3.5
  1048. .sp
  1049. .nf
  1050. .ft C
  1051. curl \-X POST http://127.0.0.1:8384/rest/db/scan?folder=default&sub=foo/bar
  1052. .ft P
  1053. .fi
  1054. .UNINDENT
  1055. .UNINDENT
  1056. .SS GET /rest/db/status
  1057. .sp
  1058. Returns information about the current status of a folder.
  1059. .sp
  1060. Parameters: \fBfolder\fP, the ID of a folder.
  1061. .INDENT 0.0
  1062. .INDENT 3.5
  1063. .sp
  1064. .nf
  1065. .ft C
  1066. {
  1067. "globalBytes": 0,
  1068. "globalDeleted": 0,
  1069. "globalDirectories": 0,
  1070. "globalFiles": 0,
  1071. "globalSymlinks": 0,
  1072. "globalTotalItems": 0,
  1073. "ignorePatterns": false,
  1074. "inSyncBytes": 0,
  1075. "inSyncFiles": 0,
  1076. "invalid": "",
  1077. "localBytes": 0,
  1078. "localDeleted": 0,
  1079. "localDirectories": 0,
  1080. "localFiles": 0,
  1081. "localSymlinks": 0,
  1082. "localTotalItems": 0,
  1083. "needBytes": 0,
  1084. "needDeletes": 0,
  1085. "needDirectories": 0,
  1086. "needFiles": 0,
  1087. "needSymlinks": 0,
  1088. "needTotalItems": 0,
  1089. "pullErrors": 0,
  1090. "receiveOnlyChangedBytes": 0,
  1091. "receiveOnlyChangedDeletes": 0,
  1092. "receiveOnlyChangedDirectories": 0,
  1093. "receiveOnlyChangedFiles": 0,
  1094. "receiveOnlyChangedSymlinks": 0,
  1095. "receiveOnlyTotalItems": 0,
  1096. "sequence": 0,
  1097. "state": "idle",
  1098. "stateChanged": "2018\-08\-08T07:04:57.301064781+02:00",
  1099. "version": 0
  1100. }
  1101. .ft P
  1102. .fi
  1103. .UNINDENT
  1104. .UNINDENT
  1105. .sp
  1106. The various fields have the following meaning:
  1107. .INDENT 0.0
  1108. .TP
  1109. .B global*:
  1110. Data in the cluster latest version.
  1111. .TP
  1112. .B inSync*:
  1113. Data that is locally the same as the cluster latest version.
  1114. .TP
  1115. .B local*:
  1116. Data that is locally present, regardless of whether it’s the same or different version as the cluster latest version.
  1117. .TP
  1118. .B need*:
  1119. Data that is needed to become up to date with the cluster latest version (i.e., data that is out of sync).
  1120. .TP
  1121. .B receiveOnlyChanged*:
  1122. Data that has changed locally in a receive only folder, and thus not been sent to the cluster.
  1123. .TP
  1124. .B invalid:
  1125. Deprecated, always empty.
  1126. .TP
  1127. .B pullErrors:
  1128. The number of files that failed to sync during the last sync operations.
  1129. .TP
  1130. .B sequence:
  1131. The current folder sequence number.
  1132. .TP
  1133. .B state:
  1134. The current folder state.
  1135. .TP
  1136. .B stateChanged:
  1137. When the folder state last changed.
  1138. .TP
  1139. .B version:
  1140. Deprecated, equivalent to the sequence number.
  1141. .UNINDENT
  1142. .sp
  1143. \fBNOTE:\fP
  1144. .INDENT 0.0
  1145. .INDENT 3.5
  1146. This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
  1147. .UNINDENT
  1148. .UNINDENT
  1149. .SH EVENT ENDPOINTS
  1150. .SS GET /rest/events
  1151. .sp
  1152. To receive events, perform a HTTP GET of \fB/rest/events\fP\&.
  1153. .sp
  1154. To filter the event list, in effect creating a specific subscription for
  1155. only the desired event types, add a parameter
  1156. \fBevents=EventTypeA,EventTypeB,...\fP where the event types are any of the event\-types\&.
  1157. .sp
  1158. The optional parameter \fBsince=<lastSeenID>\fP sets the ID of the last event
  1159. you’ve already seen. Syncthing returns a JSON encoded array of event objects,
  1160. starting at the event just after the one with this last seen ID. The default
  1161. value is 0, which returns all events. There is a limit to the number of events
  1162. buffered, so if the rate of events is high or the time between polling calls is
  1163. long some events might be missed. This can be detected by noting a discontinuity
  1164. in the event IDs.
  1165. .sp
  1166. If no new events are produced since \fB<lastSeenID>\fP, the HTTP call blocks and
  1167. waits for new events to happen before returning. By default it times out after
  1168. 60 seconds returning an empty array. The time out duration can be customized
  1169. with the optional parameter \fBtimeout=<seconds>\fP\&.
  1170. .sp
  1171. To receive only a limited number of events, add the \fBlimit=<n>\fP parameter with a
  1172. suitable value for \fBn\fP and only the \fIlast\fP \fBn\fP events will be returned. This
  1173. can be used to catch up with the latest event ID after a disconnection for
  1174. example: \fB/rest/events?since=0&limit=1\fP\&.
  1175. .SH STATISTICS ENDPOINTS
  1176. .SS GET /rest/stats/device
  1177. .sp
  1178. Returns general statistics about devices. Currently, only contains the
  1179. time the device was last seen.
  1180. .INDENT 0.0
  1181. .INDENT 3.5
  1182. .sp
  1183. .nf
  1184. .ft C
  1185. $ curl \-s http://localhost:8384/rest/stats/device | json
  1186. {
  1187. "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2": {
  1188. "lastSeen" : "2015\-04\-18T11:21:31.3256277+01:00"
  1189. }
  1190. }
  1191. .ft P
  1192. .fi
  1193. .UNINDENT
  1194. .UNINDENT
  1195. .SS GET /rest/stats/folder
  1196. .sp
  1197. Returns general statistics about folders. Currently contains the
  1198. last scan time and the last synced file.
  1199. .INDENT 0.0
  1200. .INDENT 3.5
  1201. .sp
  1202. .nf
  1203. .ft C
  1204. $ curl \-s http://localhost:8384/rest/stats/folder | json
  1205. {
  1206. "folderid" : {
  1207. "lastScan": "2016\-06\-02T13:28:01.288181412\-04:00",
  1208. "lastFile" : {
  1209. "filename" : "file/name",
  1210. "at" : "2015\-04\-16T22:04:18.3066971+01:00"
  1211. }
  1212. }
  1213. }
  1214. .ft P
  1215. .fi
  1216. .UNINDENT
  1217. .UNINDENT
  1218. .SH MISC SERVICES ENDPOINTS
  1219. .SS GET /rest/svc/deviceid
  1220. .sp
  1221. Verifies and formats a device ID. Accepts all currently valid formats
  1222. (52 or 56 characters with or without separators, upper or lower case,
  1223. with trivial substitutions). Takes one parameter, \fBid\fP, and returns
  1224. either a valid device ID in modern format, or an error.
  1225. .INDENT 0.0
  1226. .INDENT 3.5
  1227. .sp
  1228. .nf
  1229. .ft C
  1230. $ curl \-s http://localhost:8384/rest/svc/deviceid?id=1234 | json
  1231. {
  1232. "error": "device ID invalid: incorrect length"
  1233. }
  1234. $ curl \-s http://localhost:8384/rest/svc/deviceid?id=p56ioi7m\-\-zjnu2iq\-gdr\-eydm\-2mgtmgl3bxnpq6w5btbbz4tjxzwicq | json
  1235. {
  1236. "id": "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2"
  1237. }
  1238. .ft P
  1239. .fi
  1240. .UNINDENT
  1241. .UNINDENT
  1242. .SS GET /rest/svc/lang
  1243. .sp
  1244. Returns a list of canonicalized localization codes, as picked up from
  1245. the \fBAccept\-Language\fP header sent by the browser.
  1246. .INDENT 0.0
  1247. .INDENT 3.5
  1248. .sp
  1249. .nf
  1250. .ft C
  1251. ["sv_sv","sv","en_us","en"]
  1252. .ft P
  1253. .fi
  1254. .UNINDENT
  1255. .UNINDENT
  1256. .SS GET /rest/svc/random/string
  1257. .sp
  1258. Returns a strong random generated string (alphanumeric) of the specified length. Takes the \fBlength\fP parameter.
  1259. .INDENT 0.0
  1260. .INDENT 3.5
  1261. .sp
  1262. .nf
  1263. .ft C
  1264. {
  1265. "random": "FdPaEaZQ56sXEKYNxpgF"
  1266. }
  1267. .ft P
  1268. .fi
  1269. .UNINDENT
  1270. .UNINDENT
  1271. .SS GET /rest/svc/report
  1272. .sp
  1273. Returns the data sent in the anonymous usage report.
  1274. .INDENT 0.0
  1275. .INDENT 3.5
  1276. .sp
  1277. .nf
  1278. .ft C
  1279. {
  1280. "folderMaxMiB" : 0,
  1281. "platform" : "linux\-amd64",
  1282. "totMiB" : 0,
  1283. "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",
  1284. "upgradeAllowedManual" : true,
  1285. "totFiles" : 3,
  1286. "folderUses" : {
  1287. "ignorePerms" : 0,
  1288. "autoNormalize" : 0,
  1289. "sendonly" : 0,
  1290. "ignoreDelete" : 0
  1291. },
  1292. "memoryUsageMiB" : 13,
  1293. "version" : "v0.12.2",
  1294. "sha256Perf" : 27.28,
  1295. "numFolders" : 2,
  1296. "memorySize" : 1992,
  1297. "announce" : {
  1298. "defaultServersIP" : 0,
  1299. "otherServers" : 0,
  1300. "globalEnabled" : false,
  1301. "defaultServersDNS" : 1,
  1302. "localEnabled" : false
  1303. },
  1304. "usesRateLimit" : false,
  1305. "numCPU" : 2,
  1306. "uniqueID" : "",
  1307. "urVersion" : 2,
  1308. "rescanIntvs" : [
  1309. 60,
  1310. 60
  1311. ],
  1312. "numDevices" : 2,
  1313. "folderMaxFiles" : 3,
  1314. "relays" : {
  1315. "defaultServers" : 1,
  1316. "enabled" : true,
  1317. "otherServers" : 0
  1318. },
  1319. "deviceUses" : {
  1320. "compressMetadata" : 1,
  1321. "customCertName" : 0,
  1322. "staticAddr" : 1,
  1323. "compressAlways" : 0,
  1324. "compressNever" : 1,
  1325. "introducer" : 0,
  1326. "dynamicAddr" : 1
  1327. },
  1328. "upgradeAllowedAuto" : false
  1329. }
  1330. .ft P
  1331. .fi
  1332. .UNINDENT
  1333. .UNINDENT
  1334. .SH AUTHOR
  1335. The Syncthing Authors
  1336. .SH COPYRIGHT
  1337. 2014-2019, The Syncthing Authors
  1338. .\" Generated by docutils manpage writer.
  1339. .