You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用企业账户通过YouTube API上传视频时遇错误求助

Hey there! Let's unpack your problem and explain service accounts clearly, since that's probably a key piece you're missing here.

What Exactly is a Service Account?

A service account is a special type of Google account built for server-to-server, automated, or unattended tasks—it’s not meant for human users to log into like your personal Gmail or company email. It has a unique email format (something like your-service-account@your-project.iam.gserviceaccount.com) and uses a JSON key file for authentication instead of the standard OAuth login flow.

The biggest perk? You don’t need to manually approve permissions every time the app runs. It’s perfect for things like scheduled video uploads, automated content updates, or any task that needs to operate without human interaction.

Why Your Company Email OAuth Setup is Failing

Since your personal Gmail works fine but your name@company.com (a Google Workspace account) doesn’t, the issue almost certainly ties to Google Workspace’s stricter permission controls:

  • Your Workspace admin might have blocked unapproved third-party apps from accessing Google APIs like YouTube. Many companies lock this down to prevent data leaks.
  • If your OAuth app is still in "Testing" mode, Google only lets pre-approved test users access it. If your company email isn’t on that test list, it’ll throw errors when you try to upload.
  • You might not have the right permissions on the target YouTube channel. Make sure your company email is listed as an Owner or Manager of the channel you’re trying to upload to.
Should You Use a Service Account Instead?

It depends on your use case:

  • If you need unattended, automated uploads (no one has to click "Allow" every time), then yes—service accounts are made for this. But note:
    • Service accounts can’t link to personal YouTube channels; they only work with channels owned by a Google Workspace organization.
    • Your Workspace admin has to set this up: they need to grant the service account access to the YouTube channel (by adding it as a channel manager) and enable domain-wide delegation if needed.
  • If you’re okay with manual OAuth approval (someone logs in with the company email once to grant permissions), then fixing the OAuth setup is the way to go.
Fixing Your Current OAuth Upload Issue

If you want to stick with the company email OAuth flow, try these steps:

  1. Check with your Workspace admin: Ask them to verify that the YouTube Data API v3 is allowed for your organization, and that your OAuth app is approved.
  2. Move your app out of Testing mode: Go to the Google Cloud Console, find your OAuth app, and submit it for Google's verification process. This lets any user in your Workspace (or the public, if you want) access it.
  3. Verify channel permissions: Double-check that your name@company.com account is an Owner or Manager of the YouTube channel you're uploading to. You can confirm this in YouTube Studio under Settings > Permissions.
  4. Check API scopes: Make sure your app is requesting the correct scope for uploads—use https://www.googleapis.com/auth/youtube.upload (minimum required) or https://www.googleapis.com/auth/youtube (full access).

内容的提问来源于stack exchange,提问作者Webtect

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:47:04