2020-06-22 04:15:24 +00:00
. \" 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
. .
2024-10-14 03:47:49 +00:00
.TH "SYNCTHING-REST-API" "7" "Oct 10, 2024" "v1.27.11" "Syncthing"
2021-04-28 05:45:43 +00:00
.SH NAME
syncthing-rest-api \- REST API
2020-06-22 04:15:24 +00:00
.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 \fB configuration/gui/apikey\fP element in
the configuration file. To use an API key, set the request header
2023-07-31 03:45:37 +00:00
\fB X\- API\- Key\fP to the API key value, or set it as a \fB Bearer\fP token in the
2023-09-18 03:45:31 +00:00
\fB Authorization\fP header. For example, \fB curl \- X POST \- H \(dq X\- API\- Key: abc123\(dq
http://localhost:8384/rest/...\fP or \fB curl \- X POST \- H \(dq Authorization: Bearer
abc123\(dq http://localhost:8384/rest/...\fP can be used to invoke with \fB curl\fP
2023-07-31 03:45:37 +00:00
(add \fB \- k\fP flag when using HTTPS with a Syncthing generated or self signed
certificate).
2022-10-10 04:24:03 +00:00
.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.
2022-02-28 03:46:00 +00:00
.SH RESULT PAGINATION
.sp
Some \fI GET\fP endpoints take optional \fB page\fP and \fB perpage\fP arguments for
pagination. No more than \fB perpage\fP (defaults to 65536 if not given) result
entries are returned in an array. To access further entries, passing the
\fB page\fP parameter will advance in the results by that many pages. The actually
used parameters are always returned as attributes in the response object.
2020-06-22 04:15:24 +00:00
.SH SYSTEM ENDPOINTS
.SS GET /rest/system/browse
.sp
Returns a list of directories matching the path given by the optional parameter
2024-05-13 03:45:18 +00:00
\fB current\fP \& . The path can use \X 'tty: link https://pkg.go.dev/path/filepath#Match'\fI \% patterns as described in Go’ s filepath package\fP <\fB https://pkg.go.dev/path/filepath#Match\fP >\X 'tty: link'\& . A ‘ *’ will always be appended
2020-06-22 04:15:24 +00:00
to the given path (e.g. \fB /tmp/\fP matches all its subdirectories). If the option
\fB current\fP is not given, filesystem root paths are returned.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2023-09-18 03:45:31 +00:00
$ curl \- H \(dq X\- API\- Key: yourkey\(dq localhost:8384/rest/system/browse | json_pp
2020-06-22 04:15:24 +00:00
[
2023-09-18 03:45:31 +00:00
\(dq /\(dq
2020-06-22 04:15:24 +00:00
]
2023-09-18 03:45:31 +00:00
$ curl \- H \(dq X\- API\- Key: yourkey\(dq localhost:8384/rest/system/browse?current=/var/ | json_pp
2020-06-22 04:15:24 +00:00
[
2023-09-18 03:45:31 +00:00
\(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
2020-06-22 04:15:24 +00:00
]
2023-09-18 03:45:31 +00:00
$ curl \- H \(dq X\- API\- Key: yourkey\(dq localhost:8384/rest/system/browse?current=/var/*o | json_pp
2020-06-22 04:15:24 +00:00
[
2023-09-18 03:45:31 +00:00
\(dq /var/local/\(dq ,
\(dq /var/lock/\(dq ,
\(dq /var/log/\(dq ,
\(dq /var/opt/\(dq ,
\(dq /var/spool/\(dq
2020-06-22 04:15:24 +00:00
]
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
2022-03-14 03:47:23 +00:00
.SS GET /rest/system/config (DEPRECATED)
2020-10-28 06:45:27 +00:00
.sp
2024-07-22 03:45:28 +00:00
Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use \fI \% /rest/config\fP
2020-10-28 06:45:27 +00:00
instead.
2020-06-22 04:15:24 +00:00
.sp
Returns the current configuration.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq version\(dq : 35,
\(dq folders\(dq : [
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq id\(dq : \(dq default\(dq ,
\(dq label\(dq : \(dq Default Folder\(dq ,
\(dq filesystemType\(dq : \(dq basic\(dq ,
\(dq path\(dq : \(dq ...\(dq ,
\(dq type\(dq : \(dq sendreceive\(dq ,
\(dq devices\(dq : [
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq deviceID\(dq : \(dq ...\(dq ,
\(dq introducedBy\(dq : \(dq \(dq ,
\(dq encryptionPassword\(dq : \(dq \(dq
2020-06-22 04:15:24 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq rescanIntervalS\(dq : 3600,
\(dq fsWatcherEnabled\(dq : true,
\(dq fsWatcherDelayS\(dq : 10,
\(dq ignorePerms\(dq : false,
\(dq autoNormalize\(dq : true,
\(dq minDiskFree\(dq : {
\(dq value\(dq : 1,
\(dq unit\(dq : \(dq %\(dq
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq versioning\(dq : {
\(dq type\(dq : \(dq \(dq ,
\(dq params\(dq : {},
\(dq cleanupIntervalS\(dq : 3600,
\(dq fsPath\(dq : \(dq \(dq ,
\(dq fsType\(dq : \(dq basic\(dq
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq copiers\(dq : 0,
\(dq pullerMaxPendingKiB\(dq : 0,
\(dq hashers\(dq : 0,
\(dq order\(dq : \(dq random\(dq ,
\(dq ignoreDelete\(dq : false,
\(dq scanProgressIntervalS\(dq : 0,
\(dq pullerPauseS\(dq : 0,
\(dq maxConflicts\(dq : \- 1,
\(dq disableSparseFiles\(dq : false,
\(dq disableTempIndexes\(dq : false,
\(dq paused\(dq : false,
\(dq weakHashThresholdPct\(dq : 25,
\(dq markerName\(dq : \(dq .stfolder\(dq ,
\(dq copyOwnershipFromParent\(dq : false,
\(dq modTimeWindowS\(dq : 0,
\(dq maxConcurrentWrites\(dq : 2,
\(dq disableFsync\(dq : false,
\(dq blockPullOrder\(dq : \(dq standard\(dq ,
\(dq copyRangeMethod\(dq : \(dq standard\(dq ,
\(dq caseSensitiveFS\(dq : false,
\(dq junctionsAsDirs\(dq : true
2020-06-22 04:15:24 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq devices\(dq : [
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq deviceID\(dq : \(dq ...\(dq ,
\(dq name\(dq : \(dq Laptop\(dq ,
\(dq addresses\(dq : [
\(dq dynamic\(dq ,
\(dq tcp://192.168.1.2:22000\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq compression\(dq : \(dq metadata\(dq ,
\(dq certName\(dq : \(dq \(dq ,
\(dq introducer\(dq : false,
\(dq skipIntroductionRemovals\(dq : false,
\(dq introducedBy\(dq : \(dq \(dq ,
\(dq paused\(dq : false,
\(dq allowedNetworks\(dq : [],
\(dq autoAcceptFolders\(dq : false,
\(dq maxSendKbps\(dq : 0,
\(dq maxRecvKbps\(dq : 0,
\(dq ignoredFolders\(dq : [
2022-01-10 13:48:17 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq time\(dq : \(dq 2022\- 01\- 09T19:09:52Z\(dq ,
\(dq id\(dq : \(dq br63e\- wyhb7\(dq ,
\(dq label\(dq : \(dq Foo\(dq
2022-01-10 13:48:17 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq maxRequestKiB\(dq : 0,
\(dq untrusted\(dq : false,
\(dq remoteGUIPort\(dq : 0
2020-06-22 04:15:24 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq gui\(dq : {
\(dq enabled\(dq : true,
\(dq address\(dq : \(dq 127.0.0.1:8384\(dq ,
\(dq unixSocketPermissions\(dq : \(dq \(dq ,
\(dq user\(dq : \(dq Username\(dq ,
\(dq password\(dq : \(dq $2a$10$ZFws69T4FlvWwsqeIwL.TOo5zOYqsa/.TxlUnsGYS.j3JvjFTmxo6\(dq ,
\(dq authMode\(dq : \(dq static\(dq ,
\(dq useTLS\(dq : false,
\(dq apiKey\(dq : \(dq k1dnz1Dd0rzTBjjFFh7CXPnrF12C49B1\(dq ,
\(dq insecureAdminAccess\(dq : false,
\(dq theme\(dq : \(dq default\(dq ,
\(dq debugging\(dq : false,
\(dq insecureSkipHostcheck\(dq : false,
\(dq insecureAllowFrameLoading\(dq : false
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq ldap\(dq : {
\(dq address\(dq : \(dq \(dq ,
\(dq bindDN\(dq : \(dq \(dq ,
\(dq transport\(dq : \(dq plain\(dq ,
\(dq insecureSkipVerify\(dq : false,
\(dq searchBaseDN\(dq : \(dq \(dq ,
\(dq searchFilter\(dq : \(dq \(dq
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq options\(dq : {
\(dq listenAddresses\(dq : [
\(dq default\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq globalAnnounceServers\(dq : [
\(dq default\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq globalAnnounceEnabled\(dq : true,
\(dq localAnnounceEnabled\(dq : true,
\(dq localAnnouncePort\(dq : 21027,
\(dq localAnnounceMCAddr\(dq : \(dq [ff12::8384]:21027\(dq ,
\(dq maxSendKbps\(dq : 0,
\(dq maxRecvKbps\(dq : 0,
\(dq reconnectionIntervalS\(dq : 60,
\(dq relaysEnabled\(dq : true,
\(dq relayReconnectIntervalM\(dq : 10,
\(dq startBrowser\(dq : true,
\(dq natEnabled\(dq : true,
\(dq natLeaseMinutes\(dq : 60,
\(dq natRenewalMinutes\(dq : 30,
\(dq natTimeoutSeconds\(dq : 10,
\(dq urAccepted\(dq : 0,
\(dq urSeen\(dq : 0,
\(dq urUniqueId\(dq : \(dq ...\(dq ,
\(dq urURL\(dq : \(dq https://data.syncthing.net/newdata\(dq ,
\(dq urPostInsecurely\(dq : false,
\(dq urInitialDelayS\(dq : 1800,
\(dq autoUpgradeIntervalH\(dq : 12,
\(dq upgradeToPreReleases\(dq : false,
\(dq keepTemporariesH\(dq : 24,
\(dq cacheIgnoredFiles\(dq : false,
\(dq progressUpdateIntervalS\(dq : 5,
\(dq limitBandwidthInLan\(dq : false,
\(dq minHomeDiskFree\(dq : {
\(dq value\(dq : 1,
\(dq unit\(dq : \(dq %\(dq
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq releasesURL\(dq : \(dq https://upgrades.syncthing.net/meta.json\(dq ,
\(dq alwaysLocalNets\(dq : [],
\(dq overwriteRemoteDeviceNamesOnConnect\(dq : false,
\(dq tempIndexMinBlocks\(dq : 10,
\(dq unackedNotificationIDs\(dq : [
\(dq authenticationUserAndPassword\(dq
2022-01-10 13:48:17 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq trafficClass\(dq : 0,
\(dq setLowPriority\(dq : true,
\(dq maxFolderConcurrency\(dq : 0,
\(dq crURL\(dq : \(dq https://crash.syncthing.net/newcrash\(dq ,
\(dq crashReportingEnabled\(dq : true,
\(dq stunKeepaliveStartS\(dq : 180,
\(dq stunKeepaliveMinS\(dq : 20,
\(dq stunServers\(dq : [
\(dq default\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq databaseTuning\(dq : \(dq auto\(dq ,
\(dq maxConcurrentIncomingRequestKiB\(dq : 0,
\(dq announceLANAddresses\(dq : true,
\(dq sendFullIndexOnUpgrade\(dq : false,
\(dq featureFlags\(dq : [],
\(dq connectionLimitEnough\(dq : 0,
\(dq connectionLimitMax\(dq : 0,
\(dq insecureAllowOldTLSVersions\(dq : false
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq remoteIgnoredDevices\(dq : [
2022-01-10 13:48:17 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq time\(dq : \(dq 2022\- 01\- 09T20:02:01Z\(dq ,
\(dq deviceID\(dq : \(dq ...\(dq ,
\(dq name\(dq : \(dq ...\(dq ,
\(dq address\(dq : \(dq 192.168.0.20:22000\(dq
2022-01-10 13:48:17 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq defaults\(dq : {
\(dq folder\(dq : {
\(dq id\(dq : \(dq \(dq ,
\(dq label\(dq : \(dq \(dq ,
\(dq filesystemType\(dq : \(dq basic\(dq ,
\(dq path\(dq : \(dq ~\(dq ,
\(dq type\(dq : \(dq sendreceive\(dq ,
\(dq devices\(dq : [
2022-01-10 13:48:17 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq deviceID\(dq : \(dq ...\(dq ,
\(dq introducedBy\(dq : \(dq \(dq ,
\(dq encryptionPassword\(dq : \(dq \(dq
2022-01-10 13:48:17 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq rescanIntervalS\(dq : 3600,
\(dq fsWatcherEnabled\(dq : true,
\(dq fsWatcherDelayS\(dq : 10,
\(dq ignorePerms\(dq : false,
\(dq autoNormalize\(dq : true,
\(dq minDiskFree\(dq : {
\(dq value\(dq : 1,
\(dq unit\(dq : \(dq %\(dq
2022-01-10 13:48:17 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq versioning\(dq : {
\(dq type\(dq : \(dq \(dq ,
\(dq params\(dq : {},
\(dq cleanupIntervalS\(dq : 3600,
\(dq fsPath\(dq : \(dq \(dq ,
\(dq fsType\(dq : \(dq basic\(dq
2022-01-10 13:48:17 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq copiers\(dq : 0,
\(dq pullerMaxPendingKiB\(dq : 0,
\(dq hashers\(dq : 0,
\(dq order\(dq : \(dq random\(dq ,
\(dq ignoreDelete\(dq : false,
\(dq scanProgressIntervalS\(dq : 0,
\(dq pullerPauseS\(dq : 0,
\(dq maxConflicts\(dq : 10,
\(dq disableSparseFiles\(dq : false,
\(dq disableTempIndexes\(dq : false,
\(dq paused\(dq : false,
\(dq weakHashThresholdPct\(dq : 25,
\(dq markerName\(dq : \(dq .stfolder\(dq ,
\(dq copyOwnershipFromParent\(dq : false,
\(dq modTimeWindowS\(dq : 0,
\(dq maxConcurrentWrites\(dq : 2,
\(dq disableFsync\(dq : false,
\(dq blockPullOrder\(dq : \(dq standard\(dq ,
\(dq copyRangeMethod\(dq : \(dq standard\(dq ,
\(dq caseSensitiveFS\(dq : false,
\(dq junctionsAsDirs\(dq : false
2022-01-10 13:48:17 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq device\(dq : {
\(dq deviceID\(dq : \(dq \(dq ,
\(dq name\(dq : \(dq \(dq ,
\(dq addresses\(dq : [
\(dq dynamic\(dq
2022-01-10 13:48:17 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq compression\(dq : \(dq metadata\(dq ,
\(dq certName\(dq : \(dq \(dq ,
\(dq introducer\(dq : false,
\(dq skipIntroductionRemovals\(dq : false,
\(dq introducedBy\(dq : \(dq \(dq ,
\(dq paused\(dq : false,
\(dq allowedNetworks\(dq : [],
\(dq autoAcceptFolders\(dq : false,
\(dq maxSendKbps\(dq : 0,
\(dq maxRecvKbps\(dq : 0,
\(dq ignoredFolders\(dq : [],
\(dq maxRequestKiB\(dq : 0,
\(dq untrusted\(dq : false,
\(dq remoteGUIPort\(dq : 0
2022-01-10 13:48:17 +00:00
}
}
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
2022-03-14 03:47:23 +00:00
.SS GET /rest/system/config/insync (DEPRECATED)
2020-10-28 06:45:27 +00:00
.sp
Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use
2024-07-22 03:45:28 +00:00
\fI \% /rest/config/restart\- required\fP instead.
2020-10-28 06:45:27 +00:00
2020-06-22 04:15:24 +00:00
.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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq configInSync\(dq : true
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
2022-03-14 03:47:23 +00:00
.SS POST /rest/system/config (DEPRECATED)
2020-10-28 06:45:27 +00:00
.sp
2023-09-18 03:45:31 +00:00
Deprecated since version v1.12.0: This endpoint still works as before but is deprecated. Use \fI \% Config Endpoints\fP
2020-10-28 06:45:27 +00:00
instead.
2020-06-22 04:15:24 +00:00
.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
2024-07-22 03:45:28 +00:00
\fI \% /rest/config/restart\- required\fP to check if a restart is required.
2020-06-22 04:15:24 +00:00
.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
\fB NOTE:\fP
.INDENT 0 .0
.INDENT 3 .5
2022-12-12 03:48:00 +00:00
Return format changed in versions 0.13.0, 1.19.0 and 1.23.0.
2020-06-22 04:15:24 +00:00
.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 \fB TCP (Client)\fP , \fB TCP (Server)\fP , \fB Relay (Client)\fP and \fB Relay (Server)\fP \& .
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq connections\(dq : {
\(dq DOVII4U\- SQEEESM\- VZ2CVTC\- CJM4YN5\- QNV7DCU\- 5U3ASRL\- YVFG6TH\- W5DV5AA\(dq : {
\(dq address\(dq : \(dq \(dq ,
\(dq at\(dq : \(dq 0001\- 01\- 01T00:00:00Z\(dq ,
\(dq clientVersion\(dq : \(dq \(dq ,
\(dq connected\(dq : false,
\(dq inBytesTotal\(dq : 0,
\(dq isLocal\(dq : false,
\(dq outBytesTotal\(dq : 0,
\(dq paused\(dq : false,
\(dq startedAt\(dq : \(dq 0001\- 01\- 01T00:00:00Z\(dq ,
\(dq type\(dq : \(dq \(dq
2022-12-12 03:48:00 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq UYGDMA4\- TPHOFO5\- 2VQYDCC\- 7CWX7XW\- INZINQT\- LE4B42N\- 4JUZTSM\- IWCSXA4\(dq : {
\(dq address\(dq : \(dq \(dq ,
\(dq at\(dq : \(dq 0001\- 01\- 01T00:00:00Z\(dq ,
\(dq clientVersion\(dq : \(dq \(dq ,
\(dq connected\(dq : false,
\(dq inBytesTotal\(dq : 0,
\(dq isLocal\(dq : false,
\(dq outBytesTotal\(dq : 0,
\(dq paused\(dq : false,
\(dq startedAt\(dq : \(dq 0001\- 01\- 01T00:00:00Z\(dq ,
\(dq type\(dq : \(dq \(dq
2022-12-12 03:48:00 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq YZJBJFX\- RDBL7WY\- 6ZGKJ2D\- 4MJB4E7\- ZATSDUY\- LD6Y3L3\- MLFUYWE\- AEMXJAC\(dq : {
\(dq address\(dq : \(dq 127.0.0.1:22002\(dq ,
\(dq at\(dq : \(dq 2015\- 11\- 07T17:29:47.691548971+01:00\(dq ,
\(dq clientVersion\(dq : \(dq v0.12.1\(dq ,
\(dq connected\(dq : true,
\(dq inBytesTotal\(dq : 556,
\(dq isLocal\(dq : true,
\(dq outBytesTotal\(dq : 550,
\(dq paused\(dq : false,
\(dq startedAt\(dq : \(dq 2015\- 11\- 07T00:09:47Z\(dq ,
\(dq type\(dq : \(dq TCP (Client)\(dq
2022-12-12 03:48:00 +00:00
}
},
2023-09-18 03:45:31 +00:00
\(dq total\(dq : {
\(dq at\(dq : \(dq 2015\- 11\- 07T17:29:47.691637262+01:00\(dq ,
\(dq inBytesTotal\(dq : 1479,
\(dq outBytesTotal\(dq : 1318
2022-12-12 03:48:00 +00:00
}
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS GET /rest/system/debug
.sp
2024-05-13 03:45:18 +00:00
Added in version 0.12.0.
2020-06-22 04:15:24 +00:00
.sp
Returns the set of debug facilities and which of them are currently enabled.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq enabled\(dq : [
\(dq beacon\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq facilities\(dq : {
\(dq beacon\(dq : \(dq Multicast and broadcast discovery\(dq ,
\(dq config\(dq : \(dq Configuration loading and saving\(dq ,
\(dq connections\(dq : \(dq Connection handling\(dq ,
\(dq db\(dq : \(dq The database layer\(dq ,
\(dq dialer\(dq : \(dq Dialing connections\(dq ,
\(dq discover\(dq : \(dq Remote device discovery\(dq ,
\(dq events\(dq : \(dq Event generation and logging\(dq ,
\(dq http\(dq : \(dq REST API\(dq ,
\(dq main\(dq : \(dq Main package\(dq ,
\(dq model\(dq : \(dq The root hub\(dq ,
\(dq protocol\(dq : \(dq The BEP protocol\(dq ,
\(dq relay\(dq : \(dq Relay connection handling\(dq ,
\(dq scanner\(dq : \(dq File change detection and hashing\(dq ,
\(dq stats\(dq : \(dq Persistent device and folder statistics\(dq ,
\(dq sync\(dq : \(dq Mutexes\(dq ,
\(dq upgrade\(dq : \(dq Binary upgrades\(dq ,
\(dq upnp\(dq : \(dq UPnP discovery and port mapping\(dq ,
\(dq versioner\(dq : \(dq File versioning\(dq
2020-06-22 04:15:24 +00:00
}
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS POST /rest/system/debug
.sp
2024-05-13 03:45:18 +00:00
Added in version 0.12.0.
2020-06-22 04:15:24 +00:00
.sp
Enables or disables debugging for specified facilities. Give one or both of
\fB enable\fP and \fB disable\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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
$ curl \- H X\- API\- Key:abc123 \- X POST \(aq http://localhost:8384/rest/system/debug?disable=beacon,discovery&enable=config,db\(aq
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS GET /rest/system/discovery
.sp
Returns the contents of the local discovery cache.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\(dq : [
\(dq 192.162.129.11:22000\(dq
2020-06-22 04:15:24 +00:00
]
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS POST /rest/system/discovery
.sp
\fB NOTE:\fP
.INDENT 0 .0
.INDENT 3 .5
Removed in v0.12.0.
.UNINDENT
.UNINDENT
.sp
Post with the query parameters \fB device\fP and \fB addr\fP to add entries to
the discovery cache.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
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:
2023-09-18 03:45:31 +00:00
curl \- X POST \- \- header \(dq X\- API\- Key: TcE28kVPdtJ8COws1JdM0b2nodj77WeQ\(dq http://127.0.0.1:8384/rest/system/discovery?device=LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q\e &addr=192.162.129.11:22000
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.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
\fB NOTE:\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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq errors\(dq : [
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq when\(dq : \(dq 2014\- 09\- 18T12:59:26.549953186+02:00\(dq ,
\(dq message\(dq : \(dq This is an error string\(dq
2020-06-22 04:15:24 +00:00
}
]
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.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
2024-05-13 03:45:18 +00:00
Added in version 0.12.0.
2020-06-22 04:15:24 +00:00
.sp
2022-02-28 03:46:00 +00:00
Returns the list of recent log entries. The optional \fB since\fP parameter limits
2024-05-13 03:45:18 +00:00
the results to message newer than the given timestamp in \X 'tty: link https://datatracker.ietf.org/doc/html/rfc3339.html'\fI \% RFC 3339\fP <\fB https://datatracker.ietf.org/doc/html/rfc3339.html\fP >\X 'tty: link' format.
2020-06-22 04:15:24 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq messages\(dq : [
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq when\(dq : \(dq 2014\- 09\- 18T12:59:26.549953186+02:00\(dq ,
\(dq message\(dq : \(dq This is a log entry\(dq
2020-06-22 04:15:24 +00:00
}
]
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
2022-02-28 03:46:00 +00:00
.SS GET /rest/system/log.txt
.sp
Returns the same information, formatted as a text log instead of a JSON object.
2022-08-15 04:09:30 +00:00
.SS GET /rest/system/paths
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.21.0.
2022-08-15 04:09:30 +00:00
.sp
Returns the path locations used internally for storing configuration, database,
and others.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2022-08-15 04:09:30 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq auditLog\(dq : \(dq /home/user/.local/share/syncthing/audit\- ${timestamp}.log\(dq ,
\(dq baseDir\- config\(dq : \(dq /home/user/.config/syncthing\(dq ,
\(dq baseDir\- data\(dq : \(dq /home/user/.local/share/syncthing\(dq ,
\(dq baseDir\- userHome\(dq : \(dq /home/user\(dq ,
\(dq certFile\(dq : \(dq /home/user/.config/syncthing/cert.pem\(dq ,
\(dq config\(dq : \(dq /home/user/.config/syncthing/config.xml\(dq ,
\(dq csrfTokens\(dq : \(dq /home/user/.config/syncthing/csrftokens.txt\(dq ,
\(dq database\(dq : \(dq /home/user/.local/share/syncthing/index\- v0.14.0.db\(dq ,
\(dq defFolder\(dq : \(dq /home/user/Sync\(dq ,
\(dq guiAssets\(dq : \(dq /home/user/src/syncthing/gui\(dq ,
\(dq httpsCertFile\(dq : \(dq /home/user/.config/syncthing/https\- cert.pem\(dq ,
\(dq httpsKeyFile\(dq : \(dq /home/user/.config/syncthing/https\- key.pem\(dq ,
\(dq keyFile\(dq : \(dq /home/user/.config/syncthing/key.pem\(dq ,
\(dq logFile\(dq : \(dq \- \(dq ,
\(dq panicLog\(dq : \(dq /home/user/.local/share/syncthing/panic\- ${timestamp}.log\(dq
2022-08-15 04:09:30 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2022-08-15 04:09:30 +00:00
.UNINDENT
.UNINDENT
2020-06-22 04:15:24 +00:00
.SS POST /rest/system/pause
.sp
Pause the given device or all devices.
.sp
Takes the optional parameter \fB device\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
2023-09-18 03:45:31 +00:00
Returns a \fB {\(dq ping\(dq : \(dq pong\(dq }\fP object.
2020-06-22 04:15:24 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq ping\(dq : \(dq pong\(dq
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS POST /rest/system/ping
.sp
2023-09-18 03:45:31 +00:00
Returns a \fB {\(dq ping\(dq : \(dq pong\(dq }\fP object.
2020-06-22 04:15:24 +00:00
.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 \fB folder\fP parameter with a valid folder ID, only
information for that folder will be erased:
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2023-09-18 03:45:31 +00:00
curl \- X POST \- H \(dq X\- API\- Key: abc123\(dq http://localhost:8384/rest/system/reset?folder=ab1c2\- def3g
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.sp
2024-07-22 03:45:28 +00:00
\fB Caution\fP : See \fI \% \- \- reset\- database\fP for \fB \& .stfolder\fP creation
2022-02-28 03:46:00 +00:00
side\- effect and caution regarding mountpoints.
2020-06-22 04:15:24 +00:00
.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 \fB device\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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq alloc\(dq : 30618136,
\(dq connectionServiceStatus\(dq : {
\(dq dynamic+https://relays.syncthing.net/endpoint\(dq : {
\(dq error\(dq : null,
\(dq lanAddresses\(dq : [
\(dq 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\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq wanAddresses\(dq : [
\(dq 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\(dq
2020-06-22 04:15:24 +00:00
]
},
2023-09-18 03:45:31 +00:00
\(dq tcp://0.0.0.0:22000\(dq : {
\(dq error\(dq : null,
\(dq lanAddresses\(dq : [
\(dq tcp://0.0.0.0:22000\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq wanAddresses\(dq : [
\(dq tcp://0.0.0.0:22000\(dq
2020-06-22 04:15:24 +00:00
]
}
},
2023-09-18 03:45:31 +00:00
\(dq cpuPercent\(dq : 0,
\(dq discoveryEnabled\(dq : true,
\(dq discoveryErrors\(dq : {
\(dq global@https://discovery\- v4\- 1.syncthing.net/v2/\(dq : \(dq 500 Internal Server Error\(dq ,
\(dq global@https://discovery\- v4\- 2.syncthing.net/v2/\(dq : \(dq Post https://discovery\- v4\- 2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq ,
\(dq global@https://discovery\- v4\- 3.syncthing.net/v2/\(dq : \(dq Post https://discovery\- v4\- 3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq ,
\(dq global@https://discovery\- v6\- 1.syncthing.net/v2/\(dq : \(dq Post https://discovery\- v6\- 1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host\(dq ,
\(dq global@https://discovery\- v6\- 2.syncthing.net/v2/\(dq : \(dq Post https://discovery\- v6\- 2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host\(dq ,
\(dq global@https://discovery\- v6\- 3.syncthing.net/v2/\(dq : \(dq Post https://discovery\- v6\- 3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host\(dq
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq discoveryStatus\(dq : {
\(dq IPv4 local\(dq : {
\(dq error\(dq : null
2021-06-16 05:45:27 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq IPv6 local\(dq : {
\(dq error\(dq : null
2021-06-16 05:45:27 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq global@https://discovery\- v4\- 1.syncthing.net/v2/\(dq : {
\(dq error\(dq : \(dq 500 Internal Server Error\(dq
2021-06-16 05:45:27 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq global@https://discovery\- v4\- 2.syncthing.net/v2/\(dq : {
\(dq error\(dq : \(dq Post https://discovery\- v4\- 2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq
2021-06-16 05:45:27 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq global@https://discovery\- v4\- 3.syncthing.net/v2/\(dq : {
\(dq error\(dq : \(dq Post https://discovery\- v4\- 3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)\(dq
2021-06-16 05:45:27 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq global@https://discovery\- v6\- 1.syncthing.net/v2/\(dq : {
\(dq error\(dq : \(dq Post https://discovery\- v6\- 1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host\(dq
2021-06-16 05:45:27 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq global@https://discovery\- v6\- 2.syncthing.net/v2/\(dq : {
\(dq error\(dq : \(dq Post https://discovery\- v6\- 2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host\(dq
2021-06-16 05:45:27 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq global@https://discovery\- v6\- 3.syncthing.net/v2/\(dq : {
\(dq error\(dq : \(dq Post https://discovery\- v6\- 3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host\(dq
2021-06-16 05:45:27 +00:00
}
},
2023-09-18 03:45:31 +00:00
\(dq discoveryMethods\(dq : 8,
\(dq goroutines\(dq : 49,
\(dq lastDialStatus\(dq : {
\(dq tcp://10.20.30.40\(dq : {
\(dq when\(dq : \(dq 2019\- 05\- 16T07:41:23Z\(dq ,
\(dq error\(dq : \(dq dial tcp 10.20.30.40:22000: i/o timeout\(dq
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq tcp://172.16.33.3:22000\(dq : {
\(dq when\(dq : \(dq 2019\- 05\- 16T07:40:43Z\(dq ,
\(dq ok\(dq : true
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq tcp://83.233.120.221:22000\(dq : {
\(dq when\(dq : \(dq 2019\- 05\- 16T07:41:13Z\(dq ,
\(dq error\(dq : \(dq dial tcp 83.233.120.221:22000: connect: connection refused\(dq
2020-06-22 04:15:24 +00:00
}
},
2023-09-18 03:45:31 +00:00
\(dq myID\(dq : \(dq P56IOI7\- MZJNU2Y\- IQGDREY\- DM2MGTI\- MGL3BXN\- PQ6W5BM\- TBBZ4TJ\- XZWICQ2\(dq ,
\(dq pathSeparator\(dq : \(dq /\(dq ,
\(dq startTime\(dq : \(dq 2016\- 06\- 06T19:41:43.039284753+02:00\(dq ,
\(dq sys\(dq : 42092792,
\(dq themes\(dq : [
\(dq default\(dq ,
\(dq dark\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq tilde\(dq : \(dq /Users/jb\(dq ,
\(dq uptime\(dq : 2635
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.2.0: The \fB lastDialStatus\fP dictionary contains the last error (or \fB null\fP for
2020-06-22 04:15:24 +00:00
success) for each peer address that Syncthing has attempted to contact.
2023-09-18 03:45:31 +00:00
The \fB connectionServiceStatus\fP entries gained \fB \(dq error\(dq : null\fP
2020-06-22 04:15:24 +00:00
attributes where previously there would be no \fB error\fP attribute at all
in the success case.
2021-06-16 05:45:27 +00:00
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.18.0: The \fB discoveryStatus\fP dictionary lists all configured discovery methods, not
2021-06-16 05:45:27 +00:00
only failed ones like the now deprecated \fB discoveryErrors\fP \& . Each entry is
an object itself (for consistency with other fields), where a \fB null\fP value
for the \fB error\fP attribute means the method is running successfully. This
effectively deprecates the \fB discoveryMethods\fP attribute as well, which now
always matches the number of entries in \fB discoveryStatus\fP \& .
2020-06-22 04:15:24 +00:00
.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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq latest\(dq : \(dq v0.14.47\(dq ,
\(dq majorNewer\(dq : false,
\(dq newer\(dq : true,
\(dq running\(dq : \(dq v0.14.46\(dq
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq arch\(dq : \(dq amd64\(dq ,
\(dq longVersion\(dq : \(dq syncthing v0.10.27+3\- gea8c3de (go1.4 darwin\- amd64 default) jb@syno 2015\- 03\- 16 11:01:29 UTC\(dq ,
\(dq os\(dq : \(dq darwin\(dq ,
\(dq version\(dq : \(dq v0.10.27+3\- gea8c3de\(dq
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
2020-10-28 06:45:27 +00:00
.SH CONFIG ENDPOINTS
.SS Config Endpoints
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.12.0.
2020-10-28 06:45:27 +00:00
.sp
2023-09-18 03:45:31 +00:00
These endpoints facilitate access and modification of the \fI \% configuration\fP in a granular way. Config sent to the endpoints must be in the
2022-02-28 03:46:00 +00:00
same format as returned by the corresponding GET request. When posting the
2020-10-28 06:45:27 +00:00
configuration succeeds, the posted configuration is immediately applied, except
2021-06-02 05:45:38 +00:00
for changes that require a restart. Query \fI \% /rest/config/restart\- required\fP to check if
2020-10-28 06:45:27 +00:00
a restart is required.
.sp
For all endpoints supporting \fB PATCH\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
2021-03-31 05:45:27 +00:00
\fB RawListenAddresses\fP in options, which is an array of strings, sending
2023-09-18 03:45:31 +00:00
\fB {RawListenAddresses: [\(dq tcp://10.0.0.2\(dq ]}\fP will replace all existing listen
2020-10-28 06:45:27 +00:00
addresses.
.SS /rest/config
.sp
\fB GET\fP returns the entire config and \fB PUT\fP replaces it.
2021-06-02 05:45:38 +00:00
.SS /rest/config/restart\-required
2020-10-28 06:45:27 +00:00
.sp
2021-06-02 05:45:38 +00:00
\fB GET\fP returns whether a restart of Syncthing is required for the current
config to take effect.
2020-10-28 06:45:27 +00:00
.SS /rest/config/folders, /rest/config/devices
.sp
\fB GET\fP returns all folders respectively devices as an array. \fB PUT\fP takes an array and
\fB POST\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*. \fB GET\fP
2021-06-30 05:45:30 +00:00
returns the folder/device for the given ID, \fB PUT\fP replaces the entire config,
\fB PATCH\fP replaces only the given child objects and \fB DELETE\fP removes the
folder/device.
2022-02-28 03:46:00 +00:00
.SS /rest/config/defaults/folder, /rest/config/defaults/device
.sp
\fB GET\fP returns a template folder / device configuration object with all default
values, which only needs a unique ID to be applied. \fB PUT\fP replaces the
default config (omitted values are reset to the hard\- coded defaults), \fB PATCH\fP
replaces only the given child objects.
.SS /rest/config/defaults/ignores
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.19.0.
2022-02-28 03:46:00 +00:00
.sp
\fB GET\fP returns an object with a single \fB lines\fP attribute listing ignore
patterns to be used by default on folders, as an array of single\- line strings.
\fB PUT\fP replaces the default ignore patterns from an object of the same format.
2020-10-28 06:45:27 +00:00
.SS /rest/config/options, /rest/config/ldap, /rest/config/gui
.sp
\fB GET\fP returns the respective object, \fB PUT\fP replaces the entire object and
\fB PATCH\fP replaces only the given child objects.
2023-10-09 03:45:35 +00:00
.sp
\fB NOTE:\fP
.INDENT 0 .0
.INDENT 3 .5
2024-07-22 03:45:28 +00:00
The \fI \% gui.password\fP configuration option has special handling to
2023-10-09 03:45:35 +00:00
accept already hashed passwords. Any valid bcrypt hash is stored verbatim,
while a plaintext password is first hashed.
.UNINDENT
.UNINDENT
2021-01-13 06:45:46 +00:00
.SH CLUSTER ENDPOINTS
.sp
Concerns the mesh network structure.
2021-06-16 05:45:27 +00:00
.SS DELETE /rest/cluster/pending/devices
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.18.0.
2021-06-16 05:45:27 +00:00
.sp
2022-02-28 03:46:00 +00:00
Remove records about a pending remote device which tried to connect. Valid
values for the \fB device\fP parameter are those from the corresponding
2023-09-18 03:45:31 +00:00
\fI \% GET /rest/cluster/pending/devices\fP endpoint.
2021-06-16 05:45:27 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2023-09-18 03:45:31 +00:00
$ curl \- X DELETE \- H \(dq X\- API\- Key: abc123\(dq http://localhost:8384/rest/cluster/pending/devices?device=P56IOI7\- MZJNU2Y\- IQGDREY\- DM2MGTI\- MGL3BXN\- PQ6W5BM\- TBBZ4TJ\- XZWICQ2
2024-05-13 03:45:18 +00:00
.EE
2021-06-16 05:45:27 +00:00
.UNINDENT
.UNINDENT
.sp
Returns status 200 and no content upon success, or status 500 and a
2023-09-18 03:45:31 +00:00
plain text error on failure. A \fI \% PendingDevicesChanged\fP
2021-06-16 05:45:27 +00:00
event will be generated in response.
.sp
For a more permanent effect, also for future connections from the same
2023-09-18 03:45:31 +00:00
device ID, the device should be ignored in the \fI \% configuration\fP instead.
2021-01-13 06:45:46 +00:00
.SS GET /rest/cluster/pending/devices
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.13.0.
2021-01-13 06:45:46 +00:00
.sp
Lists remote devices which have tried to connect, but are not yet
configured in our instance.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2021-01-13 06:45:46 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq P56IOI7\- MZJNU2Y\- IQGDREY\- DM2MGTI\- MGL3BXN\- PQ6W5BM\- TBBZ4TJ\- XZWICQ2\(dq : {
\(dq time\(dq : \(dq 2020\- 03\- 18T11:43:07Z\(dq ,
\(dq name\(dq : \(dq Friend Joe\(dq ,
\(dq address\(dq : \(dq 192.168.1.2:22000\(dq
2021-01-13 06:45:46 +00:00
}
}
2024-05-13 03:45:18 +00:00
.EE
2021-01-13 06:45:46 +00:00
.UNINDENT
.UNINDENT
2021-06-16 05:45:27 +00:00
.SS DELETE /rest/cluster/pending/folders
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.18.0.
2021-06-16 05:45:27 +00:00
.sp
2022-02-28 03:46:00 +00:00
Remove records about a pending folder announced from a remote device. Valid
values for the \fB folder\fP and \fB device\fP parameters are those from the
2023-09-18 03:45:31 +00:00
corresponding \fI \% GET /rest/cluster/pending/folders\fP endpoint. The \fB device\fP
2022-02-28 03:46:00 +00:00
parameter is optional and affects announcements of this folder from the given
device, or from \fI any\fP device if omitted.
2021-06-16 05:45:27 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2023-09-18 03:45:31 +00:00
$ curl \- X DELETE \- H \(dq X\- API\- Key: abc123\(dq http://localhost:8384/rest/cluster/pending/folders?folder=cpkn4\- 57ysy&device=P56IOI7\- MZJNU2Y\- IQGDREY\- DM2MGTI\- MGL3BXN\- PQ6W5BM\- TBBZ4TJ\- XZWICQ2
2024-05-13 03:45:18 +00:00
.EE
2021-06-16 05:45:27 +00:00
.UNINDENT
.UNINDENT
.sp
2022-02-28 03:46:00 +00:00
Returns status 200 and no content upon success, or status 500 and a plain text
2023-09-18 03:45:31 +00:00
error on failure. A \fI \% PendingFoldersChanged\fP event will be
2022-02-28 03:46:00 +00:00
generated in response.
2021-06-16 05:45:27 +00:00
.sp
2022-02-28 03:46:00 +00:00
For a more permanent effect, also for future announcements of the same folder
2023-09-18 03:45:31 +00:00
ID, the folder should be ignored in the \fI \% configuration\fP
2022-02-28 03:46:00 +00:00
instead.
2021-01-13 06:45:46 +00:00
.SS GET /rest/cluster/pending/folders
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.13.0.
2021-01-13 06:45:46 +00:00
.sp
Lists folders which remote devices have offered to us, but are not yet
shared from our instance to them. Takes the optional \fB device\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
2024-05-13 03:45:18 +00:00
.EX
2021-01-13 06:45:46 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq cpkn4\- 57ysy\(dq : {
\(dq offeredBy\(dq : {
\(dq P56IOI7\- MZJNU2Y\- IQGDREY\- DM2MGTI\- MGL3BXN\- PQ6W5BM\- TBBZ4TJ\- XZWICQ2\(dq : {
\(dq time\(dq : \(dq 2020\- 03\- 18T11:43:07Z\(dq ,
\(dq label\(dq : \(dq Joe\(aq s folder\(dq ,
\(dq receiveEncrypted\(dq : true,
\(dq remoteEncrypted\(dq : false
2021-01-13 06:45:46 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq DOVII4U\- SQEEESM\- VZ2CVTC\- CJM4YN5\- QNV7DCU\- 5U3ASRL\- YVFG6TH\- W5DV5AA\(dq : {
\(dq time\(dq : \(dq 2020\- 03\- 01T10:12:13Z\(dq ,
\(dq label\(dq : \(dq Jane\(aq s and Joe\(aq s folder\(dq ,
\(dq receiveEncrypted\(dq : false,
\(dq remoteEncrypted\(dq : false
2021-01-13 06:45:46 +00:00
}
}
},
2023-09-18 03:45:31 +00:00
\(dq abcde\- fghij\(dq : {
\(dq offeredBy\(dq : {
\(dq P56IOI7\- MZJNU2Y\- IQGDREY\- DM2MGTI\- MGL3BXN\- PQ6W5BM\- TBBZ4TJ\- XZWICQ2\(dq : {
\(dq time\(dq : \(dq 2020\- 03\- 18T11:43:07Z\(dq ,
\(dq label\(dq : \(dq MyPics\(dq ,
\(dq receiveEncrypted\(dq : false,
\(dq remoteEncrypted\(dq : false
2021-01-13 06:45:46 +00:00
}
}
}
}
2024-05-13 03:45:18 +00:00
.EE
2021-01-13 06:45:46 +00:00
.UNINDENT
.UNINDENT
2022-02-28 03:46:00 +00:00
.SH FOLDER ENDPOINTS
.sp
Runtime state of the individual shared folders.
.SS GET /rest/folder/errors
.sp
2024-05-13 03:45:18 +00:00
Added in version 0.14.53.
2022-02-28 03:46:00 +00:00
.sp
Takes one mandatory parameter, \fB folder\fP , and returns the list of errors
encountered during scanning or pulling.
.sp
2024-07-22 03:45:28 +00:00
The results can be paginated using the \fI \% common pagination parameters\fP \& .
2022-02-28 03:46:00 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq folder\(dq : \(dq nnhic\- sxuae\(dq ,
\(dq errors\(dq : [
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq path\(dq : \(dq noperm.txt\(dq ,
\(dq error\(dq : \(dq hashing: open /path/to/folder/noperm.txt: permission denied\(dq
2022-02-28 03:46:00 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq page\(dq : 1,
\(dq perpage\(dq : 100
2022-02-28 03:46:00 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2022-02-28 03:46:00 +00:00
.UNINDENT
.UNINDENT
2022-03-14 03:47:23 +00:00
.SS GET /rest/folder/pullerrors (DEPRECATED)
2022-02-28 03:46:00 +00:00
.sp
Deprecated since version v0.14.53: This endpoint still works as before but is deprecated. Use
2023-09-18 03:45:31 +00:00
\fI \% GET /rest/folder/errors\fP instead, which returns the same information.
2022-02-28 03:46:00 +00:00
.sp
2024-05-13 03:45:18 +00:00
See \X 'tty: link https://github.com/syncthing/syncthing/commit/d510e3cca3d5caae42121fa206b3decc981ae59e'\fI \% https://github.com/syncthing/syncthing/commit/d510e3cca3d5caae42121fa206b3decc981ae59e\fP \X 'tty: link'
2022-02-28 03:46:00 +00:00
.SS GET /rest/folder/versions
.sp
2024-05-13 03:45:18 +00:00
Added in version 0.14.44.
2022-02-28 03:46:00 +00:00
.sp
Takes one mandatory parameter, \fB folder\fP , and returns the list of archived
files that could be recovered. How many versions are available depends on the
2023-09-18 03:45:31 +00:00
\fI \% File Versioning\fP configuration. Each entry specifies when the file
2022-02-28 03:46:00 +00:00
version was archived as the \fB versionTime\fP , the \fB modTime\fP when it was last
modified before being archived, and the size in bytes.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq dir1/dir2/bar\(dq : [
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq versionTime\(dq : \(dq 2022\- 02\- 06T20:44:12+01:00\(dq ,
\(dq modTime\(dq : \(dq 2021\- 01\- 14T13:21:22+01:00\(dq ,
\(dq size\(dq : 4
2022-02-28 03:46:00 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq baz\(dq : [
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq versionTime\(dq : \(dq 2022\- 02\- 06T20:44:20+01:00\(dq ,
\(dq modTime\(dq : \(dq 2021\- 01\- 14T13:23:49+01:00\(dq ,
\(dq size\(dq : 4
2022-02-28 03:46:00 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq foo\(dq : [
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq versionTime\(dq : \(dq 2022\- 02\- 06T20:55:31+01:00\(dq ,
\(dq modTime\(dq : \(dq 2022\- 02\- 06T20:44:13+01:00\(dq ,
\(dq size\(dq : 4
2022-02-28 03:46:00 +00:00
},
{
2023-09-18 03:45:31 +00:00
\(dq versionTime\(dq : \(dq 2022\- 02\- 06T20:44:20+01:00\(dq ,
\(dq modTime\(dq : \(dq 2021\- 01\- 14T13:21:16+01:00\(dq ,
\(dq size\(dq : 4
2022-02-28 03:46:00 +00:00
}
]
}
2024-05-13 03:45:18 +00:00
.EE
2022-02-28 03:46:00 +00:00
.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 \fB versionTime\fP entries in the corresponding
2023-09-18 03:45:31 +00:00
\fI \% GET /rest/folder/versions\fP response object.
2022-02-28 03:46:00 +00:00
.sp
Takes the mandatory parameter \fB folder\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
2024-05-13 03:45:18 +00:00
.EX
2022-02-28 03:46:00 +00:00
curl \- X POST \- H X\- API\- key:... http://127.0.0.1:8384/rest/folder/versions?folder=default \- d \(aq {
2023-09-18 03:45:31 +00:00
\(dq dir1/dir2/bar\(dq : \(dq 2022\- 02\- 06T20:44:12+01:00\(dq ,
\(dq baz\(dq : \(dq 2022\- 02\- 06T20:44:20+01:00\(dq
2022-02-28 03:46:00 +00:00
}\(aq
2024-05-13 03:45:18 +00:00
.EE
2022-02-28 03:46:00 +00:00
.UNINDENT
.UNINDENT
2020-06-22 04:15:24 +00:00
.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 \fB folder\fP parameter and two optional
parameters. Optional parameter \fB levels\fP defines how deep within the
tree we want to dwell down (0 based, defaults to unlimited depth)
Optional parameter \fB prefix\fP defines a prefix within the tree where to
start building the structure.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2021-02-10 06:45:27 +00:00
$ curl \- s http://localhost:8384/rest/db/browse?folder=j663y\- 3ct3e&prefix=DCIM&levels=2
[
{
2023-09-18 03:45:31 +00:00
\(dq modTime\(dq : \(dq 2020\- 10\- 02T23:48:52.076996974+02:00\(dq ,
\(dq name\(dq : \(dq 100ANDRO\(dq ,
\(dq size\(dq : 128,
\(dq type\(dq : \(dq FILE_INFO_TYPE_DIRECTORY\(dq
2021-02-10 06:45:27 +00:00
},
{
2023-09-18 03:45:31 +00:00
\(dq children\(dq : [
2021-02-10 06:45:27 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq modTime\(dq : \(dq 2020\- 12\- 16T23:31:34.5009668+01:00\(dq ,
\(dq name\(dq : \(dq IMG_20201114_124821.jpg\(dq ,
\(dq size\(dq : 10682189,
\(dq type\(dq : \(dq FILE_INFO_TYPE_FILE\(dq
2021-02-10 06:45:27 +00:00
},
{
2023-09-18 03:45:31 +00:00
\(dq modTime\(dq : \(dq 2020\- 12\- 16T23:31:35.0106367+01:00\(dq ,
\(dq name\(dq : \(dq IMG_20201213_122451.jpg\(dq ,
\(dq size\(dq : 7936351,
\(dq type\(dq : \(dq FILE_INFO_TYPE_FILE\(dq
2021-02-10 06:45:27 +00:00
},
{
2023-09-18 03:45:31 +00:00
\(dq modTime\(dq : \(dq 2020\- 12\- 13T12:25:05.017097469+01:00\(dq ,
\(dq name\(dq : \(dq IMG_20201213_122504.jpg\(dq ,
\(dq size\(dq : 8406507,
\(dq type\(dq : \(dq FILE_INFO_TYPE_FILE\(dq
2021-02-10 06:45:27 +00:00
},
{
2023-09-18 03:45:31 +00:00
\(dq modTime\(dq : \(dq 2020\- 12\- 13T12:25:06.127097469+01:00\(dq ,
\(dq name\(dq : \(dq IMG_20201213_122505.jpg\(dq ,
\(dq size\(dq : 8381931,
\(dq type\(dq : \(dq FILE_INFO_TYPE_FILE\(dq
2021-02-10 06:45:27 +00:00
},
{
2023-09-18 03:45:31 +00:00
\(dq modTime\(dq : \(dq 2020\- 12\- 13T12:53:29.707298401+01:00\(dq ,
\(dq name\(dq : \(dq IMG_20201213_125329.jpg\(dq ,
\(dq size\(dq : 4388331,
\(dq type\(dq : \(dq FILE_INFO_TYPE_FILE\(dq
2021-02-10 06:45:27 +00:00
},
],
2023-09-18 03:45:31 +00:00
\(dq modTime\(dq : \(dq 2020\- 10\- 09T13:04:42.4410738+02:00\(dq ,
\(dq name\(dq : \(dq Camera\(dq ,
\(dq size\(dq : 128,
\(dq type\(dq : \(dq FILE_INFO_TYPE_DIRECTORY\(dq
2021-02-10 06:45:27 +00:00
},
]
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.sp
\fB NOTE:\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
2020-07-08 05:45:21 +00:00
Returns the completion percentage (0 to 100) and byte / item counts. Takes
optional \fB device\fP and \fB folder\fP parameters:
.INDENT 0 .0
.IP \(bu 2
\fB folder\fP specifies the folder ID to calculate completion for. An empty
or absent \fB folder\fP parameter means all folders as an aggregate.
.IP \(bu 2
\fB device\fP specifies the device ID to calculate completion for. An empty
or absent \fB device\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 \fB abcd\- 1234\fP on device \fB I6KAH76\- ...\- 3PSROAU\fP :
2020-06-22 04:15:24 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-07-08 05:45:21 +00:00
/rest/db/completion?folder=abcd\- 1234&device=I6KAH76\- ...\- 3PSROAU
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.sp
2020-07-08 05:45:21 +00:00
Aggregated completion status for device \fB I6KAH76\- ...\- 3PSROAU\fP (all folders shared with them):
2020-06-22 04:15:24 +00:00
.INDENT 0 .0
.INDENT 3 .5
2020-07-08 05:45:21 +00:00
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-07-08 05:45:21 +00:00
/rest/db/completion?device=I6KAH76\- ...\- 3PSROAU
2024-05-13 03:45:18 +00:00
.EE
2020-07-08 05:45:21 +00:00
.UNINDENT
.UNINDENT
.sp
Completion status for folder \fB abcd\- 1234\fP on the local device:
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-07-08 05:45:21 +00:00
/rest/db/completion?folder=abcd\- 1234
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
2020-07-08 05:45:21 +00:00
.sp
Aggregated completion status for all folders on the local device:
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-07-08 05:45:21 +00:00
/rest/db/completion
2024-05-13 03:45:18 +00:00
.EE
2020-07-08 05:45:21 +00:00
.UNINDENT
.UNINDENT
.SS Example Response
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-07-08 05:45:21 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq completion\(dq : 99.9937565835,
\(dq globalBytes\(dq : 156793013575,
\(dq needBytes\(dq : 9789241,
\(dq globalItems\(dq : 7823,
\(dq needItems\(dq : 412,
\(dq needDeletes\(dq : 0,
\(dq remoteState\(dq : \(dq valid\(dq ,
\(dq sequence\(dq : 12
2020-07-08 05:45:21 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-07-08 05:45:21 +00:00
.UNINDENT
.UNINDENT
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.8.0: The ability to aggregate multiple folders by leaving out the folder ID.
2020-07-08 05:45:21 +00:00
Querying data for the local device by leaving out the device ID. Returning
the \fB globalItems\fP counter in the response.
2022-05-02 04:07:12 +00:00
.sp
2024-05-13 03:45:18 +00:00
Added in version 1.20.0: Indication whether the remote device has accepted the folder (shares it with
2022-05-02 04:07:12 +00:00
us) as well, and whether it is paused. The \fB remoteState\fP field is
meaningless for aggregated responses, \fB unknown\fP when the remote device is
not connected. Otherwise it can be either \fB paused\fP , \fB notSharing\fP , or
\fB valid\fP if the remote is sharing back.
2020-06-22 04:15:24 +00:00
.SS GET /rest/db/file
.sp
Returns most data available about a given file, including version and
2022-10-10 04:24:03 +00:00
availability. Takes \fB folder\fP and \fB file\fP parameters. \fB local\fP and
\fB global\fP refer to the current file on disk and the globally newest file,
respectively.
2020-06-22 04:15:24 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq availability\(dq : [
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq id\(dq : \(dq ITZRNXE\- YNROGBZ\- HXTH5P7\- VK5NYE5\- QHRQGE2\- 7JQ6VNJ\- KZUEDIU\- 5PPR5AM\(dq ,
\(dq fromTemporary\(dq : false
2020-06-22 04:15:24 +00:00
}
],
2023-09-18 03:45:31 +00:00
\(dq global\(dq : { /* a file entry */ },
\(dq local\(dq : { /* a file entry */ }
2022-10-10 04:24:03 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2022-10-10 04:24:03 +00:00
.UNINDENT
.UNINDENT
.sp
A file entry looks like this:
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2022-10-10 04:24:03 +00:00
{
{
2023-09-18 03:45:31 +00:00
\(dq deleted\(dq : false,
\(dq ignored\(dq : false,
\(dq inodeChange\(dq : \(dq 1970\- 01\- 01T01:00:00+01:00\(dq ,
\(dq invalid\(dq : false,
\(dq localFlags\(dq : 0,
\(dq modified\(dq : \(dq 2022\- 09\- 28T08:07:19.979723+02:00\(dq ,
\(dq modifiedBy\(dq : \(dq 523ITIE\(dq ,
\(dq mustRescan\(dq : false,
\(dq name\(dq : \(dq img\(dq ,
\(dq noPermissions\(dq : false,
\(dq numBlocks\(dq : 0,
\(dq permissions\(dq : \(dq 0755\(dq ,
\(dq platform\(dq : { /* platform specific data */ },
\(dq sequence\(dq : 914,
\(dq size\(dq : 128,
\(dq type\(dq : \(dq FILE_INFO_TYPE_DIRECTORY\(dq ,
\(dq version\(dq : [
\(dq 523ITIE:1664345275\(dq
2020-06-22 04:15:24 +00:00
]
},
2023-09-18 03:45:31 +00:00
\(dq mtime\(dq : {
\(dq err\(dq : null,
\(dq value\(dq : {
\(dq real\(dq : \(dq 0001\- 01\- 01T00:00:00Z\(dq ,
\(dq virtual\(dq : \(dq 0001\- 01\- 01T00:00:00Z\(dq
2022-10-10 04:24:03 +00:00
}
2020-06-22 04:15:24 +00:00
}
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
2022-10-10 04:24:03 +00:00
.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
2024-05-13 03:45:18 +00:00
.EX
2022-10-10 04:24:03 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq darwin\(dq : {
\(dq xattrs\(dq : [
2022-10-10 04:24:03 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq name\(dq : \(dq net.kastelo.xattrtest\(dq ,
\(dq value\(dq : \(dq aGVsbG8=\(dq
2022-10-10 04:24:03 +00:00
}
]
},
2023-09-18 03:45:31 +00:00
\(dq freebsd\(dq : null,
\(dq linux\(dq : null,
\(dq netbsd\(dq : null,
\(dq unix\(dq : {
\(dq gid\(dq : 20,
\(dq groupName\(dq : \(dq staff\(dq ,
\(dq ownerName\(dq : \(dq jb\(dq ,
\(dq uid\(dq : 501
2022-10-10 04:24:03 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq windows\(dq : null
2022-10-10 04:24:03 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2022-10-10 04:24:03 +00:00
.UNINDENT
.UNINDENT
2020-06-22 04:15:24 +00:00
.SS GET /rest/db/ignores
.sp
Takes one parameter, \fB folder\fP , and returns the content of the
\fB \& .stignore\fP as the \fB ignore\fP field. A second field, \fB expanded\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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq ignore\(dq : [
\(dq (?i)/Backups\(dq
2020-06-22 04:15:24 +00:00
],
2023-09-18 03:45:31 +00:00
\(dq expanded\(dq : [
\(dq (?i)Backups\(dq ,
\(dq (?i)Backups/**\(dq
2020-06-22 04:15:24 +00:00
]
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS POST /rest/db/ignores
.sp
2023-09-18 03:45:31 +00:00
Expects a format similar to the output of \fI \% GET /rest/db/ignores\fP call, but only
2020-06-22 04:15:24 +00:00
containing the \fB ignore\fP field (\fB expanded\fP field should be omitted).
It takes one parameter, \fB folder\fP , and either updates the content of
the \fB \& .stignore\fP echoing it back as a response, or returns an error.
2022-02-28 03:46:00 +00:00
.SS GET /rest/db/localchanged
.sp
2024-05-13 03:45:18 +00:00
Added in version 0.14.55.
2022-02-28 03:46:00 +00:00
.sp
Takes one mandatory parameter, \fB folder\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
2023-09-18 03:45:31 +00:00
\fI \% POST /rest/db/revert\fP \& .
2022-02-28 03:46:00 +00:00
.sp
2024-07-22 03:45:28 +00:00
The results can be paginated using the \fI \% common pagination parameters\fP \& .
2022-02-28 03:46:00 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq files\(dq : [
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq flags\(dq : \(dq 0755\(dq ,
\(dq sequence\(dq : 6,
\(dq modified\(dq : \(dq 2015\- 04\- 20T23:06:12+09:00\(dq ,
\(dq name\(dq : \(dq ls\(dq ,
\(dq size\(dq : 34640,
\(dq version\(dq : [
\(dq 5157751870738175669:1\(dq
2022-02-28 03:46:00 +00:00
]
}
],
2023-09-18 03:45:31 +00:00
\(dq page\(dq : 1,
\(dq perpage\(dq : 100
2022-02-28 03:46:00 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2022-02-28 03:46:00 +00:00
.UNINDENT
.UNINDENT
.sp
\fB NOTE:\fP
.INDENT 0 .0
.INDENT 3 .5
This is an expensive call, increasing CPU and RAM usage on the device.
Use sparingly.
.UNINDENT
.UNINDENT
2020-06-22 04:15:24 +00:00
.SS GET /rest/db/need
.sp
Takes one mandatory parameter, \fB folder\fP , and returns lists of files which are
needed by this device in order for it to become in sync.
.sp
2024-07-22 03:45:28 +00:00
The results can be paginated using the \fI \% common pagination parameters\fP \& . Pagination happens, across the union of all needed files,
2022-02-28 03:46:00 +00:00
that is \- across all 3 sections of the response. For example, given the current
need state is as follows:
2020-06-22 04:15:24 +00:00
.INDENT 0 .0
.IP 1 . 3
\fB progress\fP has 15 items
.IP 2 . 3
\fB queued\fP has 3 items
.IP 3 . 3
\fB rest\fP has 12 items
.UNINDENT
.sp
If you issue a query with \fB page=1\fP and \fB perpage=10\fP , only the \fB progress\fP
section in the response will have 10 items. If you issue a request query with
\fB page=2\fP and \fB perpage=10\fP , \fB progress\fP section will have the last 5 items,
\fB queued\fP section will have all 3 items, and \fB rest\fP section will have first
2 items. If you issue a query for \fB page=3\fP and \fB perpage=10\fP , you will only
have the last 10 items of the \fB rest\fP section.
.sp
2022-02-28 03:46:00 +00:00
\fB NOTE:\fP
.INDENT 0 .0
.INDENT 3 .5
Return format changed in version 0.14.43, removing the \fB total\fP count
attribute.
.UNINDENT
.UNINDENT
2020-06-22 04:15:24 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
# Files currently being downloaded
2023-09-18 03:45:31 +00:00
\(dq progress\(dq : [
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq flags\(dq : \(dq 0755\(dq ,
\(dq sequence\(dq : 6,
\(dq modified\(dq : \(dq 2015\- 04\- 20T23:06:12+09:00\(dq ,
\(dq name\(dq : \(dq ls\(dq ,
\(dq size\(dq : 34640,
\(dq version\(dq : [
\(dq 5157751870738175669:1\(dq
2020-06-22 04:15:24 +00:00
]
}
],
# Files queued to be downloaded next (as per array order)
2023-09-18 03:45:31 +00:00
\(dq queued\(dq : [
2020-06-22 04:15:24 +00:00
...
],
# 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.
2023-09-18 03:45:31 +00:00
\(dq rest\(dq : [
2020-06-22 04:15:24 +00:00
...
],
2023-09-18 03:45:31 +00:00
\(dq page\(dq : 1,
\(dq perpage\(dq : 100
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.sp
\fB NOTE:\fP
.INDENT 0 .0
.INDENT 3 .5
2022-02-28 03:46:00 +00:00
This is an expensive call, increasing CPU and RAM usage on the device.
Use sparingly.
2020-06-22 04:15:24 +00:00
.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 \fI folder\fP (folder ID).
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
curl \- X POST \- H X\- API\- key:... http://127.0.0.1:8384/rest/db/override?folder=default
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
curl \- X POST http://127.0.0.1:8384/rest/db/prio?folder=default&file=foo/bar
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.sp
2023-09-18 03:45:31 +00:00
Response contains the same output as \fI \% GET /rest/db/need\fP \& .
2022-02-28 03:46:00 +00:00
.SS GET /rest/db/remoteneed
.sp
2024-05-13 03:45:18 +00:00
Added in version 0.14.43.
2022-02-28 03:46:00 +00:00
.sp
Takes the mandatory parameters \fB folder\fP and \fB device\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
2024-07-22 03:45:28 +00:00
The results can be paginated using the \fI \% common pagination parameters\fP \& .
2022-02-28 03:46:00 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq files\(dq : [
2022-02-28 03:46:00 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq flags\(dq : \(dq 0755\(dq ,
\(dq sequence\(dq : 6,
\(dq modified\(dq : \(dq 2015\- 04\- 20T23:06:12+09:00\(dq ,
\(dq name\(dq : \(dq ls\(dq ,
\(dq size\(dq : 34640,
\(dq version\(dq : [
\(dq 5157751870738175669:1\(dq
2022-02-28 03:46:00 +00:00
]
}
],
2023-09-18 03:45:31 +00:00
\(dq page\(dq : 1,
\(dq perpage\(dq : 100
2022-02-28 03:46:00 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2022-02-28 03:46:00 +00:00
.UNINDENT
.UNINDENT
.sp
\fB NOTE:\fP
.INDENT 0 .0
.INDENT 3 .5
This is an expensive call, increasing CPU and RAM usage on the device.
Use sparingly.
.UNINDENT
.UNINDENT
2020-06-22 04:15:24 +00:00
.SS POST /rest/db/revert
.sp
2024-05-13 03:45:18 +00:00
Added in version 0.14.50.
2020-06-22 04:15:24 +00:00
.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 \fI folder\fP (folder ID).
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
curl \- X POST \- H X\- API\- Key:... http://127.0.0.1:8384/rest/db/revert?folder=default
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS POST /rest/db/scan
.sp
Request immediate scan. Takes the optional parameters \fB folder\fP (folder ID),
\fB sub\fP (path relative to the folder root) and \fB next\fP (time in seconds). If
\fB folder\fP is omitted or empty all folders are scanned. If \fB sub\fP is given,
only this path (and children, in case it’ s a directory) is scanned. The \fB next\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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
curl \- X POST http://127.0.0.1:8384/rest/db/scan?folder=default&sub=foo/bar
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS GET /rest/db/status
.sp
Returns information about the current status of a folder.
.sp
Parameters: \fB folder\fP , the ID of a folder.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq globalBytes\(dq : 0,
\(dq globalDeleted\(dq : 0,
\(dq globalDirectories\(dq : 0,
\(dq globalFiles\(dq : 0,
\(dq globalSymlinks\(dq : 0,
\(dq globalTotalItems\(dq : 0,
\(dq ignorePatterns\(dq : false,
\(dq inSyncBytes\(dq : 0,
\(dq inSyncFiles\(dq : 0,
\(dq invalid\(dq : \(dq \(dq ,
\(dq localBytes\(dq : 0,
\(dq localDeleted\(dq : 0,
\(dq localDirectories\(dq : 0,
\(dq localFiles\(dq : 0,
\(dq localSymlinks\(dq : 0,
\(dq localTotalItems\(dq : 0,
\(dq needBytes\(dq : 0,
\(dq needDeletes\(dq : 0,
\(dq needDirectories\(dq : 0,
\(dq needFiles\(dq : 0,
\(dq needSymlinks\(dq : 0,
\(dq needTotalItems\(dq : 0,
\(dq pullErrors\(dq : 0,
\(dq receiveOnlyChangedBytes\(dq : 0,
\(dq receiveOnlyChangedDeletes\(dq : 0,
\(dq receiveOnlyChangedDirectories\(dq : 0,
\(dq receiveOnlyChangedFiles\(dq : 0,
\(dq receiveOnlyChangedSymlinks\(dq : 0,
\(dq receiveOnlyTotalItems\(dq : 0,
\(dq sequence\(dq : 0,
\(dq state\(dq : \(dq idle\(dq ,
\(dq stateChanged\(dq : \(dq 2018\- 08\- 08T07:04:57.301064781+02:00\(dq ,
\(dq version\(dq : 0
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.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
\fB NOTE:\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
2022-03-21 03:47:47 +00:00
To filter the event list, in effect creating a specific subscription for only
the desired event types, add a parameter \fB events=EventTypeA,EventTypeB,...\fP
2024-07-22 03:45:28 +00:00
where the event types are any of the \fI \% Event Types\fP \& . If no filter is
2023-09-18 03:45:31 +00:00
specified, all events \fI except\fP \fI \% LocalChangeDetected\fP and
\fI \% RemoteChangeDetected\fP are included.
2020-06-22 04:15:24 +00:00
.sp
The optional parameter \fB since=<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
2024-01-08 03:45:23 +00:00
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 \fB timeout=<seconds>\fP \& .
2020-06-22 04:15:24 +00:00
.sp
To receive only a limited number of events, add the \fB limit=<n>\fP parameter with a
suitable value for \fB n\fP and only the \fI last\fP \fB n\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 \& .
2022-02-28 03:46:00 +00:00
.SS GET /rest/events/disk
.sp
This convenience endpoint provides the same event stream, but pre\- filtered to show
2023-09-18 03:45:31 +00:00
only \fI \% LocalChangeDetected\fP and \fI \% RemoteChangeDetected\fP
2022-02-28 03:46:00 +00:00
event types. The \fB events\fP parameter is not used.
2020-06-22 04:15:24 +00:00
.SH STATISTICS ENDPOINTS
.SS GET /rest/stats/device
.sp
Returns general statistics about devices. Currently, only contains the
2023-03-13 03:45:45 +00:00
time the device was last seen and the last connection duration.
2020-06-22 04:15:24 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
$ curl \- s http://localhost:8384/rest/stats/device | json
{
2023-09-18 03:45:31 +00:00
\(dq P56IOI7\- MZJNU2Y\- IQGDREY\- DM2MGTI\- MGL3BXN\- PQ6W5BM\- TBBZ4TJ\- XZWICQ2\(dq : {
\(dq lastSeen\(dq : \(dq 2015\- 04\- 18T11:21:31.3256277+01:00\(dq
\(dq lastConnectionDurationS\(dq : 556335.421708141
2020-06-22 04:15:24 +00:00
}
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.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
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq folderid\(dq : {
\(dq lastScan\(dq : \(dq 2016\- 06\- 02T13:28:01.288181412\- 04:00\(dq ,
\(dq lastFile\(dq : {
\(dq filename\(dq : \(dq file/name\(dq ,
\(dq at\(dq : \(dq 2015\- 04\- 16T22:04:18.3066971+01:00\(dq
2022-02-28 03:46:00 +00:00
}
2020-06-22 04:15:24 +00:00
}
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.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, \fB id\fP , and returns
either a valid device ID in modern format, or an error.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
$ curl \- s http://localhost:8384/rest/svc/deviceid?id=1234 | json
{
2023-09-18 03:45:31 +00:00
\(dq error\(dq : \(dq device ID invalid: incorrect length\(dq
2020-06-22 04:15:24 +00:00
}
$ curl \- s http://localhost:8384/rest/svc/deviceid?id=p56ioi7m\- \- zjnu2iq\- gdr\- eydm\- 2mgtmgl3bxnpq6w5btbbz4tjxzwicq | json
{
2023-09-18 03:45:31 +00:00
\(dq id\(dq : \(dq P56IOI7\- MZJNU2Y\- IQGDREY\- DM2MGTI\- MGL3BXN\- PQ6W5BM\- TBBZ4TJ\- XZWICQ2\(dq
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS GET /rest/svc/lang
.sp
Returns a list of canonicalized localization codes, as picked up from
the \fB Accept\- Language\fP header sent by the browser.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2023-09-18 03:45:31 +00:00
[\(dq sv_sv\(dq ,\(dq sv\(dq ,\(dq en_us\(dq ,\(dq en\(dq ]
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS GET /rest/svc/random/string
.sp
Returns a strong random generated string (alphanumeric) of the specified length. Takes the \fB length\fP parameter.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq random\(dq : \(dq FdPaEaZQ56sXEKYNxpgF\(dq
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
.SS GET /rest/svc/report
.sp
Returns the data sent in the anonymous usage report.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2020-06-22 04:15:24 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq folderMaxMiB\(dq : 0,
\(dq platform\(dq : \(dq linux\- amd64\(dq ,
\(dq totMiB\(dq : 0,
\(dq longVersion\(dq : \(dq syncthing v0.12.2 \e \(dq Beryllium Bedbug\e \(dq (go1.4.3 linux\- amd64 default) unknown\- user@build2.syncthing.net 2015\- 11\- 09 13:23:26 UTC\(dq ,
\(dq upgradeAllowedManual\(dq : true,
\(dq totFiles\(dq : 3,
\(dq folderUses\(dq : {
\(dq ignorePerms\(dq : 0,
\(dq autoNormalize\(dq : 0,
\(dq sendonly\(dq : 0,
\(dq ignoreDelete\(dq : 0
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq memoryUsageMiB\(dq : 13,
\(dq version\(dq : \(dq v0.12.2\(dq ,
\(dq sha256Perf\(dq : 27.28,
\(dq numFolders\(dq : 2,
\(dq memorySize\(dq : 1992,
\(dq announce\(dq : {
\(dq defaultServersIP\(dq : 0,
\(dq otherServers\(dq : 0,
\(dq globalEnabled\(dq : false,
\(dq defaultServersDNS\(dq : 1,
\(dq localEnabled\(dq : false
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq usesRateLimit\(dq : false,
\(dq numCPU\(dq : 2,
\(dq uniqueID\(dq : \(dq \(dq ,
\(dq urVersion\(dq : 2,
\(dq rescanIntvs\(dq : [
2020-06-22 04:15:24 +00:00
60,
60
],
2023-09-18 03:45:31 +00:00
\(dq numDevices\(dq : 2,
\(dq folderMaxFiles\(dq : 3,
\(dq relays\(dq : {
\(dq defaultServers\(dq : 1,
\(dq enabled\(dq : true,
\(dq otherServers\(dq : 0
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq deviceUses\(dq : {
\(dq compressMetadata\(dq : 1,
\(dq customCertName\(dq : 0,
\(dq staticAddr\(dq : 1,
\(dq compressAlways\(dq : 0,
\(dq compressNever\(dq : 1,
\(dq introducer\(dq : 0,
\(dq dynamicAddr\(dq : 1
2020-06-22 04:15:24 +00:00
},
2023-09-18 03:45:31 +00:00
\(dq upgradeAllowedAuto\(dq : false
2020-06-22 04:15:24 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2020-06-22 04:15:24 +00:00
.UNINDENT
.UNINDENT
2022-02-28 03:46:00 +00:00
.SH DEBUG ENDPOINTS
.SS Debug Endpoints
.sp
2024-07-22 03:45:28 +00:00
These endpoints require the \fI \% gui.debugging\fP configuration option to
2022-02-28 03:46:00 +00:00
be enabled and yield an access denied error code otherwise.
.SS GET /rest/debug/peerCompletion
.sp
2023-04-17 03:45:33 +00:00
Summarizes the completion percentage for each remote device. Returns an object
2022-02-28 03:46:00 +00:00
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
2023-09-18 03:45:31 +00:00
\fI \% Profiling\fP \& .
2022-02-28 03:46:00 +00:00
.SS GET /rest/debug/heapprof
.sp
Used to capture a profile of what Syncthing is doing with the heap memory. See
2023-09-18 03:45:31 +00:00
\fI \% Profiling\fP \& .
2022-02-28 03:46:00 +00:00
.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 \fB folder\fP
(folder ID) and \fB file\fP (folder relative path) parameters.
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2023-09-18 03:45:31 +00:00
$ curl \- H X\- API\- Key:... \(dq http://localhost:8384/rest/debug/file?folder=default&file=foo/bar\(dq
2024-05-13 03:45:18 +00:00
.EE
2022-02-28 03:46:00 +00:00
.UNINDENT
.UNINDENT
.sp
2023-09-18 03:45:31 +00:00
The returned object contains the same info as \fI \% GET /rest/db/file\fP , plus a summary
2022-02-28 03:46:00 +00:00
of \fB globalVersions\fP \& .
2022-10-10 04:24:03 +00:00
.SH NOAUTH ENDPOINTS
.sp
Calls that do not require authentication.
.SS GET /rest/noauth/health
.sp
2023-09-18 03:45:31 +00:00
Returns a \fB {\(dq status\(dq : \(dq OK\(dq }\fP object.
2022-10-10 04:24:03 +00:00
.INDENT 0 .0
.INDENT 3 .5
.sp
2024-05-13 03:45:18 +00:00
.EX
2022-10-10 04:24:03 +00:00
{
2023-09-18 03:45:31 +00:00
\(dq status\(dq : \(dq OK\(dq
2022-10-10 04:24:03 +00:00
}
2024-05-13 03:45:18 +00:00
.EE
2022-10-10 04:24:03 +00:00
.UNINDENT
.UNINDENT
2020-06-22 04:15:24 +00:00
.SH AUTHOR
The Syncthing Authors
.SH COPYRIGHT
2014-2019, The Syncthing Authors
. \" Generated by docutils manpage writer.
.