aboutsummaryrefslogtreecommitdiff
path: root/man/syncthing-rest-api.7
blob: a73f71587032bd70bb3546128c4489d9707fe50f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "SYNCTHING-REST-API" "7" "Mar 17, 2024" "v1.27.4" "Syncthing"
.SH NAME
syncthing-rest-api \- REST API
.sp
Syncthing exposes a REST interface over HTTP on the GUI port. This is used by
the GUI (from Javascript) and can be used by other processes wishing to control
Syncthing. In most cases both the input and output data is in JSON format. The
interface is subject to change.
.SH API KEY
.sp
To use the REST API an API key must be set and used. The API key can be
generated in the GUI, or set in the \fBconfiguration/gui/apikey\fP element in
the configuration file. To use an API key, set the request header
\fBX\-API\-Key\fP to the API key value, or set it as a \fBBearer\fP token in the
\fBAuthorization\fP header. For example, \fBcurl \-X POST \-H \(dqX\-API\-Key: abc123\(dq
http://localhost:8384/rest/...\fP or \fBcurl \-X POST \-H \(dqAuthorization: Bearer
abc123\(dq http://localhost:8384/rest/...\fP can be used to invoke with \fBcurl\fP
(add \fB\-k\fP flag when using HTTPS with a Syncthing generated or self signed
certificate).
.sp
One exception to this requirement is \fB/rest/noauth\fP, you do not need an API
key to use those endpoints. This way third\-party devices and services can do
simple calls that don’t expose sensitive information without having to expose
your API key.
.SH RESULT PAGINATION
.sp
Some \fIGET\fP endpoints take optional \fBpage\fP and \fBperpage\fP arguments for
pagination.  No more than \fBperpage\fP (defaults to 65536 if not given) result
entries are returned in an array.  To access further entries, passing the
\fBpage\fP parameter will advance in the results by that many pages.  The actually
used parameters are always returned as attributes in the response object.
.SH SYSTEM ENDPOINTS
.SS GET /rest/system/browse
.sp
Returns a list of directories matching the path given by the optional parameter
\fBcurrent\fP\&. The path can use \fI\%patterns as described in Go’s filepath package\fP <\fBhttps://pkg.go.dev/path/filepath#Match\fP>\&. A ‘*’ will always be appended
to the given path (e.g. \fB/tmp/\fP matches all its subdirectories). If the option
\fBcurrent\fP is not given, filesystem root paths are returned.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ curl \-H \(dqX\-API\-Key: yourkey\(dq localhost:8384/rest/system/browse | json_pp
[
    \(dq/\(dq
]

$ curl \-H \(dqX\-API\-Key: yourkey\(dq localhost:8384/rest/system/browse?current=/var/ | json_pp
[
    \(dq/var/backups/\(dq,
    \(dq/var/cache/\(dq,
    \(dq/var/lib/\(dq,
    \(dq/var/local/\(dq,
    \(dq/var/lock/\(dq,
    \(dq/var/log/\(dq,
    \(dq/var/mail/\(dq,
    \(dq/var/opt/\(dq,
    \(dq/var/run/\(dq,
    \(dq/var/spool/\(dq,
    \(dq/var/tmp/\(dq
]

$ curl \-H \(dqX\-API\-Key: yourkey\(dq localhost:8384/rest/system/browse?current=/var/*o | json_pp
[
    \(dq/var/local/\(dq,
    \(dq/var/lock/\(dq,
    \(dq/var/log/\(dq,
    \(dq/var/opt/\(dq,
    \(dq/var/spool/\(dq
]
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/system/config (DEPRECATED)
.sp
Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use \fI\%/rest/config\fP
instead.

.sp
Returns the current configuration.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqversion\(dq: 35,
  \(dqfolders\(dq: [
    {
      \(dqid\(dq: \(dqdefault\(dq,
      \(dqlabel\(dq: \(dqDefault Folder\(dq,
      \(dqfilesystemType\(dq: \(dqbasic\(dq,
      \(dqpath\(dq: \(dq...\(dq,
      \(dqtype\(dq: \(dqsendreceive\(dq,
      \(dqdevices\(dq: [
        {
          \(dqdeviceID\(dq: \(dq...\(dq,
          \(dqintroducedBy\(dq: \(dq\(dq,
          \(dqencryptionPassword\(dq: \(dq\(dq
        }
      ],
      \(dqrescanIntervalS\(dq: 3600,
      \(dqfsWatcherEnabled\(dq: true,
      \(dqfsWatcherDelayS\(dq: 10,
      \(dqignorePerms\(dq: false,
      \(dqautoNormalize\(dq: true,
      \(dqminDiskFree\(dq: {
        \(dqvalue\(dq: 1,
        \(dqunit\(dq: \(dq%\(dq
      },
      \(dqversioning\(dq: {
        \(dqtype\(dq: \(dq\(dq,
        \(dqparams\(dq: {},
        \(dqcleanupIntervalS\(dq: 3600,
        \(dqfsPath\(dq: \(dq\(dq,
        \(dqfsType\(dq: \(dqbasic\(dq
      },
      \(dqcopiers\(dq: 0,
      \(dqpullerMaxPendingKiB\(dq: 0,
      \(dqhashers\(dq: 0,
      \(dqorder\(dq: \(dqrandom\(dq,
      \(dqignoreDelete\(dq: false,
      \(dqscanProgressIntervalS\(dq: 0,
      \(dqpullerPauseS\(dq: 0,
      \(dqmaxConflicts\(dq: \-1,
      \(dqdisableSparseFiles\(dq: false,
      \(dqdisableTempIndexes\(dq: false,
      \(dqpaused\(dq: false,
      \(dqweakHashThresholdPct\(dq: 25,
      \(dqmarkerName\(dq: \(dq.stfolder\(dq,
      \(dqcopyOwnershipFromParent\(dq: false,
      \(dqmodTimeWindowS\(dq: 0,
      \(dqmaxConcurrentWrites\(dq: 2,
      \(dqdisableFsync\(dq: false,
      \(dqblockPullOrder\(dq: \(dqstandard\(dq,
      \(dqcopyRangeMethod\(dq: \(dqstandard\(dq,
      \(dqcaseSensitiveFS\(dq: false,
      \(dqjunctionsAsDirs\(dq: true
    }
  ],
  \(dqdevices\(dq: [
    {
      \(dqdeviceID\(dq: \(dq...\(dq,
      \(dqname\(dq: \(dqLaptop\(dq,
      \(dqaddresses\(dq: [
        \(dqdynamic\(dq,
        \(dqtcp://192.168.1.2:22000\(dq
      ],
      \(dqcompression\(dq: \(dqmetadata\(dq,
      \(dqcertName\(dq: \(dq\(dq,
      \(dqintroducer\(dq: false,
      \(dqskipIntroductionRemovals\(dq: false,
      \(dqintroducedBy\(dq: \(dq\(dq,
      \(dqpaused\(dq: false,
      \(dqallowedNetworks\(dq: [],
      \(dqautoAcceptFolders\(dq: false,
      \(dqmaxSendKbps\(dq: 0,
      \(dqmaxRecvKbps\(dq: 0,
      \(dqignoredFolders\(dq: [
        {
          \(dqtime\(dq: \(dq2022\-01\-09T19:09:52Z\(dq,
          \(dqid\(dq: \(dqbr63e\-wyhb7\(dq,
          \(dqlabel\(dq: \(dqFoo\(dq
        }
      ],
      \(dqmaxRequestKiB\(dq: 0,
      \(dquntrusted\(dq: false,
      \(dqremoteGUIPort\(dq: 0
    }
  ],
  \(dqgui\(dq: {
    \(dqenabled\(dq: true,
    \(dqaddress\(dq: \(dq127.0.0.1:8384\(dq,
    \(dqunixSocketPermissions\(dq: \(dq\(dq,
    \(dquser\(dq: \(dqUsername\(dq,
    \(dqpassword\(dq: \(dq$2a$10$ZFws69T4FlvWwsqeIwL.TOo5zOYqsa/.TxlUnsGYS.j3JvjFTmxo6\(dq,
    \(dqauthMode\(dq: \(dqstatic\(dq,
    \(dquseTLS\(dq: false,
    \(dqapiKey\(dq: \(dqk1dnz1Dd0rzTBjjFFh7CXPnrF12C49B1\(dq,
    \(dqinsecureAdminAccess\(dq: false,
    \(dqtheme\(dq: \(dqdefault\(dq,
    \(dqdebugging\(dq: false,
    \(dqinsecureSkipHostcheck\(dq: false,
    \(dqinsecureAllowFrameLoading\(dq: false
  },
  \(dqldap\(dq: {
    \(dqaddress\(dq: \(dq\(dq,
    \(dqbindDN\(dq: \(dq\(dq,
    \(dqtransport\(dq: \(dqplain\(dq,
    \(dqinsecureSkipVerify\(dq: false,
    \(dqsearchBaseDN\(dq: \(dq\(dq,
    \(dqsearchFilter\(dq: \(dq\(dq
  },
  \(dqoptions\(dq: {
    \(dqlistenAddresses\(dq: [
      \(dqdefault\(dq
    ],
    \(dqglobalAnnounceServers\(dq: [
      \(dqdefault\(dq
    ],
    \(dqglobalAnnounceEnabled\(dq: true,
    \(dqlocalAnnounceEnabled\(dq: true,
    \(dqlocalAnnouncePort\(dq: 21027,
    \(dqlocalAnnounceMCAddr\(dq: \(dq[ff12::8384]:21027\(dq,
    \(dqmaxSendKbps\(dq: 0,
    \(dqmaxRecvKbps\(dq: 0,
    \(dqreconnectionIntervalS\(dq: 60,
    \(dqrelaysEnabled\(dq: true,
    \(dqrelayReconnectIntervalM\(dq: 10,
    \(dqstartBrowser\(dq: true,
    \(dqnatEnabled\(dq: true,
    \(dqnatLeaseMinutes\(dq: 60,
    \(dqnatRenewalMinutes\(dq: 30,
    \(dqnatTimeoutSeconds\(dq: 10,
    \(dqurAccepted\(dq: 0,
    \(dqurSeen\(dq: 0,
    \(dqurUniqueId\(dq: \(dq...\(dq,
    \(dqurURL\(dq: \(dqhttps://data.syncthing.net/newdata\(dq,
    \(dqurPostInsecurely\(dq: false,
    \(dqurInitialDelayS\(dq: 1800,
    \(dqautoUpgradeIntervalH\(dq: 12,
    \(dqupgradeToPreReleases\(dq: false,
    \(dqkeepTemporariesH\(dq: 24,
    \(dqcacheIgnoredFiles\(dq: false,
    \(dqprogressUpdateIntervalS\(dq: 5,
    \(dqlimitBandwidthInLan\(dq: false,
    \(dqminHomeDiskFree\(dq: {
      \(dqvalue\(dq: 1,
      \(dqunit\(dq: \(dq%\(dq
    },
    \(dqreleasesURL\(dq: \(dqhttps://upgrades.syncthing.net/meta.json\(dq,
    \(dqalwaysLocalNets\(dq: [],
    \(dqoverwriteRemoteDeviceNamesOnConnect\(dq: false,
    \(dqtempIndexMinBlocks\(dq: 10,
    \(dqunackedNotificationIDs\(dq: [
      \(dqauthenticationUserAndPassword\(dq
    ],
    \(dqtrafficClass\(dq: 0,
    \(dqsetLowPriority\(dq: true,
    \(dqmaxFolderConcurrency\(dq: 0,
    \(dqcrURL\(dq: \(dqhttps://crash.syncthing.net/newcrash\(dq,
    \(dqcrashReportingEnabled\(dq: true,
    \(dqstunKeepaliveStartS\(dq: 180,
    \(dqstunKeepaliveMinS\(dq: 20,
    \(dqstunServers\(dq: [
      \(dqdefault\(dq
    ],
    \(dqdatabaseTuning\(dq: \(dqauto\(dq,
    \(dqmaxConcurrentIncomingRequestKiB\(dq: 0,
    \(dqannounceLANAddresses\(dq: true,
    \(dqsendFullIndexOnUpgrade\(dq: false,
    \(dqfeatureFlags\(dq: [],
    \(dqconnectionLimitEnough\(dq: 0,
    \(dqconnectionLimitMax\(dq: 0,
    \(dqinsecureAllowOldTLSVersions\(dq: false
  },
  \(dqremoteIgnoredDevices\(dq: [
    {
      \(dqtime\(dq: \(dq2022\-01\-09T20:02:01Z\(dq,
      \(dqdeviceID\(dq: \(dq...\(dq,
      \(dqname\(dq: \(dq...\(dq,
      \(dqaddress\(dq: \(dq192.168.0.20:22000\(dq
    }
  ],
  \(dqdefaults\(dq: {
    \(dqfolder\(dq: {
      \(dqid\(dq: \(dq\(dq,
      \(dqlabel\(dq: \(dq\(dq,
      \(dqfilesystemType\(dq: \(dqbasic\(dq,
      \(dqpath\(dq: \(dq~\(dq,
      \(dqtype\(dq: \(dqsendreceive\(dq,
      \(dqdevices\(dq: [
        {
          \(dqdeviceID\(dq: \(dq...\(dq,
          \(dqintroducedBy\(dq: \(dq\(dq,
          \(dqencryptionPassword\(dq: \(dq\(dq
        }
      ],
      \(dqrescanIntervalS\(dq: 3600,
      \(dqfsWatcherEnabled\(dq: true,
      \(dqfsWatcherDelayS\(dq: 10,
      \(dqignorePerms\(dq: false,
      \(dqautoNormalize\(dq: true,
      \(dqminDiskFree\(dq: {
        \(dqvalue\(dq: 1,
        \(dqunit\(dq: \(dq%\(dq
      },
      \(dqversioning\(dq: {
        \(dqtype\(dq: \(dq\(dq,
        \(dqparams\(dq: {},
        \(dqcleanupIntervalS\(dq: 3600,
        \(dqfsPath\(dq: \(dq\(dq,
        \(dqfsType\(dq: \(dqbasic\(dq
      },
      \(dqcopiers\(dq: 0,
      \(dqpullerMaxPendingKiB\(dq: 0,
      \(dqhashers\(dq: 0,
      \(dqorder\(dq: \(dqrandom\(dq,
      \(dqignoreDelete\(dq: false,
      \(dqscanProgressIntervalS\(dq: 0,
      \(dqpullerPauseS\(dq: 0,
      \(dqmaxConflicts\(dq: 10,
      \(dqdisableSparseFiles\(dq: false,
      \(dqdisableTempIndexes\(dq: false,
      \(dqpaused\(dq: false,
      \(dqweakHashThresholdPct\(dq: 25,
      \(dqmarkerName\(dq: \(dq.stfolder\(dq,
      \(dqcopyOwnershipFromParent\(dq: false,
      \(dqmodTimeWindowS\(dq: 0,
      \(dqmaxConcurrentWrites\(dq: 2,
      \(dqdisableFsync\(dq: false,
      \(dqblockPullOrder\(dq: \(dqstandard\(dq,
      \(dqcopyRangeMethod\(dq: \(dqstandard\(dq,
      \(dqcaseSensitiveFS\(dq: false,
      \(dqjunctionsAsDirs\(dq: false
    },
    \(dqdevice\(dq: {
      \(dqdeviceID\(dq: \(dq\(dq,
      \(dqname\(dq: \(dq\(dq,
      \(dqaddresses\(dq: [
        \(dqdynamic\(dq
      ],
      \(dqcompression\(dq: \(dqmetadata\(dq,
      \(dqcertName\(dq: \(dq\(dq,
      \(dqintroducer\(dq: false,
      \(dqskipIntroductionRemovals\(dq: false,
      \(dqintroducedBy\(dq: \(dq\(dq,
      \(dqpaused\(dq: false,
      \(dqallowedNetworks\(dq: [],
      \(dqautoAcceptFolders\(dq: false,
      \(dqmaxSendKbps\(dq: 0,
      \(dqmaxRecvKbps\(dq: 0,
      \(dqignoredFolders\(dq: [],
      \(dqmaxRequestKiB\(dq: 0,
      \(dquntrusted\(dq: false,
      \(dqremoteGUIPort\(dq: 0
    }
  }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/system/config/insync (DEPRECATED)
.sp
Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use
\fI\%/rest/config/restart\-required\fP instead.

.sp
Returns whether the config is in sync, i.e. whether the running
configuration is the same as that on disk.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqconfigInSync\(dq: true
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/system/config (DEPRECATED)
.sp
Deprecated since version v1.12.0: This endpoint still works as before but is deprecated.  Use \fI\%Config Endpoints\fP
instead.

.sp
Post the full contents of the configuration, in the same format as returned by
the corresponding GET request. When posting the configuration succeeds,
the posted configuration is immediately applied, except for changes that require a restart. Query
\fI\%/rest/config/restart\-required\fP to check if a restart is required.
.sp
This endpoint is the main point to control Syncthing, even if the change only
concerns a very small part of the config: The usual workflow is to get the
config, modify the needed parts and post it again.
.SS GET /rest/system/connections
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Return format changed in versions 0.13.0, 1.19.0 and 1.23.0.
.UNINDENT
.UNINDENT
.sp
Returns the list of configured devices and some metadata associated
with them. The list also contains the local device itself as not connected.
.sp
The connection types are \fBTCP (Client)\fP, \fBTCP (Server)\fP, \fBRelay (Client)\fP and \fBRelay (Server)\fP\&.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqconnections\(dq: {
    \(dqDOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA\(dq: {
      \(dqaddress\(dq: \(dq\(dq,
      \(dqat\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
      \(dqclientVersion\(dq: \(dq\(dq,
      \(dqconnected\(dq: false,
      \(dqinBytesTotal\(dq: 0,
      \(dqisLocal\(dq: false,
      \(dqoutBytesTotal\(dq: 0,
      \(dqpaused\(dq: false,
      \(dqstartedAt\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
      \(dqtype\(dq: \(dq\(dq
    },
    \(dqUYGDMA4\-TPHOFO5\-2VQYDCC\-7CWX7XW\-INZINQT\-LE4B42N\-4JUZTSM\-IWCSXA4\(dq: {
      \(dqaddress\(dq: \(dq\(dq,
      \(dqat\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
      \(dqclientVersion\(dq: \(dq\(dq,
      \(dqconnected\(dq: false,
      \(dqinBytesTotal\(dq: 0,
      \(dqisLocal\(dq: false,
      \(dqoutBytesTotal\(dq: 0,
      \(dqpaused\(dq: false,
      \(dqstartedAt\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
      \(dqtype\(dq: \(dq\(dq
    },
    \(dqYZJBJFX\-RDBL7WY\-6ZGKJ2D\-4MJB4E7\-ZATSDUY\-LD6Y3L3\-MLFUYWE\-AEMXJAC\(dq: {
      \(dqaddress\(dq: \(dq127.0.0.1:22002\(dq,
      \(dqat\(dq: \(dq2015\-11\-07T17:29:47.691548971+01:00\(dq,
      \(dqclientVersion\(dq: \(dqv0.12.1\(dq,
      \(dqconnected\(dq: true,
      \(dqinBytesTotal\(dq: 556,
      \(dqisLocal\(dq: true,
      \(dqoutBytesTotal\(dq: 550,
      \(dqpaused\(dq: false,
      \(dqstartedAt\(dq: \(dq2015\-11\-07T00:09:47Z\(dq,
      \(dqtype\(dq: \(dqTCP (Client)\(dq
    }
  },
  \(dqtotal\(dq: {
    \(dqat\(dq: \(dq2015\-11\-07T17:29:47.691637262+01:00\(dq,
    \(dqinBytesTotal\(dq: 1479,
    \(dqoutBytesTotal\(dq: 1318
  }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/system/debug
.sp
New in version 0.12.0.

.sp
Returns the set of debug facilities and which of them are currently enabled.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqenabled\(dq: [
    \(dqbeacon\(dq
  ],
  \(dqfacilities\(dq: {
    \(dqbeacon\(dq: \(dqMulticast and broadcast discovery\(dq,
    \(dqconfig\(dq: \(dqConfiguration loading and saving\(dq,
    \(dqconnections\(dq: \(dqConnection handling\(dq,
    \(dqdb\(dq: \(dqThe database layer\(dq,
    \(dqdialer\(dq: \(dqDialing connections\(dq,
    \(dqdiscover\(dq: \(dqRemote device discovery\(dq,
    \(dqevents\(dq: \(dqEvent generation and logging\(dq,
    \(dqhttp\(dq: \(dqREST API\(dq,
    \(dqmain\(dq: \(dqMain package\(dq,
    \(dqmodel\(dq: \(dqThe root hub\(dq,
    \(dqprotocol\(dq: \(dqThe BEP protocol\(dq,
    \(dqrelay\(dq: \(dqRelay connection handling\(dq,
    \(dqscanner\(dq: \(dqFile change detection and hashing\(dq,
    \(dqstats\(dq: \(dqPersistent device and folder statistics\(dq,
    \(dqsync\(dq: \(dqMutexes\(dq,
    \(dqupgrade\(dq: \(dqBinary upgrades\(dq,
    \(dqupnp\(dq: \(dqUPnP discovery and port mapping\(dq,
    \(dqversioner\(dq: \(dqFile versioning\(dq
  }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/system/debug
.sp
New in version 0.12.0.

.sp
Enables or disables debugging for specified facilities. Give one or both of
\fBenable\fP and \fBdisable\fP query parameters, with comma separated facility
names. To disable debugging of the beacon and discovery packages, and enable it
for config and db:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ curl \-H X\-API\-Key:abc123 \-X POST \(aqhttp://localhost:8384/rest/system/debug?disable=beacon,discovery&enable=config,db\(aq
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/system/discovery
.sp
Returns the contents of the local discovery cache.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqLGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\(dq: [
    \(dq192.162.129.11:22000\(dq
  ]
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/system/discovery
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Removed in v0.12.0.
.UNINDENT
.UNINDENT
.sp
Post with the query parameters \fBdevice\fP and \fBaddr\fP to add entries to
the discovery cache.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
curl \-X POST http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e&addr=192.162.129.11:22000
# Or with the X\-API\-Key header:
curl \-X POST \-\-header \(dqX\-API\-Key: TcE28kVPdtJ8COws1JdM0b2nodj77WeQ\(dq http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e&addr=192.162.129.11:22000
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/system/error/clear
.sp
Post with empty to body to remove all recent errors.
.SS GET /rest/system/error
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Return format changed in 0.12.0.
.UNINDENT
.UNINDENT
.sp
Returns the list of recent errors.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqerrors\(dq: [
    {
      \(dqwhen\(dq: \(dq2014\-09\-18T12:59:26.549953186+02:00\(dq,
      \(dqmessage\(dq: \(dqThis is an error string\(dq
    }
  ]
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/system/error
.sp
Post with an error message in the body (plain text) to register a new
error. The new error will be displayed on any active GUI clients.
.SS GET /rest/system/log
.sp
New in version 0.12.0.

.sp
Returns the list of recent log entries.  The optional \fBsince\fP parameter limits
the results to message newer than the given timestamp in \fI\%RFC 3339\fP <\fBhttps://datatracker.ietf.org/doc/html/rfc3339.html\fP> format.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqmessages\(dq: [
    {
      \(dqwhen\(dq: \(dq2014\-09\-18T12:59:26.549953186+02:00\(dq,
      \(dqmessage\(dq: \(dqThis is a log entry\(dq
    }
  ]
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/system/log.txt
.sp
Returns the same information, formatted as a text log instead of a JSON object.
.SS GET /rest/system/paths
.sp
New in version 1.21.0.

.sp
Returns the path locations used internally for storing configuration, database,
and others.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqauditLog\(dq: \(dq/home/user/.local/share/syncthing/audit\-${timestamp}.log\(dq,
  \(dqbaseDir\-config\(dq: \(dq/home/user/.config/syncthing\(dq,
  \(dqbaseDir\-data\(dq: \(dq/home/user/.local/share/syncthing\(dq,
  \(dqbaseDir\-userHome\(dq: \(dq/home/user\(dq,
  \(dqcertFile\(dq: \(dq/home/user/.config/syncthing/cert.pem\(dq,
  \(dqconfig\(dq: \(dq/home/user/.config/syncthing/config.xml\(dq,
  \(dqcsrfTokens\(dq: \(dq/home/user/.config/syncthing/csrftokens.txt\(dq,
  \(dqdatabase\(dq: \(dq/home/user/.local/share/syncthing/index\-v0.14.0.db\(dq,
  \(dqdefFolder\(dq: \(dq/home/user/Sync\(dq,
  \(dqguiAssets\(dq: \(dq/home/user/src/syncthing/gui\(dq,
  \(dqhttpsCertFile\(dq: \(dq/home/user/.config/syncthing/https\-cert.pem\(dq,
  \(dqhttpsKeyFile\(dq: \(dq/home/user/.config/syncthing/https\-key.pem\(dq,
  \(dqkeyFile\(dq: \(dq/home/user/.config/syncthing/key.pem\(dq,
  \(dqlogFile\(dq: \(dq\-\(dq,
  \(dqpanicLog\(dq: \(dq/home/user/.local/share/syncthing/panic\-${timestamp}.log\(dq
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/system/pause
.sp
Pause the given device or all devices.
.sp
Takes the optional parameter \fBdevice\fP (device ID). When omitted,
pauses all devices.  Returns status 200 and no content upon success, or status
500 and a plain text error on failure.
.SS GET /rest/system/ping
.sp
Returns a \fB{\(dqping\(dq: \(dqpong\(dq}\fP object.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqping\(dq: \(dqpong\(dq
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/system/ping
.sp
Returns a \fB{\(dqping\(dq: \(dqpong\(dq}\fP object.
.SS POST /rest/system/reset
.sp
Post with empty body to erase the current index database and restart
Syncthing. With no query parameters, the entire database is erased from disk.
By specifying the \fBfolder\fP parameter with a valid folder ID, only
information for that folder will be erased:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
curl \-X POST \-H \(dqX\-API\-Key: abc123\(dq http://localhost:8384/rest/system/reset?folder=ab1c2\-def3g
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBCaution\fP: See \fI\%\-\-reset\-database\fP for \fB\&.stfolder\fP creation
side\-effect and caution regarding mountpoints.
.SS POST /rest/system/restart
.sp
Post with empty body to immediately restart Syncthing.
.SS POST /rest/system/resume
.sp
Resume the given device or all devices.
.sp
Takes the optional parameter \fBdevice\fP (device ID). When omitted,
resumes all devices.  Returns status 200 and no content upon success, or status
500 and a plain text error on failure.
.SS POST /rest/system/shutdown
.sp
Post with empty body to cause Syncthing to exit and not restart.
.SS GET /rest/system/status
.sp
Returns information about current system status and resource usage. The CPU percent value has been deprecated from the API and will always report 0.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqalloc\(dq: 30618136,
  \(dqconnectionServiceStatus\(dq: {
    \(dqdynamic+https://relays.syncthing.net/endpoint\(dq: {
      \(dqerror\(dq: null,
      \(dqlanAddresses\(dq: [
        \(dqrelay://23.92.71.120:443/?id=53STGR7\-YBM6FCX\-PAZ2RHM\-YPY6OEJ\-WYHVZO7\-PCKQRCK\-PZLTP7T\-434XCAD&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=canton7\(dq
      ],
      \(dqwanAddresses\(dq: [
        \(dqrelay://23.92.71.120:443/?id=53STGR7\-YBM6FCX\-PAZ2RHM\-YPY6OEJ\-WYHVZO7\-PCKQRCK\-PZLTP7T\-434XCAD&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=canton7\(dq
      ]
    },
    \(dqtcp://0.0.0.0:22000\(dq: {
      \(dqerror\(dq: null,
      \(dqlanAddresses\(dq: [
        \(dqtcp://0.0.0.0:22000\(dq
      ],
      \(dqwanAddresses\(dq: [
        \(dqtcp://0.0.0.0:22000\(dq
      ]
    }
  },
  \(dqcpuPercent\(dq: 0,
  \(dqdiscoveryEnabled\(dq: true,
  \(dqdiscoveryErrors\(dq: {
    \(dqglobal@https://discovery\-v4\-1.syncthing.net/v2/\(dq: \(dq500 Internal Server Error\(dq,
    \(dqglobal@https://discovery\-v4\-2.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v4\-2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq,
    \(dqglobal@https://discovery\-v4\-3.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v4\-3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq,
    \(dqglobal@https://discovery\-v6\-1.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v6\-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host\(dq,
    \(dqglobal@https://discovery\-v6\-2.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v6\-2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host\(dq,
    \(dqglobal@https://discovery\-v6\-3.syncthing.net/v2/\(dq: \(dqPost https://discovery\-v6\-3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host\(dq
  },
  \(dqdiscoveryStatus\(dq: {
    \(dqIPv4 local\(dq: {
      \(dqerror\(dq: null
    },
    \(dqIPv6 local\(dq: {
      \(dqerror\(dq: null
    },
    \(dqglobal@https://discovery\-v4\-1.syncthing.net/v2/\(dq: {
      \(dqerror\(dq: \(dq500 Internal Server Error\(dq
    },
    \(dqglobal@https://discovery\-v4\-2.syncthing.net/v2/\(dq: {
      \(dqerror\(dq: \(dqPost https://discovery\-v4\-2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq
    },
    \(dqglobal@https://discovery\-v4\-3.syncthing.net/v2/\(dq: {
      \(dqerror\(dq: \(dqPost https://discovery\-v4\-3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq
    },
    \(dqglobal@https://discovery\-v6\-1.syncthing.net/v2/\(dq: {
      \(dqerror\(dq: \(dqPost https://discovery\-v6\-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host\(dq
    },
    \(dqglobal@https://discovery\-v6\-2.syncthing.net/v2/\(dq: {
      \(dqerror\(dq: \(dqPost https://discovery\-v6\-2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host\(dq
    },
    \(dqglobal@https://discovery\-v6\-3.syncthing.net/v2/\(dq: {
      \(dqerror\(dq: \(dqPost https://discovery\-v6\-3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host\(dq
    }
  },
  \(dqdiscoveryMethods\(dq: 8,
  \(dqgoroutines\(dq: 49,
  \(dqlastDialStatus\(dq: {
      \(dqtcp://10.20.30.40\(dq: {
        \(dqwhen\(dq: \(dq2019\-05\-16T07:41:23Z\(dq,
        \(dqerror\(dq: \(dqdial tcp 10.20.30.40:22000: i/o timeout\(dq
      },
      \(dqtcp://172.16.33.3:22000\(dq: {
        \(dqwhen\(dq: \(dq2019\-05\-16T07:40:43Z\(dq,
        \(dqok\(dq: true
      },
      \(dqtcp://83.233.120.221:22000\(dq: {
        \(dqwhen\(dq: \(dq2019\-05\-16T07:41:13Z\(dq,
        \(dqerror\(dq: \(dqdial tcp 83.233.120.221:22000: connect: connection refused\(dq
      }
  },
  \(dqmyID\(dq: \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq,
  \(dqpathSeparator\(dq: \(dq/\(dq,
  \(dqstartTime\(dq: \(dq2016\-06\-06T19:41:43.039284753+02:00\(dq,
  \(dqsys\(dq: 42092792,
  \(dqthemes\(dq: [
    \(dqdefault\(dq,
    \(dqdark\(dq
  ],
  \(dqtilde\(dq: \(dq/Users/jb\(dq,
  \(dquptime\(dq: 2635
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
New in version 1.2.0: The \fBlastDialStatus\fP dictionary contains the last error (or \fBnull\fP for
success) for each peer address that Syncthing has attempted to contact.
The \fBconnectionServiceStatus\fP entries gained \fB\(dqerror\(dq: null\fP
attributes where previously there would be no \fBerror\fP attribute at all
in the success case.

.sp
New in version 1.18.0: The \fBdiscoveryStatus\fP dictionary lists all configured discovery methods, not
only failed ones like the now deprecated \fBdiscoveryErrors\fP\&.  Each entry is
an object itself (for consistency with other fields), where a \fBnull\fP value
for the \fBerror\fP attribute means the method is running successfully.  This
effectively deprecates the \fBdiscoveryMethods\fP attribute as well, which now
always matches the number of entries in \fBdiscoveryStatus\fP\&.

.SS GET /rest/system/upgrade
.sp
Checks for a possible upgrade and returns an object describing the
newest version and upgrade possibility.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqlatest\(dq: \(dqv0.14.47\(dq,
  \(dqmajorNewer\(dq: false,
  \(dqnewer\(dq: true,
  \(dqrunning\(dq: \(dqv0.14.46\(dq
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/system/upgrade
.sp
Perform an upgrade to the newest released version and restart. Does
nothing if there is no newer version than currently running.
.SS GET /rest/system/version
.sp
Returns the current Syncthing version information.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqarch\(dq: \(dqamd64\(dq,
  \(dqlongVersion\(dq: \(dqsyncthing v0.10.27+3\-gea8c3de (go1.4 darwin\-amd64 default) jb@syno 2015\-03\-16 11:01:29 UTC\(dq,
  \(dqos\(dq: \(dqdarwin\(dq,
  \(dqversion\(dq: \(dqv0.10.27+3\-gea8c3de\(dq
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SH CONFIG ENDPOINTS
.SS Config Endpoints
.sp
New in version 1.12.0.

.sp
These endpoints facilitate access and modification of the \fI\%configuration\fP in a granular way. Config sent to the endpoints must be in the
same format as returned by the corresponding GET request. When posting the
configuration succeeds, the posted configuration is immediately applied, except
for changes that require a restart. Query \fI\%/rest/config/restart\-required\fP to check if
a restart is required.
.sp
For all endpoints supporting \fBPATCH\fP, it takes the existing config and
unmarshals the given JSON object on top of it. This means all child objects will
replace the existing objects, not extend them. For example for
\fBRawListenAddresses\fP in options, which is an array of strings, sending
\fB{RawListenAddresses: [\(dqtcp://10.0.0.2\(dq]}\fP will replace all existing listen
addresses.
.SS /rest/config
.sp
\fBGET\fP returns the entire config and \fBPUT\fP replaces it.
.SS /rest/config/restart\-required
.sp
\fBGET\fP returns whether a restart of Syncthing is required for the current
config to take effect.
.SS /rest/config/folders, /rest/config/devices
.sp
\fBGET\fP returns all folders respectively devices as an array. \fBPUT\fP takes an array and
\fBPOST\fP a single object. In both cases if a given folder/device already exists,
it’s replaced, otherwise a new one is added.
.SS /rest/config/folders/*id*, /rest/config/devices/*id*
.sp
Put the desired folder\- respectively device\-ID in place of *id*. \fBGET\fP
returns the folder/device for the given ID, \fBPUT\fP replaces the entire config,
\fBPATCH\fP replaces only the given child objects and \fBDELETE\fP removes the
folder/device.
.SS /rest/config/defaults/folder, /rest/config/defaults/device
.sp
\fBGET\fP returns a template folder / device configuration object with all default
values, which only needs a unique ID to be applied.  \fBPUT\fP replaces the
default config (omitted values are reset to the hard\-coded defaults), \fBPATCH\fP
replaces only the given child objects.
.SS /rest/config/defaults/ignores
.sp
New in version 1.19.0.

.sp
\fBGET\fP returns an object with a single \fBlines\fP attribute listing ignore
patterns to be used by default on folders, as an array of single\-line strings.
\fBPUT\fP replaces the default ignore patterns from an object of the same format.
.SS /rest/config/options, /rest/config/ldap, /rest/config/gui
.sp
\fBGET\fP returns the respective object, \fBPUT\fP replaces the entire object and
\fBPATCH\fP replaces only the given child objects.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
The \fI\%gui.password\fP configuration option has special handling to
accept already hashed passwords.  Any valid bcrypt hash is stored verbatim,
while a plaintext password is first hashed.
.UNINDENT
.UNINDENT
.SH CLUSTER ENDPOINTS
.sp
Concerns the mesh network structure.
.SS DELETE /rest/cluster/pending/devices
.sp
New in version 1.18.0.

.sp
Remove records about a pending remote device which tried to connect.  Valid
values for the \fBdevice\fP parameter are those from the corresponding
\fI\%GET /rest/cluster/pending/devices\fP endpoint.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ curl \-X DELETE \-H \(dqX\-API\-Key: abc123\(dq http://localhost:8384/rest/cluster/pending/devices?device=P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Returns status 200 and no content upon success, or status 500 and a
plain text error on failure.  A \fI\%PendingDevicesChanged\fP
event will be generated in response.
.sp
For a more permanent effect, also for future connections from the same
device ID, the device should be ignored in the \fI\%configuration\fP instead.
.SS GET /rest/cluster/pending/devices
.sp
New in version 1.13.0.

.sp
Lists remote devices which have tried to connect, but are not yet
configured in our instance.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
    \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
    \(dqname\(dq: \(dqFriend Joe\(dq,
    \(dqaddress\(dq: \(dq192.168.1.2:22000\(dq
  }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS DELETE /rest/cluster/pending/folders
.sp
New in version 1.18.0.

.sp
Remove records about a pending folder announced from a remote device.  Valid
values for the \fBfolder\fP and \fBdevice\fP parameters are those from the
corresponding \fI\%GET /rest/cluster/pending/folders\fP endpoint.  The \fBdevice\fP
parameter is optional and affects announcements of this folder from the given
device, or from \fIany\fP device if omitted.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ curl \-X DELETE \-H \(dqX\-API\-Key: abc123\(dq http://localhost:8384/rest/cluster/pending/folders?folder=cpkn4\-57ysy&device=P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Returns status 200 and no content upon success, or status 500 and a plain text
error on failure.  A \fI\%PendingFoldersChanged\fP event will be
generated in response.
.sp
For a more permanent effect, also for future announcements of the same folder
ID, the folder should be ignored in the \fI\%configuration\fP
instead.
.SS GET /rest/cluster/pending/folders
.sp
New in version 1.13.0.

.sp
Lists folders which remote devices have offered to us, but are not yet
shared from our instance to them.  Takes the optional \fBdevice\fP
parameter to only return folders offered by a specific remote device.
Other offering devices are also omitted from the result.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqcpkn4\-57ysy\(dq: {
    \(dqofferedBy\(dq: {
      \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
        \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
        \(dqlabel\(dq: \(dqJoe\(aqs folder\(dq,
        \(dqreceiveEncrypted\(dq: true,
        \(dqremoteEncrypted\(dq: false
      },
      \(dqDOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA\(dq: {
        \(dqtime\(dq: \(dq2020\-03\-01T10:12:13Z\(dq,
        \(dqlabel\(dq: \(dqJane\(aqs and Joe\(aqs folder\(dq,
        \(dqreceiveEncrypted\(dq: false,
        \(dqremoteEncrypted\(dq: false
      }
    }
  },
  \(dqabcde\-fghij\(dq: {
    \(dqofferedBy\(dq: {
      \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
        \(dqtime\(dq: \(dq2020\-03\-18T11:43:07Z\(dq,
        \(dqlabel\(dq: \(dqMyPics\(dq,
        \(dqreceiveEncrypted\(dq: false,
        \(dqremoteEncrypted\(dq: false
      }
    }
  }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SH FOLDER ENDPOINTS
.sp
Runtime state of the individual shared folders.
.SS GET /rest/folder/errors
.sp
New in version 0.14.53.

.sp
Takes one mandatory parameter, \fBfolder\fP, and returns the list of errors
encountered during scanning or pulling.
.sp
The results can be paginated using the \fI\%common pagination parameters\fP\&.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqfolder\(dq: \(dqnnhic\-sxuae\(dq,
  \(dqerrors\(dq: [
    {
      \(dqpath\(dq: \(dqnoperm.txt\(dq,
      \(dqerror\(dq: \(dqhashing: open /path/to/folder/noperm.txt: permission denied\(dq
    }
  ],
  \(dqpage\(dq: 1,
  \(dqperpage\(dq: 100
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/folder/pullerrors (DEPRECATED)
.sp
Deprecated since version v0.14.53: This endpoint still works as before but is deprecated.  Use
\fI\%GET /rest/folder/errors\fP instead, which returns the same information.
.sp
See \fI\%https://github.com/syncthing/syncthing/commit/d510e3cca3d5caae42121fa206b3decc981ae59e\fP

.SS GET /rest/folder/versions
.sp
New in version 0.14.44.

.sp
Takes one mandatory parameter, \fBfolder\fP, and returns the list of archived
files that could be recovered.  How many versions are available depends on the
\fI\%File Versioning\fP configuration.  Each entry specifies when the file
version was archived as the \fBversionTime\fP, the \fBmodTime\fP when it was last
modified before being archived, and the size in bytes.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqdir1/dir2/bar\(dq: [
    {
      \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:12+01:00\(dq,
      \(dqmodTime\(dq: \(dq2021\-01\-14T13:21:22+01:00\(dq,
      \(dqsize\(dq: 4
    }
  ],
  \(dqbaz\(dq: [
    {
      \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq,
      \(dqmodTime\(dq: \(dq2021\-01\-14T13:23:49+01:00\(dq,
      \(dqsize\(dq: 4
    }
  ],
  \(dqfoo\(dq: [
    {
      \(dqversionTime\(dq: \(dq2022\-02\-06T20:55:31+01:00\(dq,
      \(dqmodTime\(dq: \(dq2022\-02\-06T20:44:13+01:00\(dq,
      \(dqsize\(dq: 4
    },
    {
      \(dqversionTime\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq,
      \(dqmodTime\(dq: \(dq2021\-01\-14T13:21:16+01:00\(dq,
      \(dqsize\(dq: 4
    }
  ]
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/folder/versions
.sp
Restore archived versions of a given set of files.  Expects an object with
attributes named after the relative file paths, with timestamps as values
matching valid \fBversionTime\fP entries in the corresponding
\fI\%GET /rest/folder/versions\fP response object.
.sp
Takes the mandatory parameter \fBfolder\fP (folder ID).  Returns an object
containing any error messages that occurred during restoration of the file, with
the file path as attribute name.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
curl \-X POST \-H X\-API\-key:... http://127.0.0.1:8384/rest/folder/versions?folder=default \-d \(aq{
  \(dqdir1/dir2/bar\(dq: \(dq2022\-02\-06T20:44:12+01:00\(dq,
  \(dqbaz\(dq: \(dq2022\-02\-06T20:44:20+01:00\(dq
}\(aq
.ft P
.fi
.UNINDENT
.UNINDENT
.SH DATABASE ENDPOINTS
.SS GET /rest/db/browse
.sp
Returns the directory tree of the global model. Directories are always
JSON objects (map/dictionary), and files are always arrays of
modification time and size. The first integer is the files modification
time, and the second integer is the file size.
.sp
The call takes one mandatory \fBfolder\fP parameter and two optional
parameters. Optional parameter \fBlevels\fP defines how deep within the
tree we want to dwell down (0 based, defaults to unlimited depth)
Optional parameter \fBprefix\fP defines a prefix within the tree where to
start building the structure.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ curl \-s http://localhost:8384/rest/db/browse?folder=j663y\-3ct3e&prefix=DCIM&levels=2
[
    {
        \(dqmodTime\(dq : \(dq2020\-10\-02T23:48:52.076996974+02:00\(dq,
        \(dqname\(dq : \(dq100ANDRO\(dq,
        \(dqsize\(dq : 128,
        \(dqtype\(dq : \(dqFILE_INFO_TYPE_DIRECTORY\(dq
    },
    {
        \(dqchildren\(dq : [
            {
                \(dqmodTime\(dq : \(dq2020\-12\-16T23:31:34.5009668+01:00\(dq,
                \(dqname\(dq : \(dqIMG_20201114_124821.jpg\(dq,
                \(dqsize\(dq : 10682189,
                \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
            },
            {
                \(dqmodTime\(dq : \(dq2020\-12\-16T23:31:35.0106367+01:00\(dq,
                \(dqname\(dq : \(dqIMG_20201213_122451.jpg\(dq,
                \(dqsize\(dq : 7936351,
                \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
            },
            {
                \(dqmodTime\(dq : \(dq2020\-12\-13T12:25:05.017097469+01:00\(dq,
                \(dqname\(dq : \(dqIMG_20201213_122504.jpg\(dq,
                \(dqsize\(dq : 8406507,
                \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
            },
            {
                \(dqmodTime\(dq : \(dq2020\-12\-13T12:25:06.127097469+01:00\(dq,
                \(dqname\(dq : \(dqIMG_20201213_122505.jpg\(dq,
                \(dqsize\(dq : 8381931,
                \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
            },
            {
                \(dqmodTime\(dq : \(dq2020\-12\-13T12:53:29.707298401+01:00\(dq,
                \(dqname\(dq : \(dqIMG_20201213_125329.jpg\(dq,
                \(dqsize\(dq : 4388331,
                \(dqtype\(dq : \(dqFILE_INFO_TYPE_FILE\(dq
            },
        ],
        \(dqmodTime\(dq : \(dq2020\-10\-09T13:04:42.4410738+02:00\(dq,
        \(dqname\(dq : \(dqCamera\(dq,
        \(dqsize\(dq : 128,
        \(dqtype\(dq : \(dqFILE_INFO_TYPE_DIRECTORY\(dq
    },
]
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
.UNINDENT
.UNINDENT
.SS GET /rest/db/completion
.sp
Returns the completion percentage (0 to 100) and byte / item counts. Takes
optional \fBdevice\fP and \fBfolder\fP parameters:
.INDENT 0.0
.IP \(bu 2
\fBfolder\fP specifies the folder ID to calculate completion for. An empty
or absent \fBfolder\fP parameter means all folders as an aggregate.
.IP \(bu 2
\fBdevice\fP specifies the device ID to calculate completion for. An empty
or absent \fBdevice\fP parameter means the local device.
.UNINDENT
.sp
If a device is specified but no folder, completion is calculated for all
folders shared with that device.
.SS Example Queries
.sp
Completion status for folder \fBabcd\-1234\fP on device \fBI6KAH76\-...\-3PSROAU\fP:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
/rest/db/completion?folder=abcd\-1234&device=I6KAH76\-...\-3PSROAU
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Aggregated completion status for device \fBI6KAH76\-...\-3PSROAU\fP (all folders shared with them):
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
/rest/db/completion?device=I6KAH76\-...\-3PSROAU
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Completion status for folder \fBabcd\-1234\fP on the local device:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
/rest/db/completion?folder=abcd\-1234
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Aggregated completion status for all folders on the local device:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
/rest/db/completion
.ft P
.fi
.UNINDENT
.UNINDENT
.SS Example Response
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqcompletion\(dq: 99.9937565835,
  \(dqglobalBytes\(dq: 156793013575,
  \(dqneedBytes\(dq: 9789241,
  \(dqglobalItems\(dq: 7823,
  \(dqneedItems\(dq: 412,
  \(dqneedDeletes\(dq: 0,
  \(dqremoteState\(dq: \(dqvalid\(dq,
  \(dqsequence\(dq: 12
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
New in version 1.8.0: The ability to aggregate multiple folders by leaving out the folder ID.
Querying data for the local device by leaving out the device ID. Returning
the \fBglobalItems\fP counter in the response.

.sp
New in version 1.20.0: Indication whether the remote device has accepted the folder (shares it with
us) as well, and whether it is paused.  The \fBremoteState\fP field is
meaningless for aggregated responses, \fBunknown\fP when the remote device is
not connected.  Otherwise it can be either \fBpaused\fP, \fBnotSharing\fP, or
\fBvalid\fP if the remote is sharing back.

.SS GET /rest/db/file
.sp
Returns most data available about a given file, including version and
availability. Takes \fBfolder\fP and \fBfile\fP parameters. \fBlocal\fP and
\fBglobal\fP refer to the current file on disk and the globally newest file,
respectively.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqavailability\(dq: [
    {
      \(dqid\(dq: \(dqITZRNXE\-YNROGBZ\-HXTH5P7\-VK5NYE5\-QHRQGE2\-7JQ6VNJ\-KZUEDIU\-5PPR5AM\(dq,
      \(dqfromTemporary\(dq: false
    }
  ],
  \(dqglobal\(dq: { /* a file entry */ },
  \(dqlocal\(dq: { /* a file entry */ }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
A file entry looks like this:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  {
    \(dqdeleted\(dq: false,
    \(dqignored\(dq: false,
    \(dqinodeChange\(dq: \(dq1970\-01\-01T01:00:00+01:00\(dq,
    \(dqinvalid\(dq: false,
    \(dqlocalFlags\(dq: 0,
    \(dqmodified\(dq: \(dq2022\-09\-28T08:07:19.979723+02:00\(dq,
    \(dqmodifiedBy\(dq: \(dq523ITIE\(dq,
    \(dqmustRescan\(dq: false,
    \(dqname\(dq: \(dqimg\(dq,
    \(dqnoPermissions\(dq: false,
    \(dqnumBlocks\(dq: 0,
    \(dqpermissions\(dq: \(dq0755\(dq,
    \(dqplatform\(dq: { /* platform specific data */ },
    \(dqsequence\(dq: 914,
    \(dqsize\(dq: 128,
    \(dqtype\(dq: \(dqFILE_INFO_TYPE_DIRECTORY\(dq,
    \(dqversion\(dq: [
      \(dq523ITIE:1664345275\(dq
    ]
  },
  \(dqmtime\(dq: {
    \(dqerr\(dq: null,
    \(dqvalue\(dq: {
      \(dqreal\(dq: \(dq0001\-01\-01T00:00:00Z\(dq,
      \(dqvirtual\(dq: \(dq0001\-01\-01T00:00:00Z\(dq
    }
  }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Platform specific data may be ownership, extended attributes, etc. and is
divided into entries per operating system / platform. An example platform
entry containing ownership information for Unix systems and an extended
attribute for macOS (“darwin”) looks as follows:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqdarwin\(dq: {
    \(dqxattrs\(dq: [
      {
        \(dqname\(dq: \(dqnet.kastelo.xattrtest\(dq,
        \(dqvalue\(dq: \(dqaGVsbG8=\(dq
      }
    ]
  },
  \(dqfreebsd\(dq: null,
  \(dqlinux\(dq: null,
  \(dqnetbsd\(dq: null,
  \(dqunix\(dq: {
    \(dqgid\(dq: 20,
    \(dqgroupName\(dq: \(dqstaff\(dq,
    \(dqownerName\(dq: \(dqjb\(dq,
    \(dquid\(dq: 501
  },
  \(dqwindows\(dq: null
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/db/ignores
.sp
Takes one parameter, \fBfolder\fP, and returns the content of the
\fB\&.stignore\fP as the \fBignore\fP field. A second field, \fBexpanded\fP,
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.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqignore\(dq: [
    \(dq(?i)/Backups\(dq
  ],
  \(dqexpanded\(dq: [
    \(dq(?i)Backups\(dq,
    \(dq(?i)Backups/**\(dq
  ]
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/db/ignores
.sp
Expects a format similar to the output of \fI\%GET /rest/db/ignores\fP call, but only
containing the \fBignore\fP field (\fBexpanded\fP field should be omitted).
It takes one parameter, \fBfolder\fP, and either updates the content of
the \fB\&.stignore\fP echoing it back as a response, or returns an error.
.SS GET /rest/db/localchanged
.sp
New in version 0.14.55.

.sp
Takes one mandatory parameter, \fBfolder\fP, and returns the list of files which
were changed locally in a receive\-only folder.  Thus they differ from the global
state and could be reverted by pulling from remote devices again, see
\fI\%POST /rest/db/revert\fP\&.
.sp
The results can be paginated using the \fI\%common pagination parameters\fP\&.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqfiles\(dq: [
    {
      \(dqflags\(dq: \(dq0755\(dq,
      \(dqsequence\(dq: 6,
      \(dqmodified\(dq: \(dq2015\-04\-20T23:06:12+09:00\(dq,
      \(dqname\(dq: \(dqls\(dq,
      \(dqsize\(dq: 34640,
      \(dqversion\(dq: [
        \(dq5157751870738175669:1\(dq
      ]
    }
  ],
  \(dqpage\(dq: 1,
  \(dqperpage\(dq: 100
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
This is an expensive call, increasing CPU and RAM usage on the device.
Use sparingly.
.UNINDENT
.UNINDENT
.SS GET /rest/db/need
.sp
Takes one mandatory parameter, \fBfolder\fP, and returns lists of files which are
needed by this device in order for it to become in sync.
.sp
The results can be paginated using the \fI\%common pagination parameters\fP\&.  Pagination happens, across the union of all needed files,
that is \- across all 3 sections of the response.  For example, given the current
need state is as follows:
.INDENT 0.0
.IP 1. 3
\fBprogress\fP has 15 items
.IP 2. 3
\fBqueued\fP has 3 items
.IP 3. 3
\fBrest\fP has 12 items
.UNINDENT
.sp
If you issue a query with \fBpage=1\fP and \fBperpage=10\fP, only the \fBprogress\fP
section in the response will have 10 items. If you issue a request query with
\fBpage=2\fP and \fBperpage=10\fP, \fBprogress\fP section will have the last 5 items,
\fBqueued\fP section will have all 3 items, and \fBrest\fP section will have first
2 items. If you issue a query for \fBpage=3\fP and \fBperpage=10\fP, you will only
have the last 10 items of the \fBrest\fP section.
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
Return format changed in version 0.14.43, removing the \fBtotal\fP count
attribute.
.UNINDENT
.UNINDENT
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  # Files currently being downloaded
  \(dqprogress\(dq: [
    {
      \(dqflags\(dq: \(dq0755\(dq,
      \(dqsequence\(dq: 6,
      \(dqmodified\(dq: \(dq2015\-04\-20T23:06:12+09:00\(dq,
      \(dqname\(dq: \(dqls\(dq,
      \(dqsize\(dq: 34640,
      \(dqversion\(dq: [
        \(dq5157751870738175669:1\(dq
      ]
    }
  ],
  # Files queued to be downloaded next (as per array order)
  \(dqqueued\(dq: [
      ...
  ],
  # Files to be downloaded after all queued files will be downloaded.
  # This happens when we start downloading files, and new files get added while we are downloading.
  \(dqrest\(dq: [
      ...
  ],
  \(dqpage\(dq: 1,
  \(dqperpage\(dq: 100
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
This is an expensive call, increasing CPU and RAM usage on the device.
Use sparingly.
.UNINDENT
.UNINDENT
.SS POST /rest/db/override
.sp
Request override of a send only folder. Override means to make the local
version latest, overriding changes made on other devices. This API call does
nothing if the folder is not a send only folder.
.sp
Takes the mandatory parameter \fIfolder\fP (folder ID).
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
curl \-X POST \-H X\-API\-key:... http://127.0.0.1:8384/rest/db/override?folder=default
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/db/prio
.sp
Moves the file to the top of the download queue.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
curl \-X POST http://127.0.0.1:8384/rest/db/prio?folder=default&file=foo/bar
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Response contains the same output as \fI\%GET /rest/db/need\fP\&.
.SS GET /rest/db/remoteneed
.sp
New in version 0.14.43.

.sp
Takes the mandatory parameters \fBfolder\fP and \fBdevice\fP, and returns the list
of files which are needed by that remote device in order for it to become in
sync with the shared folder.
.sp
The results can be paginated using the \fI\%common pagination parameters\fP\&.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqfiles\(dq: [
    {
      \(dqflags\(dq: \(dq0755\(dq,
      \(dqsequence\(dq: 6,
      \(dqmodified\(dq: \(dq2015\-04\-20T23:06:12+09:00\(dq,
      \(dqname\(dq: \(dqls\(dq,
      \(dqsize\(dq: 34640,
      \(dqversion\(dq: [
        \(dq5157751870738175669:1\(dq
      ]
    }
  ],
  \(dqpage\(dq: 1,
  \(dqperpage\(dq: 100
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
This is an expensive call, increasing CPU and RAM usage on the device.
Use sparingly.
.UNINDENT
.UNINDENT
.SS POST /rest/db/revert
.sp
New in version 0.14.50.

.sp
Request revert of a receive only folder. Reverting a folder means to undo
all local changes. This API call does nothing if the folder is not a receive
only folder.
.sp
Takes the mandatory parameter \fIfolder\fP (folder ID).
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
curl \-X POST \-H X\-API\-Key:... http://127.0.0.1:8384/rest/db/revert?folder=default
.ft P
.fi
.UNINDENT
.UNINDENT
.SS POST /rest/db/scan
.sp
Request immediate scan. Takes the optional parameters \fBfolder\fP (folder ID),
\fBsub\fP (path relative to the folder root) and \fBnext\fP (time in seconds). If
\fBfolder\fP is omitted or empty all folders are scanned. If \fBsub\fP is given,
only this path (and children, in case it’s a directory) is scanned. The \fBnext\fP
argument delays Syncthing’s automated rescan interval for a given amount of
seconds.
.sp
Requesting scan of a path that no longer exists, but previously did, is
valid and will result in Syncthing noticing the deletion of the path in
question.
.sp
Returns status 200 and no content upon success, or status 500 and a
plain text error if an error occurred during scanning.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
curl \-X POST http://127.0.0.1:8384/rest/db/scan?folder=default&sub=foo/bar
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/db/status
.sp
Returns information about the current status of a folder.
.sp
Parameters: \fBfolder\fP, the ID of a folder.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqglobalBytes\(dq: 0,
  \(dqglobalDeleted\(dq: 0,
  \(dqglobalDirectories\(dq: 0,
  \(dqglobalFiles\(dq: 0,
  \(dqglobalSymlinks\(dq: 0,
  \(dqglobalTotalItems\(dq: 0,
  \(dqignorePatterns\(dq: false,
  \(dqinSyncBytes\(dq: 0,
  \(dqinSyncFiles\(dq: 0,
  \(dqinvalid\(dq: \(dq\(dq,
  \(dqlocalBytes\(dq: 0,
  \(dqlocalDeleted\(dq: 0,
  \(dqlocalDirectories\(dq: 0,
  \(dqlocalFiles\(dq: 0,
  \(dqlocalSymlinks\(dq: 0,
  \(dqlocalTotalItems\(dq: 0,
  \(dqneedBytes\(dq: 0,
  \(dqneedDeletes\(dq: 0,
  \(dqneedDirectories\(dq: 0,
  \(dqneedFiles\(dq: 0,
  \(dqneedSymlinks\(dq: 0,
  \(dqneedTotalItems\(dq: 0,
  \(dqpullErrors\(dq: 0,
  \(dqreceiveOnlyChangedBytes\(dq: 0,
  \(dqreceiveOnlyChangedDeletes\(dq: 0,
  \(dqreceiveOnlyChangedDirectories\(dq: 0,
  \(dqreceiveOnlyChangedFiles\(dq: 0,
  \(dqreceiveOnlyChangedSymlinks\(dq: 0,
  \(dqreceiveOnlyTotalItems\(dq: 0,
  \(dqsequence\(dq: 0,
  \(dqstate\(dq: \(dqidle\(dq,
  \(dqstateChanged\(dq: \(dq2018\-08\-08T07:04:57.301064781+02:00\(dq,
  \(dqversion\(dq: 0
}
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The various fields have the following meaning:
.INDENT 0.0
.TP
.B global*:
Data in the cluster latest version.
.TP
.B inSync*:
Data that is locally the same as the cluster latest version.
.TP
.B local*:
Data that is locally present, regardless of whether it’s the same or different version as the cluster latest version.
.TP
.B need*:
Data that is needed to become up to date with the cluster latest version (i.e., data that is out of sync).
.TP
.B receiveOnlyChanged*:
Data that has changed locally in a receive only folder, and thus not been sent to the cluster.
.TP
.B invalid:
Deprecated, always empty.
.TP
.B pullErrors:
The number of files that failed to sync during the last sync operations.
.TP
.B sequence:
The current folder sequence number.
.TP
.B state:
The current folder state.
.TP
.B stateChanged:
When the folder state last changed.
.TP
.B version:
Deprecated, equivalent to the sequence number.
.UNINDENT
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
This is an expensive call, increasing CPU and RAM usage on the device. Use sparingly.
.UNINDENT
.UNINDENT
.SH EVENT ENDPOINTS
.SS GET /rest/events
.sp
To receive events, perform a HTTP GET of \fB/rest/events\fP\&.
.sp
To filter the event list, in effect creating a specific subscription for only
the desired event types, add a parameter \fBevents=EventTypeA,EventTypeB,...\fP
where the event types are any of the \fI\%Event Types\fP\&.  If no filter is
specified, all events \fIexcept\fP \fI\%LocalChangeDetected\fP and
\fI\%RemoteChangeDetected\fP are included.
.sp
The optional parameter \fBsince=<lastSeenID>\fP sets the ID of the last event
you’ve already seen. Syncthing returns a JSON encoded array of event objects,
starting at the event just after the one with this last seen ID. The default
value is 0, which returns all events. There is a limit to the number of events
buffered, so if the rate of events is high or the time between polling calls is
long some events might be missed. This can be detected by noting a discontinuity
in the event IDs.
.sp
If no new events are produced since \fB<lastSeenID>\fP, the HTTP call blocks and
waits for new events to happen before returning. If \fB<lastSeenID>\fP is a
future ID, the HTTP call blocks until such ID is reached or timeouts. By
default it times out after 60 seconds returning an empty array. The time out
duration can be customized with the optional parameter \fBtimeout=<seconds>\fP\&.
.sp
To receive only a limited number of events, add the \fBlimit=<n>\fP parameter with a
suitable value for \fBn\fP and only the \fIlast\fP \fBn\fP events will be returned. This
can be used to catch up with the latest event ID after a disconnection for
example: \fB/rest/events?since=0&limit=1\fP\&.
.SS GET /rest/events/disk
.sp
This convenience endpoint provides the same event stream, but pre\-filtered to show
only \fI\%LocalChangeDetected\fP and \fI\%RemoteChangeDetected\fP
event types.  The \fBevents\fP parameter is not used.
.SH STATISTICS ENDPOINTS
.SS GET /rest/stats/device
.sp
Returns general statistics about devices. Currently, only contains the
time the device was last seen and the last connection duration.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ curl \-s http://localhost:8384/rest/stats/device | json
{
  \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq: {
    \(dqlastSeen\(dq : \(dq2015\-04\-18T11:21:31.3256277+01:00\(dq
    \(dqlastConnectionDurationS\(dq: 556335.421708141
  }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/stats/folder
.sp
Returns general statistics about folders. Currently contains the
last scan time and the last synced file.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqfolderid\(dq: {
    \(dqlastScan\(dq: \(dq2016\-06\-02T13:28:01.288181412\-04:00\(dq,
    \(dqlastFile\(dq: {
      \(dqfilename\(dq: \(dqfile/name\(dq,
      \(dqat\(dq: \(dq2015\-04\-16T22:04:18.3066971+01:00\(dq
    }
  }
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SH MISC SERVICES ENDPOINTS
.SS GET /rest/svc/deviceid
.sp
Verifies and formats a device ID. Accepts all currently valid formats
(52 or 56 characters with or without separators, upper or lower case,
with trivial substitutions). Takes one parameter, \fBid\fP, and returns
either a valid device ID in modern format, or an error.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ curl \-s http://localhost:8384/rest/svc/deviceid?id=1234 | json
{
  \(dqerror\(dq: \(dqdevice ID invalid: incorrect length\(dq
}

$ curl \-s http://localhost:8384/rest/svc/deviceid?id=p56ioi7m\-\-zjnu2iq\-gdr\-eydm\-2mgtmgl3bxnpq6w5btbbz4tjxzwicq | json
{
  \(dqid\(dq: \(dqP56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2\(dq
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/svc/lang
.sp
Returns a list of canonicalized localization codes, as picked up from
the \fBAccept\-Language\fP header sent by the browser.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
[\(dqsv_sv\(dq,\(dqsv\(dq,\(dqen_us\(dq,\(dqen\(dq]
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/svc/random/string
.sp
Returns a strong random generated string (alphanumeric) of the specified length. Takes the \fBlength\fP parameter.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqrandom\(dq: \(dqFdPaEaZQ56sXEKYNxpgF\(dq
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SS GET /rest/svc/report
.sp
Returns the data sent in the anonymous usage report.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
   \(dqfolderMaxMiB\(dq : 0,
   \(dqplatform\(dq : \(dqlinux\-amd64\(dq,
   \(dqtotMiB\(dq : 0,
   \(dqlongVersion\(dq : \(dqsyncthing v0.12.2 \e\(dqBeryllium Bedbug\e\(dq (go1.4.3 linux\-amd64 default) unknown\-user@build2.syncthing.net 2015\-11\-09 13:23:26 UTC\(dq,
   \(dqupgradeAllowedManual\(dq : true,
   \(dqtotFiles\(dq : 3,
   \(dqfolderUses\(dq : {
      \(dqignorePerms\(dq : 0,
      \(dqautoNormalize\(dq : 0,
      \(dqsendonly\(dq : 0,
      \(dqignoreDelete\(dq : 0
   },
   \(dqmemoryUsageMiB\(dq : 13,
   \(dqversion\(dq : \(dqv0.12.2\(dq,
   \(dqsha256Perf\(dq : 27.28,
   \(dqnumFolders\(dq : 2,
   \(dqmemorySize\(dq : 1992,
   \(dqannounce\(dq : {
      \(dqdefaultServersIP\(dq : 0,
      \(dqotherServers\(dq : 0,
      \(dqglobalEnabled\(dq : false,
      \(dqdefaultServersDNS\(dq : 1,
      \(dqlocalEnabled\(dq : false
   },
   \(dqusesRateLimit\(dq : false,
   \(dqnumCPU\(dq : 2,
   \(dquniqueID\(dq : \(dq\(dq,
   \(dqurVersion\(dq : 2,
   \(dqrescanIntvs\(dq : [
      60,
      60
   ],
   \(dqnumDevices\(dq : 2,
   \(dqfolderMaxFiles\(dq : 3,
   \(dqrelays\(dq : {
      \(dqdefaultServers\(dq : 1,
      \(dqenabled\(dq : true,
      \(dqotherServers\(dq : 0
   },
   \(dqdeviceUses\(dq : {
      \(dqcompressMetadata\(dq : 1,
      \(dqcustomCertName\(dq : 0,
      \(dqstaticAddr\(dq : 1,
      \(dqcompressAlways\(dq : 0,
      \(dqcompressNever\(dq : 1,
      \(dqintroducer\(dq : 0,
      \(dqdynamicAddr\(dq : 1
   },
   \(dqupgradeAllowedAuto\(dq : false
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SH DEBUG ENDPOINTS
.SS Debug Endpoints
.sp
These endpoints require the \fI\%gui.debugging\fP configuration option to
be enabled and yield an access denied error code otherwise.
.SS GET /rest/debug/peerCompletion
.sp
Summarizes the completion percentage for each remote device.  Returns an object
with device IDs as keys and an integer percentage as values.
.SS GET /rest/debug/httpmetrics
.sp
Returns statistics about each served REST API endpoint, to diagnose how much
time was spent generating the responses.
.SS GET /rest/debug/cpuprof
.sp
Used to capture a profile of what Syncthing is doing on the CPU.  See
\fI\%Profiling\fP\&.
.SS GET /rest/debug/heapprof
.sp
Used to capture a profile of what Syncthing is doing with the heap memory.  See
\fI\%Profiling\fP\&.
.SS GET /rest/debug/support
.sp
Collects information about the running instance for troubleshooting purposes.
Returns a “support bundle” as a zipped archive, which should be sent to the
developers after verifying it contains no sensitive personal information.
Credentials for the web GUI and the API key are automatically redacted already.
.SS GET /rest/debug/file
.sp
Shows diagnostics about a certain file in a shared folder.  Takes the \fBfolder\fP
(folder ID) and \fBfile\fP (folder relative path) parameters.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ curl \-H X\-API\-Key:... \(dqhttp://localhost:8384/rest/debug/file?folder=default&file=foo/bar\(dq
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
The returned object contains the same info as \fI\%GET /rest/db/file\fP, plus a summary
of \fBglobalVersions\fP\&.
.SH NOAUTH ENDPOINTS
.sp
Calls that do not require authentication.
.SS GET /rest/noauth/health
.sp
Returns a \fB{\(dqstatus\(dq: \(dqOK\(dq}\fP object.
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
{
  \(dqstatus\(dq: \(dqOK\(dq
}
.ft P
.fi
.UNINDENT
.UNINDENT
.SH AUTHOR
The Syncthing Authors
.SH COPYRIGHT
2014-2019, The Syncthing Authors
.\" Generated by docutils manpage writer.
.