Hi n8n Community,
I am trying to connect Facebook Lead Ads with n8n, but I am continuously getting a “401 Unauthorized” error when trying to activate the node or test the connection.
What I have already verified:
- Checked Meta Developer App settings and permissions.
- Verified that the Redirect URL matches perfectly in the Meta App settings.
- Attempted to regenerate the tokens/credentials, but the 401 error persists.
Could someone please guide me on what might be causing this unauthorized token block or if there is a specific permission I am missing in the Meta Business Manager?
Thank you!
Welcome to the n8n community @Pooja_Singh
I would check if the login to n8n is active in the same browser, if cookies are not blocked, and if the public URL used in the editor is exactly the same as configured in N8N_EDITOR_BASE_URL/Meta redirect URL. If n8n is behind a proxy/tunnel, differences between internal domain, public domain, and OAuth callback usually cause this type of error.
Welcome @Pooja_Singh to our community! I’m Jay and I am a n8n verified creator.
For the Facebook Lead Ads “401 Unauthorized” specifically - the most common cause beyond the OAuth callback URL is the leads_retrieval permission not being in Advanced Access on your Meta App. In the Meta App dashboard, go to App Review > Permissions and Features, find leads_retrieval, and confirm it shows “Advanced Access” not “Development Access”. In Development Access, the permission only works for users who are admins/devs of the app itself. Also make sure the Facebook Page is connected to the Meta Business Manager account tied to the app.
@Pooja_Singh check the Page Access Token vs User Access Token split — this is a common cause of Lead Ads 401 that’s not really in most troubleshooting guides. n8n’s OAuth picks the page during connection, but if the page lives under a Business Manager rather than your personal Facebook account, the user→page link sometimes breaks silently and the resulting token only has user scope, not page scope.
fix is to authorize from the Business Manager session: log into business.facebook.com first, confirm your user has Admin or Editor role on the page under Business Settings → Pages → Users, then trigger n8n’s OAuth flow from that same browser session. the page asset gets picked up under the correct link that way.