I am running into a sudden 502 Bad Gateway connection issue with an outbound HTTP call in my Freshworks app. This exact request was working properly earlier without any issues, but it has now started failing consistently.
Error Payload :
{
“status”: 502,
“headers”: {},
“response”: “Error in establishing connection”,
“errorSource”: “APP”,
“attempts”: 1
}
below is my request.json :
“getContact”: {
“schema”: {
“method”: “GET”,
“host”: “<%= iparam.domain%>.myfreshworks.com”,
“path”: “<%= context.path %>”,
“headers”: {
“Authorization”: “Token token=<%= iparam.api_key %>”,
“Content-Type”: “application/json”
}
}
}
Hi Vrushali,
Thanks for joining the freshworks community and posting your query.
502 + “Error in establishing connection” means Freshworks couldn’t reach the host. Usually a bad host, not auth.
The 502 is likely caused by an incorrect iparam.domain value. The field should contain only the subdomain (e.g. acme), not the full URL (https://acme.myfreshworks.com) or the full domain (acme.myfreshworks.com). Re-check the value saved in App Settings, it may have been entered incorrectly after a reinstall.
Quick test:
curl -H "Authorization: Token token=YOUR_KEY" \
"https://YOUR_DOMAIN.myfreshworks.com/path"
Let me know if it still causing problem, you can go ahead and book a 1:1 debugging session with me. https://calendar.app.google/nUM1TGHKjV5Jaymf6
Hi Rohan,
My API works correctly in Postman, but it is failing in my custom app. Even after hardcoding the host (subdomain) value, it still doesn’t work. This exact code was working properly until 2–3 days ago, and it currently runs fine in both Prod and Sandbox—the issue is only happening in my local environment
Hi @Vrushali_Ambre
If you’re connected through a corporate VPN, you may need to allowlist the following IPs: 13.232.159.149 & 13.233.170.242
Freshworks Developer Docs | Use request method to place secure HTTP calls
Once you’ve allowed these IPs, could you try again and let me know if it works?