API offline but Syncthing “Running (Offline)” redux

I had the same problem as this person:

That thread was closed so I’m posting here with a solution.

I’m on macOS Sonoma.

I’m running Syncthing v 1.27.8-1.

I had to do some heavy duty wiping of Syncthing on 4 computers and once they were all running smoothly, the API light was red, which irked me. (TBH, I don’t know what it’s for but I didn’t want to have a flag on the icon in the toolbar so…)

After seeing the clues that the OP noted above (mismatch between the API key in Syncthing->Preferences… and Actions->Settings…->General) I decided to find where the API key is stored on disk.

I found it in ~/Library/Application\ Support/Syncthing/config.xml.

The string saved there was the one from Actions->Settings…->General, so I just copied over it (after making a copy of the original file) with the key/string from Syncthing->Preferences…

Then I quit Syncthing and restarted it.

Voila. Fixed.