Problems using API

I have several questions about using Syncthing API. I am curently trying to make syncthing work without GUI in Ubuntu-Linux command line.

  1. When i am trying to use GET rest/config/… it just returns 404
curl -X GET -H "X-API-Key: ..." localhost:8384/rest/config

What i am doing wrong?

  1. I want to get last event from Rest/events with type “FolderCompletion” to check download status of the folder, but when i try to write this:
curl -H "X-API-Key: ..." localhost:8384/rest/events?events=FolderCompletion&limit=1

It just posts whole list of events with this type. How to use parameter “events” with parameter “limit”?

The url is /rest/system/config; GET /rest/system/config — Syncthing v1 documentation

You need to quote the url, or the “&” will be taken by the shell as a directive to run the command in the background.

1 Like

Config Endpoints — Syncthing v1 documentation But what about this? Does this not work?

I want to add new devices and folders using only command line, i am not really sure that /rest/config/devices and /rest/config/folders is right thing to choose. If there is anything better than that ill be very gratefull if you tell me.

Thank you very much! It really helped.

1 Like

Ah, my bad. I don’t know why you’re getting a 404. Are you running a modern version where that endpoint exists?


I downloaded a “stable” version of the syncthing from the guide:

  "arch": "amd64",
  "codename": "Erbium Earthworm",
  "isBeta": true,
  "isCandidate": false,
  "isRelease": false,
  "longVersion": "syncthing unknown-dev \"Erbium Earthworm\" (go1.13.5 linux-amd64) unknown@unknown 1970-01-01 00:00:00 UTC",
  "os": "linux",
  "version": "unknown-dev"

I am not really sure that this is the latest overall, but its latest in the “stable”, right?

You didn’t get the version from there, but likely an ancient one from your distro (which was built badly, thus the "unknown"s). Double check that you followed the instructions on that page filly

1 Like

I reinstalled syncthing using candidate channel and… it works! Every API works properly.

Thank you!

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