1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014 |
- .\" Man page generated from reStructuredText.
- .
- .TH "SYNCTHING-REST-API" "7" "September 08, 2017" "v0.14" "Syncthing"
- .SH NAME
- syncthing-rest-api \- REST API
- .
- .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
- ..
- .SH DESCRIPTION
- .sp
- Syncthing exposes a REST interface over HTTP on the GUI port. This is used by
- the GUI code (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 AP 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. For example, \fBcurl \-X POST \-H
- "X\-API\-Key: abc123" http://localhost:8384/rest/...\fP can be used to invoke
- with \fBcurl\fP\&.
- .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\(aqs filepath package\fP <\fBhttps://golang.org/pkg/path/filepath/#Match\fP>\&. A \(aq*\(aq 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 "X\-API\-Key: yourkey" localhost:8384/rest/system/browse | json_pp
- [
- "/"
- ]
- $ curl \-H "X\-API\-Key: yourkey" localhost:8384/rest/system/browse?current=/var/ | json_pp
- [
- "/var/backups/",
- "/var/cache/",
- "/var/lib/",
- "/var/local/",
- "/var/lock/",
- "/var/log/",
- "/var/mail/",
- "/var/opt/",
- "/var/run/",
- "/var/spool/",
- "/var/tmp/"
- ]
- $ curl \-H "X\-API\-Key: yourkey" localhost:8384/rest/system/browse?current=/var/*o | json_pp
- [
- "/var/local/",
- "/var/lock/",
- "/var/log/",
- "/var/opt/",
- "/var/spool/"
- ]
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS GET /rest/system/config
- .sp
- Returns the current configuration.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- {
- "version": 15,
- "folders": [
- {
- "id": "GXWxf\-3zgnU",
- "label": "MyFolder",
- "path": "...",
- "type": "readwrite",
- "devices": [
- {
- "deviceID": "..."
- }
- ],
- "rescanIntervalS": 60,
- "longRescanIntervalS": 3600,
- "ignorePerms": false,
- "autoNormalize": true,
- "minDiskFreePct": 1,
- "versioning": {
- "type": "simple",
- "params": {
- "keep": "5"
- }
- },
- "copiers": 0,
- "pullers": 0,
- "hashers": 0,
- "order": "random",
- "ignoreDelete": false,
- "scanProgressIntervalS": 0,
- "pullerSleepS": 0,
- "pullerPauseS": 0,
- "maxConflicts": 10,
- "disableSparseFiles": false,
- "disableTempIndexes": false,
- "fsync": false,
- "invalid": ""
- }
- ],
- "devices": [
- {
- "deviceID": "...",
- "name": "Laptop",
- "addresses": [
- "dynamic",
- "tcp://192.168.1.2:22000"
- ],
- "compression": "metadata",
- "certName": "",
- "introducer": false
- }
- ],
- "gui": {
- "enabled": true,
- "address": "127.0.0.1:8384",
- "user": "Username",
- "password": "$2a$10$ZFws69T4FlvWwsqeIwL.TOo5zOYqsa/.TxlUnsGYS.j3JvjFTmxo6",
- "useTLS": false,
- "apiKey": "pGahcht56664QU5eoFQW6szbEG6Ec2Cr",
- "insecureAdminAccess": false,
- "theme": "default"
- },
- "options": {
- "listenAddresses": [
- "default"
- ],
- "globalAnnounceServers": [
- "default"
- ],
- "globalAnnounceEnabled": true,
- "localAnnounceEnabled": true,
- "localAnnouncePort": 21027,
- "localAnnounceMCAddr": "[ff12::8384]:21027",
- "maxSendKbps": 0,
- "maxRecvKbps": 0,
- "reconnectionIntervalS": 60,
- "relaysEnabled": true,
- "relayReconnectIntervalM": 10,
- "startBrowser": false,
- "natEnabled": true,
- "natLeaseMinutes": 60,
- "natRenewalMinutes": 30,
- "natTimeoutSeconds": 10,
- "urAccepted": \-1,
- "urUniqueId": "",
- "urURL": "https://data.syncthing.net/newdata",
- "urPostInsecurely": false,
- "urInitialDelayS": 1800,
- "restartOnWakeup": true,
- "autoUpgradeIntervalH": 12,
- "keepTemporariesH": 24,
- "cacheIgnoredFiles": false,
- "progressUpdateIntervalS": 5,
- "limitBandwidthInLan": false,
- "minHomeDiskFreePct": 1,
- "releasesURL": "https://upgrades.syncthing.net/meta.json",
- "alwaysLocalNets": [],
- "overwriteRemoteDeviceNamesOnConnect": false,
- "tempIndexMinBlocks": 10
- },
- "ignoredDevices": []
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS GET /rest/system/config/insync
- .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
- {
- "configInSync": true
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS POST /rest/system/config
- .sp
- Post the full contents of the configuration, in the same format as returned by
- the corresponding GET request. The configuration will be saved to disk and the
- \fBconfigInSync\fP flag set to false. Restart Syncthing to activate.
- .SS GET /rest/system/connections
- .sp
- \fBNOTE:\fP
- .INDENT 0.0
- .INDENT 3.5
- Return format changed in 0.13.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
- {
- "total" : {
- "paused" : false,
- "clientVersion" : "",
- "at" : "2015\-11\-07T17:29:47.691637262+01:00",
- "connected" : false,
- "inBytesTotal" : 1479,
- "type" : "",
- "outBytesTotal" : 1318,
- "address" : ""
- },
- "connections" : {
- "YZJBJFX\-RDBL7WY\-6ZGKJ2D\-4MJB4E7\-ZATSDUY\-LD6Y3L3\-MLFUYWE\-AEMXJAC" : {
- "connected" : true,
- "inBytesTotal" : 556,
- "paused" : false,
- "at" : "2015\-11\-07T17:29:47.691548971+01:00",
- "clientVersion" : "v0.12.1",
- "address" : "127.0.0.1:22002",
- "type" : "TCP (Client)",
- "outBytesTotal" : 550
- },
- "DOVII4U\-SQEEESM\-VZ2CVTC\-CJM4YN5\-QNV7DCU\-5U3ASRL\-YVFG6TH\-W5DV5AA" : {
- "outBytesTotal" : 0,
- "type" : "",
- "address" : "",
- "at" : "0001\-01\-01T00:00:00Z",
- "clientVersion" : "",
- "paused" : false,
- "inBytesTotal" : 0,
- "connected" : false
- },
- "UYGDMA4\-TPHOFO5\-2VQYDCC\-7CWX7XW\-INZINQT\-LE4B42N\-4JUZTSM\-IWCSXA4" : {
- "address" : "",
- "type" : "",
- "outBytesTotal" : 0,
- "connected" : false,
- "inBytesTotal" : 0,
- "paused" : false,
- "at" : "0001\-01\-01T00:00:00Z",
- "clientVersion" : ""
- }
- }
- }
- .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
- {
- "enabled": [
- "beacon"
- ],
- "facilities": {
- "beacon": "Multicast and broadcast discovery",
- "config": "Configuration loading and saving",
- "connections": "Connection handling",
- "db": "The database layer",
- "dialer": "Dialing connections",
- "discover": "Remote device discovery",
- "events": "Event generation and logging",
- "http": "REST API",
- "main": "Main package",
- "model": "The root hub",
- "protocol": "The BEP protocol",
- "relay": "Relay connection handling",
- "scanner": "File change detection and hashing",
- "stats": "Persistent device and folder statistics",
- "sync": "Mutexes",
- "upgrade": "Binary upgrades",
- "upnp": "UPnP discovery and port mapping",
- "versioner": "File versioning"
- }
- }
- .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
- {
- "LGFPDIT7SKNNJVJZA4FC7QNCRKCE753K72BW5QD2FOZ7FRFEP57Q": [
- "192.162.129.11:22000"
- ]
- }
- .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 "X\-API\-Key: TcE28kVPdtJ8COws1JdM0b2nodj77WeQ" 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
- {
- "errors": [
- {
- "when": "2014\-09\-18T12:59:26.549953186+02:00",
- "message": "This is an error string"
- }
- ]
- }
- .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.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "messages": [
- {
- "when": "2014\-09\-18T12:59:26.549953186+02:00",
- "message": "This is a log entry"
- }
- ]
- }
- .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{"ping": "pong"}\fP object.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "ping": "pong"
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS POST /rest/system/ping
- .sp
- Returns a \fB{"ping": "pong"}\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 "X\-API\-Key: abc123" http://localhost:8384/rest/system/reset?folder=default
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .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.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "alloc": 30618136,
- "connectionServiceStatus": {
- "dynamic+https://relays.syncthing.net/endpoint": {
- "lanAddresses": [
- "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"
- ],
- "wanAddresses": [
- "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"
- ]
- },
- "tcp://0.0.0.0:22000": {
- "lanAddresses": [
- "tcp://0.0.0.0:22000"
- ],
- "wanAddresses": [
- "tcp://0.0.0.0:22000"
- ]
- }
- },
- "cpuPercent": 0.006944836512046966,
- "discoveryEnabled": true,
- "discoveryErrors": {
- "global@https://discovery\-v4\-1.syncthing.net/v2/": "500 Internal Server Error",
- "global@https://discovery\-v4\-2.syncthing.net/v2/": "Post https://discovery\-v4\-2.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)",
- "global@https://discovery\-v4\-3.syncthing.net/v2/": "Post https://discovery\-v4\-3.syncthing.net/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)",
- "global@https://discovery\-v6\-1.syncthing.net/v2/": "Post https://discovery\-v6\-1.syncthing.net/v2/: dial tcp [2001:470:28:4d6::5]:443: connect: no route to host",
- "global@https://discovery\-v6\-2.syncthing.net/v2/": "Post https://discovery\-v6\-2.syncthing.net/v2/: dial tcp [2604:a880:800:10::182:a001]:443: connect: no route to host",
- "global@https://discovery\-v6\-3.syncthing.net/v2/": "Post https://discovery\-v6\-3.syncthing.net/v2/: dial tcp [2400:6180:0:d0::d9:d001]:443: connect: no route to host"
- },
- "discoveryMethods": 8,
- "goroutines": 49,
- "myID": "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2",
- "pathSeparator": "/",
- "startTime": "2016\-06\-06T19:41:43.039284753+02:00",
- "sys": 42092792,
- "themes": [
- "default",
- "dark"
- ],
- "tilde": "/Users/jb",
- "uptime": 2635
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .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
- {
- "latest": "v0.10.27",
- "newer": false,
- "running": "v0.10.27+5\-g36c93b7"
- }
- .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
- {
- "arch": "amd64",
- "longVersion": "syncthing v0.10.27+3\-gea8c3de (go1.4 darwin\-amd64 default) jb@syno 2015\-03\-16 11:01:29 UTC",
- "os": "darwin",
- "version": "v0.10.27+3\-gea8c3de"
- }
- .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=default | json_pp
- {
- "directory": {
- "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
- "subdirectory": {
- "another file": ["2015\-04\-20T22:20:45+09:00", 130940928]
- }
- },
- "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
- }
- $ curl \-s http://localhost:8384/rest/db/browse?folder=default&levels=0 | json_pp
- {
- "directory": {},
- "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
- }
- $ curl \-s http://localhost:8384/rest/db/browse?folder=default&levels=1 | json_pp
- {
- "directory": {
- "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
- "subdirectory": {}
- },
- "rootfile": ["2015\-04\-20T22:20:45+09:00", 130940928]
- }
- $ curl \-s http://localhost:8384/rest/db/browse?folder=default&prefix=directory/subdirectory | json_pp
- {
- "another file": ["2015\-04\-20T22:20:45+09:00", 130940928]
- }
- $ curl \-s http://localhost:8384/rest/db/browse?folder=default&prefix=directory&levels=0 | json_pp
- {
- "file": ["2015\-04\-20T22:20:45+09:00", 130940928],
- "subdirectory": {}
- }
- .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) for a given device and
- folder. Takes \fBdevice\fP and \fBfolder\fP parameters.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "completion": 0
- }
- .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/file
- .sp
- Returns most data available about a given file, including version and
- availability. Takes \fBfolder\fP and \fBfile\fP parameters.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "availability": [
- "I6KAH76\-66SLLLB\-5PFXSOA\-UFJCDZC\-YAOMLEK\-CP2GB32\-BV5RQST\-3PSROAU"
- ],
- "global": {
- "flags": "0644",
- "sequence": 3,
- "modified": "2015\-04\-20T22:20:45+09:00",
- "name": "util.go",
- "numBlocks": 1,
- "size": 9642,
- "version": [
- "5407294127585413568:1"
- ]
- },
- "local": {
- "flags": "0644",
- "sequence": 4,
- "modified": "2015\-04\-20T22:20:45+09:00",
- "name": "util.go",
- "numBlocks": 1,
- "size": 9642,
- "version": [
- "5407294127585413568:1"
- ]
- }
- }
- .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
- {
- "ignore": [
- "(?i)/Backups"
- ],
- "expanded": [
- "(?i)Backups",
- "(?i)Backups/**"
- ]
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS POST /rest/db/ignores
- .sp
- Expects a format similar to the output of \fBGET\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/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
- Furthermore takes an optional \fBpage\fP and \fBperpage\fP arguments for pagination.
- 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
- In all these calls, \fBtotal\fP will be 30 to indicate the total number of
- available items.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- # Files currently being downloaded
- "progress": [
- {
- "flags": "0755",
- "sequence": 6,
- "modified": "2015\-04\-20T23:06:12+09:00",
- "name": "ls",
- "size": 34640,
- "version": [
- "5157751870738175669:1"
- ]
- }
- ],
- # Files queued to be downloaded next (as per array order)
- "queued": [
- ...
- ],
- # 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.
- "rest": [
- ...
- ],
- "page": 1,
- "perpage": 100,
- "total": 2000
- }
- .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.
- Takes the mandatory parameter \fIfolder\fP (folder ID).
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- curl \-X POST 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 \fBGET /rest/db/need\fP
- .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\(aqs a directory) is scanned. The \fBnext\fP
- argument delays Syncthing\(aqs 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
- {
- # latest version according to cluster:
- "globalBytes": 13173473780,
- "globalDeleted": 1847,
- "globalFiles": 42106,
- # what we have locally:
- "localBytes": 13173473780,
- "localDeleted": 1847,
- "localFiles": 42106,
- # which part of what we have locally is the latest cluster version:
- "inSyncBytes": 13173473780,
- "inSyncFiles": 42106,
- # which part of what we have locally should be fetched from the cluster:
- "needBytes": 0,
- "needFiles": 0,
- # various other metadata
- "ignorePatterns": true,
- "invalid": "",
- "state": "idle",
- "stateChanged": "2015\-03\-16T21:47:28.750853241+01:00",
- "version": 71989
- }
- .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
- .SH EVENT ENDPOINTS
- .SS Event API
- .SS Description
- .sp
- Syncthing provides a simple long polling interface for exposing events from the
- core utility towards a GUI.
- .sp
- To receive events, perform a HTTP GET of \fB/rest/events\fP or
- \fB/rest/events/disk\fP\&. The latter returns only local\-change\-detected and
- remote\-change\-detected events, the former all other events.
- .sp
- The optional parameter \fBsince=<lastSeenID>\fP sets the ID of the last event
- you\(aqve 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. 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 Event Structure
- .sp
- Each event is represented by an object similar to the following:
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 2,
- "globalID": 3,
- "type": "DeviceConnected",
- "time": "2014\-07\-13T21:04:33.687836696+02:00",
- "data": {
- "addr": "172.16.32.25:22000",
- "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .sp
- The top level keys \fBid\fP, \fBglobalID\fP, \fBtime\fP, \fBtype\fP and \fBdata\fP are always present,
- though \fBdata\fP may be \fBnull\fP\&.
- .INDENT 0.0
- .TP
- .B id
- A unique ID for this event on the events API. It always increases by 1: the first
- event generated has id \fB1\fP, the next has id \fB2\fP etc. If this increases by
- more than 1, then one or more events have been skipped by the events API.
- .TP
- .B globalID
- A global ID for this event, across the events API, the audit log, and any other
- sources. It may increase by more than 1, but it will always be greater
- than or equal to the id.
- .TP
- .B time
- The time the event was generated.
- .TP
- .B type
- Indicates the type of (i.e. reason for) the event and is one of the event
- types below.
- .TP
- .B data
- An object containing optional extra information; the exact structure is
- determined by the event type.
- .UNINDENT
- .SS Event Types
- .SS ConfigSaved
- .sp
- Emitted after the config has been saved by the user or by Syncthing
- itself.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 50,
- "type": "ConfigSaved",
- "time": "2014\-12\-13T00:09:13.5166486Z",
- "data": {
- "Version": 7,
- "Options": {"..."},
- "GUI": {"..."},
- "Devices": [{"..."}],
- "Folders": [{"..."}]
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS DeviceConnected
- .sp
- Generated each time a connection to a device has been established.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 2,
- "type": "DeviceConnected",
- "time": "2014\-07\-13T21:04:33.687836696+02:00",
- "data": {
- "addr": "172.16.32.25:22000",
- "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG",
- "deviceName": "Laptop",
- "clientName": "syncthing",
- "clientVersion": "v0.13.4",
- "type": "TCP (Client)"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS DeviceDisconnected
- .sp
- Generated each time a connection to a device has been terminated.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 48,
- "type": "DeviceDisconnected",
- "time": "2014\-07\-13T21:18:52.859929215+02:00",
- "data": {
- "error": "unexpected EOF",
- "id": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .sp
- \fBNOTE:\fP
- .INDENT 0.0
- .INDENT 3.5
- The error key contains the cause for disconnection, which might not
- necessarily be an error as such. Specifically, "EOF" and "unexpected
- EOF" both signify TCP connection termination, either due to the other
- device restarting or going offline or due to a network change.
- .UNINDENT
- .UNINDENT
- .SS DeviceDiscovered
- .sp
- Emitted when a new device is discovered using local discovery.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 13,
- "type": "DeviceDiscovered",
- "time": "2014\-07\-17T13:28:05.043465207+02:00",
- "data": {
- "addrs": [
- "172.16.32.25:22000"
- ],
- "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS DevicePaused
- .sp
- Emitted when a device was paused.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 13,
- "type": "DevicePaused",
- "time": "2014\-07\-17T13:28:05.043465207+02:00",
- "data": {
- "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS DeviceRejected
- .sp
- Emitted when there is a connection from a device we are not configured
- to talk to.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 24,
- "type": "DeviceRejected",
- "time": "2014\-08\-19T10:43:00.562821045+02:00",
- "data": {
- "address": "127.0.0.1:51807",
- "device": "EJHMPAQ\-OGCVORE\-ISB4IS3\-SYYVJXF\-TKJGLTU\-66DIQPF\-GJ5D2GX\-GQ3OWQK"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS DeviceResumed
- .sp
- Generated each time a device was resumed.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 2,
- "type": "DeviceResumed",
- "time": "2014\-07\-13T21:04:33.687836696+02:00",
- "data": {
- "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS DownloadProgress
- .sp
- Emitted during file downloads for each folder for each file. By default
- only a single file in a folder is handled at the same time, but custom
- configuration can cause multiple files to be shown.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 221,
- "type": "DownloadProgress",
- "time": "2014\-12\-13T00:26:12.9876937Z",
- "data": {
- "folder1": {
- "file1": {
- "Total": 800,
- "Pulling": 2,
- "CopiedFromOrigin": 0,
- "Reused": 633,
- "CopiedFromElsewhere": 0,
- "Pulled": 38,
- "BytesTotal": 104792064,
- "BytesDone": 87883776
- },
- "dir\e\efile2": {
- "Total": 80,
- "Pulling": 2,
- "CopiedFromOrigin": 0,
- "Reused": 0,
- "CopiedFromElsewhere": 0,
- "Pulled": 32,
- "BytesTotal": 10420224,
- "BytesDone": 4128768
- }
- },
- "folder2": {
- "file3": {
- "Total": 800,
- "Pulling": 2,
- "CopiedFromOrigin": 0,
- "Reused": 633,
- "CopiedFromElsewhere": 0,
- "Pulled": 38,
- "BytesTotal": 104792064,
- "BytesDone": 87883776
- },
- "dir\e\efile4": {
- "Total": 80,
- "Pulling": 2,
- "CopiedFromOrigin": 0,
- "Reused": 0,
- "CopiedFromElsewhere": 0,
- "Pulled": 32,
- "BytesTotal": 10420224,
- "BytesDone": 4128768
- }
- }
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .INDENT 0.0
- .IP \(bu 2
- \fBTotal\fP \- total number of blocks in the file
- .IP \(bu 2
- \fBPulling\fP \- number of blocks currently being downloaded
- .IP \(bu 2
- \fBCopiedFromOrigin\fP \- number of blocks copied from the file we are
- about to replace
- .IP \(bu 2
- \fBReused\fP \- number of blocks reused from a previous temporary file
- .IP \(bu 2
- \fBCopiedFromElsewhere\fP \- number of blocks copied from other files or
- potentially other folders
- .IP \(bu 2
- \fBPulled\fP \- number of blocks actually downloaded so far
- .IP \(bu 2
- \fBBytesTotal\fP \- approximate total file size
- .IP \(bu 2
- \fBBytesDone\fP \- approximate number of bytes already handled (already
- reused, copied or pulled)
- .UNINDENT
- .sp
- Where block size is 128KB.
- .sp
- Files/folders appearing in the event data imply that the download has
- been started for that file/folder, where disappearing implies that the
- downloads have been finished or failed for that file/folder. There is
- always a last event emitted with no data, which implies all downloads
- have finished/failed.
- .SS FolderCompletion
- .sp
- The \fBFolderCompletion\fP event is emitted when the local or remote
- contents for a folder changes. It contains the completion percentage for
- a given remote device and is emitted once per currently connected remote
- device.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 84,
- "type": "FolderCompletion",
- "time": "2015\-04\-17T14:14:27.043576583+09:00",
- "data": {
- "completion": 100,
- "device": "I6KAH76\-66SLLLB\-5PFXSOA\-UFJCDZC\-YAOMLEK\-CP2GB32\-BV5RQST\-3PSROAU",
- "folder": "default"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS FolderErrors
- .sp
- The \fBFolderErrors\fP event is emitted when a folder cannot be successfully
- synchronized. The event contains the ID of the affected folder and a list of
- errors for files or directories therein. This list of errors is obsolete once
- the folder changes state to \fBsyncing\fP \- if errors remain after the next
- synchronization attempt, a new \fBFolderErrors\fP event is emitted.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 132,
- "type": "FolderErrors",
- "time": "2015\-06\-26T13:39:24.697401384+02:00",
- "data": {
- "errors": [
- {
- "error": "open /Users/jb/src/github.com/syncthing/syncthing/test/s2/h2j/.syncthing.aslkjd.tmp: permission denied",
- "path": "h2j/aslkjd"
- }
- ],
- "folder": "default"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .sp
- New in version 0.11.12.
- .sp
- \fBSEE ALSO:\fP
- .INDENT 0.0
- .INDENT 3.5
- The statechanged event.
- .UNINDENT
- .UNINDENT
- .SS FolderRejected
- .sp
- Emitted when a device sends index information for a folder we do not
- have, or have but do not share with the device in question.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 27,
- "type": "FolderRejected",
- "time": "2014\-08\-19T10:41:06.761751399+02:00",
- "data": {
- "device": "EJHMPAQ\-OGCVORE\-ISB4IS3\-SYYVJXF\-TKJGLTU\-66DIQPF\-GJ5D2GX\-GQ3OWQK",
- "folder": "GXWxf\-3zgnU",
- "folderLabel": "My Pictures"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS Folder Scan Progress
- .sp
- Emitted in regular intervals (folder setting ProgressIntervalS, 2s by default)
- during scans giving the amount of bytes already scanned and to be scanned in
- total , as well as the current scanning rates in bytes per second.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "data" : {
- "total" : 1,
- "rate" : 0,
- "current" : 0,
- "folder" : "bd7q3\-zskm5"
- },
- "globalID" : 29,
- "type" : "FolderScanProgress",
- "time" : "2017\-03\-06T15:00:58.072004209+01:00",
- "id" : 29
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS FolderSummary
- .sp
- The FolderSummary event is emitted when folder contents have changed
- locally. This can be used to calculate the current local completion
- state.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 16,
- "type": "FolderSummary",
- "time": "2015\-04\-17T14:12:20.460121585+09:00",
- "data": {
- "folder": "default",
- "summary": {
- "globalBytes": 0,
- "globalDeleted": 0,
- "globalFiles": 0,
- "ignorePatterns": false,
- "inSyncBytes": 0,
- "inSyncFiles": 0,
- "invalid": "",
- "localBytes": 0,
- "localDeleted": 0,
- "localFiles": 0,
- "needBytes": 0,
- "needFiles": 0,
- "state": "idle",
- "stateChanged": "2015\-04\-17T14:12:12.455224687+09:00",
- "version": 0
- }
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS ItemFinished
- .sp
- Generated when Syncthing ends synchronizing a file to a newer version. A
- successful operation:
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 93,
- "type": "ItemFinished",
- "time": "2014\-07\-13T21:22:03.414609034+02:00",
- "data": {
- "item": "test.txt",
- "folder": "default",
- "error": null,
- "type": "file",
- "action": "update"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .sp
- An unsuccessful operation:
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 44,
- "type": "ItemFinished",
- "time": "2015\-05\-27T11:21:05.711133004+02:00",
- "data": {
- "action": "update",
- "error": "open /Users/jb/src/github.com/syncthing/syncthing/test/s2/foo/.syncthing.hej.tmp: permission denied",
- "folder": "default",
- "item": "foo/hej",
- "type": "file"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .sp
- The \fBaction\fP field is either \fBupdate\fP (contents changed), \fBmetadata\fP (file metadata changed but not contents), or \fBdelete\fP\&.
- .sp
- New in version 0.11.10: The \fBmetadata\fP action.
- .SS ItemStarted
- .sp
- Generated when Syncthing begins synchronizing a file to a newer version.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 93,
- "type": "ItemStarted",
- "time": "2014\-07\-13T21:22:03.414609034+02:00",
- "data": {
- "item": "test.txt",
- "folder": "default",
- "type": "file",
- "action": "update"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .sp
- The \fBaction\fP field is either \fBupdate\fP (contents changed), \fBmetadata\fP (file metadata changed but not contents), or \fBdelete\fP\&.
- .sp
- New in version 0.11.10: The \fBmetadata\fP action.
- .SS Listen Addresses Changed
- .sp
- This event is emitted when a listen address changes.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "type" : "ListenAddressesChanged",
- "id" : 70,
- "time" : "2017\-03\-06T15:01:24.88340663+01:00",
- "globalID" : 70,
- "data" : {
- "address" : {
- "Fragment" : "",
- "RawQuery" : "",
- "Scheme" : "dynamic+https",
- "Path" : "/endpoint",
- "RawPath" : "",
- "User" : null,
- "ForceQuery" : false,
- "Host" : "relays.syncthing.net",
- "Opaque" : ""
- },
- "wan" : [
- {
- "ForceQuery" : false,
- "User" : null,
- "Host" : "31.15.66.212:443",
- "Opaque" : "",
- "Path" : "/",
- "RawPath" : "",
- "RawQuery" : "id=F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=",
- "Scheme" : "relay",
- "Fragment" : ""
- }
- ],
- "lan" : [
- {
- "RawQuery" : "id=F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A&pingInterval=1m0s&networkTimeout=2m0s&sessionLimitBps=0&globalLimitBps=0&statusAddr=:22070&providedBy=",
- "Scheme" : "relay",
- "Fragment" : "",
- "RawPath" : "",
- "Path" : "/",
- "Host" : "31.15.66.212:443",
- "Opaque" : "",
- "ForceQuery" : false,
- "User" : null
- }
- ]
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS LocalChangeDetected
- .sp
- Generated upon scan whenever the local disk has discovered an updated file from the
- previous scan. This does \fInot\fP include events that are discovered and copied from
- other devices (remote\-change\-detected), only files that were changed on the
- local filesystem.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 7,
- "globalID": 59,
- "time": "2016\-09\-26T22:07:10.7189141\-04:00",
- "type": "LocalChangeDetected",
- "data": {
- "action": "deleted",
- "folderID": "vitwy\-zjxqt",
- "label": "TestSync",
- "path": "C:\e\eUsers\e\eNate\e\eSync\e\etestfolder\e\etest file.rtf",
- "type": "file"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS LocalIndexUpdated
- .sp
- Generated when the local index information has changed, due to
- synchronizing one or more items from the cluster or discovering local
- changes during a scan.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 59,
- "type": "LocalIndexUpdated",
- "time": "2014\-07\-17T13:27:28.051369434+02:00",
- "data": {
- "folder": "default",
- "items": 1000,
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS Login Attempt
- .sp
- When authentication is enabled for the GUI, this event is emitted on every
- login attempt. If either the username or password are incorrect, \fBsuccess\fP
- is false and in any case the given username is returned.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id" : 187,
- "time" : "2017\-03\-07T00:19:24.420386143+01:00",
- "data" : {
- "username" : "somename",
- "success" : false
- },
- "type" : "LoginAttempt",
- "globalID" : 195
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS RemoteChangeDetected
- .sp
- Generated upon scan whenever a file is locally updated due to a remote change.
- Files that are updated locally produce a local\-change\-detected event.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "time" : "2017\-03\-06T23:58:21.844739891+01:00",
- "globalID" : 123,
- "data" : {
- "type" : "file",
- "action" : "deleted",
- "path" : "/media/ntfs_data/Dokumente/testfile",
- "label" : "Dokumente",
- "folderID" : "Dokumente",
- "modifiedBy" : "BPDFDTU"
- },
- "type" : "RemoteChangeDetected",
- "id" : 2
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS Remote Download Progress
- .sp
- This event is emitted when a download\-progress message is
- received. It returns a map \fBdata\fP of filenames with a count of
- downloaded blocks. The files in questions are currently being
- downloaded on the remote \fBdevice\fP and belong to \fBfolder\fP\&.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "time" : "2017\-03\-07T00:11:37.65838955+01:00",
- "globalID" : 170,
- "data" : {
- "state" : {
- "tahr64\-6.0.5.iso" : 1784
- },
- "device" : "F4HSJVO\-CP2C3IL\-YLQYLSU\-XTYODAG\-PPU4LGV\-PH3MU4N\-G6K56DV\-IPN47A",
- "folder" : "Dokumente"
- },
- "type" : "RemoteDownloadProgress",
- "id" : 163
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS RemoteIndexUpdated
- .sp
- Generated each time new index information is received from a device.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 44,
- "type": "RemoteIndexUpdated",
- "time": "2014\-07\-13T21:04:35.394184435+02:00",
- "data": {
- "device": "NFGKEKE\-7Z6RTH7\-I3PRZXS\-DEJF3UJ\-FRWJBFO\-VBBTDND\-4SGNGVZ\-QUQHJAG",
- "folder": "lightroom",
- "items": 1000
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS Starting
- .sp
- Emitted exactly once, when Syncthing starts, before parsing
- configuration etc.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 1,
- "type": "Starting",
- "time": "2014\-07\-17T13:13:32.044470055+02:00",
- "data": {
- "home": "/home/jb/.config/syncthing"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS StartupComplete
- .sp
- Emitted exactly once, when initialization is complete and Syncthing is
- ready to start exchanging data with other devices.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 1,
- "type": "StartupComplete",
- "time": "2014\-07\-13T21:03:18.383239179+02:00",
- "data": null
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS StateChanged
- .sp
- Emitted when a folder changes state. Possible states are \fBidle\fP,
- \fBscanning\fP, \fBsyncing\fP and \fBerror\fP\&. The field \fBduration\fP is
- the number of seconds the folder spent in state \fBfrom\fP\&. In the example
- below, the folder \fBdefault\fP was in state \fBscanning\fP for 0.198
- seconds and is now in state \fBidle\fP\&.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- {
- "id": 8,
- "type": "StateChanged",
- "time": "2014\-07\-17T13:14:28.697493016+02:00",
- "data": {
- "folder": "default",
- "from": "scanning",
- "duration": 0.19782869900000002,
- "to": "idle"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SS GET /rest/events/disk
- .sp
- Returns local disk events that occur when the scanner detects local file system
- changes (local\-change\-detected) or when files are pulled from a remote
- device (remote\-change\-detected).
- .INDENT 0.0
- .TP
- .B Optional GET parameters:
- .INDENT 7.0
- .IP \(bu 2
- since (events starting after the given ID)
- .IP \(bu 2
- timeout (fail after given seconds if no event is available, 2s by default)
- .IP \(bu 2
- limit (return last x number of events)
- .UNINDENT
- .UNINDENT
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- $ curl \-s http://localhost:8384/rest/events/disk?limit=4 | json
- {
- "id": 4,
- "globalID": 45,
- "time": "2016\-09\-26T22:06:10.4734536\-04:00",
- "type": "LocalChangeDetected",
- "data": {
- "action": "added",
- "folderID": "vitwy\-zxuqt",
- "label": "TestSync",
- "path": "C:\e\eUsers\e\eNate\e\eSync\e\etestfolder",
- "type": "dir"
- }
- },
- {
- "id": 5,
- "globalID": 46,
- "time": "2016\-09\-26T22:06:10.4754548\-04:00",
- "type": "LocalChangeDetected",
- "data": {
- "action": "added",
- "folderID": "vitwy\-zxuqt",
- "label": "TestSync",
- "path": "C:\e\eUsers\e\eNate\e\eSync\e\edfghdfj\e\etest file.rtf",
- "type": "file"
- }
- },
- {
- "id": 6,
- "globalID": 58,
- "time": "2016\-09\-26T22:07:10.7189141\-04:00",
- "type": "LocalChangeDetected",
- "data": {
- "action": "deleted",
- "folderID": "vitwy\-zxuqt",
- "label": "TestSync",
- "path": "C:\e\eUsers\e\eNate\e\eSync\e\etestfolder",
- "type": "dir"
- }
- },
- {
- "id": 7,
- "globalID": 59,
- "time": "2016\-09\-26T22:07:10.7189141\-04:00",
- "type": "LocalChangeDetected",
- "data": {
- "action": "deleted",
- "folderID": "vitwy\-zxuqt",
- "label": "TestSync",
- "path": "C:\e\eUsers\e\eNate\e\eSync\e\edfghdfj\e\etest file.rtf",
- "type": "file"
- }
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SH STATISTICS ENDPOINTS
- .SS GET /rest/stats/device
- .sp
- Returns general statistics about devices. Currently, only contains the
- time the device was last seen.
- .INDENT 0.0
- .INDENT 3.5
- .sp
- .nf
- .ft C
- $ curl \-s http://localhost:8384/rest/stats/device | json
- {
- "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2": {
- "lastSeen" : "2015\-04\-18T11:21:31.3256277+01:00"
- }
- }
- .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
- $ curl \-s http://localhost:8384/rest/stats/folder | json
- {
- "folderid" : {
- "lastScan": "2016\-06\-02T13:28:01.288181412\-04:00",
- "lastFile" : {
- "filename" : "file/name",
- "at" : "2015\-04\-16T22:04:18.3066971+01:00"
- }
- }
- }
- .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
- {
- "error": "device ID invalid: incorrect length"
- }
- $ curl \-s http://localhost:8384/rest/svc/deviceid?id=p56ioi7m\-\-zjnu2iq\-gdr\-eydm\-2mgtmgl3bxnpq6w5btbbz4tjxzwicq | json
- {
- "id": "P56IOI7\-MZJNU2Y\-IQGDREY\-DM2MGTI\-MGL3BXN\-PQ6W5BM\-TBBZ4TJ\-XZWICQ2"
- }
- .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
- ["sv_sv","sv","en_us","en"]
- .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
- {
- "random": "FdPaEaZQ56sXEKYNxpgF"
- }
- .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
- {
- "folderMaxMiB" : 0,
- "platform" : "linux\-amd64",
- "totMiB" : 0,
- "longVersion" : "syncthing v0.12.2 \e"Beryllium Bedbug\e" (go1.4.3 linux\-amd64 default) unknown\[email protected] 2015\-11\-09 13:23:26 UTC",
- "upgradeAllowedManual" : true,
- "totFiles" : 3,
- "folderUses" : {
- "ignorePerms" : 0,
- "autoNormalize" : 0,
- "readonly" : 0,
- "ignoreDelete" : 0
- },
- "memoryUsageMiB" : 13,
- "version" : "v0.12.2",
- "sha256Perf" : 27.28,
- "numFolders" : 2,
- "memorySize" : 1992,
- "announce" : {
- "defaultServersIP" : 0,
- "otherServers" : 0,
- "globalEnabled" : false,
- "defaultServersDNS" : 1,
- "localEnabled" : false
- },
- "usesRateLimit" : false,
- "numCPU" : 2,
- "uniqueID" : "",
- "urVersion" : 2,
- "rescanIntvs" : [
- 60,
- 60
- ],
- "numDevices" : 2,
- "folderMaxFiles" : 3,
- "relays" : {
- "defaultServers" : 1,
- "enabled" : true,
- "otherServers" : 0
- },
- "deviceUses" : {
- "compressMetadata" : 1,
- "customCertName" : 0,
- "staticAddr" : 1,
- "compressAlways" : 0,
- "compressNever" : 1,
- "introducer" : 0,
- "dynamicAddr" : 1
- },
- "upgradeAllowedAuto" : false
- }
- .ft P
- .fi
- .UNINDENT
- .UNINDENT
- .SH AUTHOR
- The Syncthing Authors
- .SH COPYRIGHT
- 2015, The Syncthing Authors
- .\" Generated by docutils manpage writer.
- .
|