I want to create a YouTube automation workflow in N8n.
But the API isn’t connecting.
I’m getting an error: “Authentication failed.”
Someone please help.
welcome to the n8n community @Prem_Kumar2
I’d start by double-checking the credentials, as this error usually isn’t about the workflow itself.
Personally, I always use Google OAuth2 for YouTube rather than just an API key. I’d suggest making sure the YouTube Data API v3 is actually enabled in your Google Cloud project and that your Redirect URL matches exactly what n8n shows.
Most of the time, I find that just recreating the credential and reconnecting it fixes everything. If it still fails, let me know if you’re using the YouTube node or an HTTP Request, and if you’re on Cloud or self-hosted—I’m happy to help you pinpoint it from there.
Hi @Prem_Kumar2 Welcome!
Consider following this video:
And make sure you are not using a LocalHost.
Hey, good that you’re using OAuth2 like tamy suggested. One thing I’d add: make sure your refresh token is being saved and reused — YouTube API credentials expire every hour, so if n8n’s credential storage doesn’t auto-refresh, you’ll keep hitting auth failures. Also double-check that your app has the youtube.upload scope (not just read). If you’re using an HTTP Request node directly instead of the YouTube node, you might have more control over the refresh flow. What’s your credential type — service account or OAuth2?
