Fix Facebook API "This IP Can't Make Requests" Errors on Heroku With a Static IP

QuotaGuard Engineering
April 14, 2026
5 min read
Pattern

Add QuotaGuard Static to your Heroku app, set one environment variable, and route your Facebook API calls through a fixed IP that passes the allowlist check every time.

Facebook's Graph API enforces IP-level access controls on certain app configurations. When your app is configured to only allow requests from specific IP addresses, every request must come from an IP you've already registered. Heroku's dynos don't have fixed IPs. They cycle constantly. That IP that worked fine on your laptop this morning won't match what Heroku sends tonight.

Why Heroku Requests Fail Facebook's IP Check

Heroku runs your app on shared infrastructure. Every time a dyno restarts — after a deploy, after a crash, after the daily 24-hour cycle — it comes back on a different machine with a different IP. Heroku publishes a list of IP ranges your traffic might come from, but that list contains thousands of addresses. You can't allowlist all of them on Facebook's side.

Facebook's IP restriction setting exists specifically to prevent unauthorized servers from calling the Graph API on behalf of your app. It works exactly as designed. The problem is that Heroku's ephemeral IP model is fundamentally incompatible with it.

Your local machine works because your home or office IP is static or rarely changes. You added it to the allowlist once and it stays. The moment you deploy to Heroku, you lose that guarantee.

The Fix: One Static IP for All Heroku Outbound Traffic

The clean solution is an outbound proxy that gives all your Heroku API requests a single, stable IP address. You add that IP to Facebook's allowlist once. It never changes. Every request passes.

QuotaGuard Static is built exactly for this. It runs on AWS infrastructure, provides a dedicated static IP, and works as a standard HTTP/HTTPS proxy. Your app connects to the proxy, the proxy forwards the request to Facebook, and Facebook sees the proxy's IP — not whatever ephemeral address Heroku assigned your dyno this morning.

Setup takes about two minutes.

Set Up QuotaGuard Static on Heroku

Add the add-on from your terminal or the Heroku dashboard:

heroku addons:create quotaguardstatic:starter

That command provisions your proxy and injects the QUOTAGUARDSTATIC_URL environment variable into your app. Confirm it's there:

heroku config | grep QUOTAGUARD

You'll see something like:

QUOTAGUARDSTATIC_URL: http://username:password@proxy.quotaguard.com:9293

Now route your Facebook API calls through that proxy. Here's how to do it in Python using the requests library, which is the most common setup we see:

import os
import requests

proxy_url = os.environ.get("QUOTAGUARDSTATIC_URL")

proxies = {
    "http": proxy_url,
    "https": proxy_url,
}

response = requests.get(
    "https://graph.facebook.com/v18.0/me",
    params={"access_token": your_access_token},
    proxies=proxies,
)

print(response.json())

That's the complete change. No new dependencies, no architectural work, no VPC configuration. You're pointing the HTTP client at the proxy. Everything else stays the same.

If you're using Node.js with axios, the pattern is similar:

const axios = require("axios");
const { HttpsProxyAgent } = require("https-proxy-agent");

const proxyUrl = process.env.QUOTAGUARDSTATIC_URL;
const agent = new HttpsProxyAgent(proxyUrl);

const response = await axios.get(
  "https://graph.facebook.com/v18.0/me",
  {
    params: { access_token: yourAccessToken },
    httpsAgent: agent,
  }
);

console.log(response.data);

Add Your Static IP to Facebook's Allowlist

Once the add-on is provisioned, find your assigned static IP in the QuotaGuard dashboard:

heroku addons:open quotaguardstatic

Your static IP is displayed prominently on the dashboard home screen. Copy it.

Then in your Facebook App settings: go to Settings > Advanced > Security > Server IP Allowlist and add the IP. Save. That's the address Facebook will see on every request from your Heroku app from this point forward.

QuotaGuard tip: only route the Facebook API calls through the proxy, not all outbound traffic from your app. It keeps your app faster and makes debugging simpler. If a Facebook call fails, you know the proxy is involved. If a call to your own database fails, you know it's not.

What This Doesn't Fix

A few things worth being clear about:

Webhook inbound traffic is separate. If Facebook sends webhooks to your Heroku app, that's inbound traffic, not outbound. Facebook's IP restriction setting applies to requests your server makes to Facebook, not to requests Facebook makes to you. Inbound webhook verification is handled with the webhook token, not IP filtering.

This won't fix token errors or permission errors. The "This IP can't make requests for that application" error is specifically about IP filtering. If you're seeing OAuth errors, scope errors, or rate limit errors, those are different problems entirely.

Multiple Heroku apps need separate add-on instances. Each Heroku app gets its own QUOTAGUARDSTATIC_URL and its own static IP. If you have a staging app and a production app both calling the Facebook API, you need both IPs in the allowlist, or you need to use the same add-on instance with the same credentials in both apps.

If You Handle Sensitive Data Alongside Facebook API Calls

If your app processes financial data, health information, or anything covered by HIPAA or PCI-DSS, use QuotaGuard Shield instead of QuotaGuard Static. Shield uses SSL passthrough: the TLS connection runs end-to-end between your app and Facebook's servers. QuotaGuard routes the packets but never decrypts them. That distinction matters for compliance audits where a third-party proxy terminating SSL creates a data handling obligation.

The setup is identical. Replace QUOTAGUARDSTATIC_URL with QUOTAGUARDSHIELD_URL and point your HTTP client at that instead. Same code, same pattern, different product.

More on Shield: quotaguard.com/products/quotaguard-shield

Pricing

The Starter plan on the Heroku marketplace is free and is enough for low-volume apps or for confirming the fix works. Paid plans start at $5/month for the Spike tier and go to $19/month for Micro, $49/month for Medium, and $89/month for Large. The difference between tiers is monthly connection volume, not features. Your static IP and the allowlist behavior are the same on every plan.

The Facebook IP allowlist error is a fixable infrastructure problem. One environment variable and two minutes of setup is the entire solution. If you're blocked on Facebook API calls from Heroku right now, start at quotaguard.com/products/pricing and have it working before your next deploy.

QuotaGuard Static IP Blog

Practical notes on routing cloud and AI traffic through Static IPs.

Reliability Engineered for the Modern Cloud

For over a decade, QuotaGuard has provided reliable, high-performance static IP and proxy solutions for cloud environments like Heroku, Kubernetes, and AWS.

Get the fixed identity and security your application needs today.