I dont think what you are trying to do is possible. you are using n8n cloud and you want n8n to access your local machines API (localhost) but that’s not possible. either you host this API publicly so that n8n can access or use n8n locally so that it can access localhost
Yes that should work. First check with tools like postman whether you are calling the api correctly. Sometimes firewall rules can also prevent accessing localhost. In that case you would face issues with both n8n local and your endpoint