/rest/db/file API call

Dear syncthing community,

I’m trying to use the Synthing REST API for some own project but I don’t really understand the /rest/db/file API endpoint.


“Takes folder and file parameters”

For the “file” parameter I tried everything from fullpath, file name to some ID I found in some logs. But sadly I don’t get any data back.

Can you provide an example for this API call?

Its file path to relative to the root of the folder.

Sorry but I don’t get it :frowning:

curl -k -H "X-API-Key: xxxxxxxxxxxxxxxxxxxxxxx" https://xxxxxxxxxx:xxxx/rest/db/browse?folder=wjnky-k2h7h | jq
  "17802.mxf": [
  "17802_tmp.mxf": [
  "20160901_401660_00.mxf": [
  "20160901_401660_00_new.mxf": [
  "401660_new.mxf": [
  "PC130264_5F5E416137F94D52A0FA01BC13A99E65.mxf": [
  "PC137323_C569CC6D5AB14C0E81B9ECB9A718FEBB.mxf": [
  "PC137323_C569CC6D5AB14C0E81B9ECB9A718FEBB_new.mxf": [
  "RPA_548549312A214FA78AA05E920AE72F4A.mxf": [
  "RPA_DAA88991C19B4FB3B8D0775ADEBBF5AF.mxf": [
  "test": {
    "401660.mxf": [

curl -k -H "X-API-Key: xxxxxxxxxxxxxxxxxxxxxxx" https://xxxxxxxxxx:xxxx/rest/db/file?folder=wjnky-k2h7h&file=RPA_DAA88991C19B4FB3B8D0775ADEBBF5AF.mxf | jq
No such object in the index

Same with /RPA_DAA88991C19B4FB3B8D0775ADEBBF5AF.mxf and URL encoded %2FRPA_DAA88991C19B4FB3B8D0775ADEBBF5AF.mxf

What am I doing wrong?

Can you explain what are you trying to achieve ?

I’m trying to “return most data available about a given file, including version and availability.” as described here GET /rest/db/file — Syncthing v1 documentation


EDIT: In the example above “RPA_DAA88991C19B4FB3B8D0775ADEBBF5AF.mxf” is one file at the root of the folder “wjnky-k2h7h”

From what you posted it looks like it should work, so I’d have to try and repro myself. Poke around and if you can’t get it to work open an issue on github as a reminder for someone to look at.

Ok will do. Thanks! :wink:

Just to be sure - the ampersand & is a shell special character. If you don’t quote it as \& or put the whole URL in quotes, the curl command will probably not do what it looks like, and you’ll get an error similar to the one you quote.

1 Like

@calmh :joy: you’re right! Thanks it works :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.