I'm developing a backend application using a Google Service Account to upload videos to YouTube via the YouTube Data API v3.
The service account is granted OAuth scopes:
https://www.googleapis.com/auth/adwords
https://www.googleapis.com/auth/youtubeI'm able to access the Google Ads API successfully using this service account.
However, when trying to upload a video using the following API:
POST https://www.googleapis.com/upload/youtube/v3/videos?part=snippet,status&uploadType=resumable
I get a 401 Unauthorized error with this response:
"error": {"code": 401,"message": "Unauthorized","errors": [ {"message": "Unauthorized","domain": "youtube.header","reason": "youtubeSignupRequired","location": "Authorization","locationType": "header" } ] }}My question:How can I correctly authorize a Google Service Account to access the YouTube Data API and upload videos?
It seems like YouTube channel ownership is required, but service accounts don't have a YouTube channel by default. Is there a recommended workaround (such as impersonation via domain-wide delegation or OAuth flow with a real user account)?Any guidance from Google engineers or those who’ve dealt with this before would be appreciated.