I tried with multiple addresses and I got different errors:
1 Error
The service refused the connection - perhaps it is offline
Screenshot

“public ip”:5678/api/v1
“public ip”/api/v1
n8n.example.com/api/v1
https://localhost/api/v1
public ip cannot work, as the docker is not exposed directly to it, traefik only passes traffic to n8n on n8n.example.com
also public ip or localhost without port totally makes sense why this error gets thrown - a port is needed in this case else it does not get forwarded to the right port.
2 Error
UNKNOWN ERROR - check the detailed error for more information
Screenshot

https://localhost:5678/api/v1
https://127.0.0.1:5678/api/v1
I think this error happens because https is not supported/enabled on the n8n docker directly. I am using traefik for https which only works (in my case) on n8n.example.com
3 Error
Authorization failed - please check your credentials
Screenshot

http://localhost:5678/api/v1
http://127.0.0.1:5678/api/v1
As that error suggests, it can establish a connection I’ve tried to insert a fresh copy of the api key which did not help. when I use the same copy of the api key in swagger it works.
Screenshot

(Just got an idea writing this: swagger works → that should mean, that from another n8n instance I should be able to connect.)
Generating a new api key also does not work.
EDIT: just realized, the screenshot of swagger also shows “authorized” when using a false api key, but when copying the right api key into swagger i can use all calls i tried without problems.
EDIT 2:
I’ve just tried to connect from an n8n cloud instance to my self-hosted n8n instance and I also get the same error:
Screenshot

EDIT 3:
when connecting from the cloud instance to the cloud instance it works:
when connecting from the self-hosted instance to the cloud instance it also works:
Screenshot
