googleapis / googleapis/google-api-nodejs-client

AI agents cannot invite reviewers to private YouTube videos via YouTube Data API

オープン
#3,932 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
12.2k
フォーク
2k
平均マージ
1日 9時間
マージ済み PR(30日)
24

説明

### Please make sure you have searched for information in the following guides.

- [x] Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- [x] Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- [x] Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- [x] Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- [x] Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- [x] Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- [x] Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples

### A screenshot that you have tested with "Try this API".

Image

Errors from the screenshot:

```
Property "recipients" does not exist in object specification.

You have invalid or missing required parameter values above. If you execute anyway, the response will likely be an error.
```

API response from the screenshot:

```json
{
"error": {
"code": 400,
"message": "'recipients'",
"errors": [
{
"message": "'recipients'",
"domain": "youtube.part",
"reason": "unknownPart",
"location": "part",
"locationType": "parameter"
}
]
}
}
```

### Link to the code that reproduces this issue. A link to a **public** Github Repository or gist with a minimal reproduction.

https://github.com/karlhorky/repro-youtube-api-private-video-recipients

### A step-by-step description of how to reproduce the issue, based on the linked reproduction.

1. Clone the linked reproduction repository.
2. Set `YOUTUBE_ACCESS_TOKEN` to an OAuth access token for the Google account that owns the test video.
3. Set `YOUTUBE_VIDEO_ID` to the ID of a video owned by that account.
4. From the repository root, run:
`YOUTUBE_ACCESS_TOKEN='...' YOUTUBE_VIDEO_ID='...' node index.ts`
5. The script calls the YouTube Data API `videos.update` endpoint directly with `fetch`, using `part=recipients`.
6. The request body includes the video ID and an attempted invited-viewer list.
7. The API rejects the request because `recipients` is not a supported `part`.

Expected: the API supports adding invited viewers to a private YouTube video, or documents the supported equivalent.

Actual: the API rejects the request before any invited-viewer validation can happen, because there does not appear to be a supported API surface for private-video invited viewers.

### A clear and concise description of what the bug is, and what you expected to happen.

AI-agent workflow blocked: AI agents can upload or update private YouTube videos through the API, but cannot invite specific human reviewers to those private videos.

(also applies to regular scripts and other automation)

YouTube Studio supports account-based access control for private videos: a creator can invite specific Google accounts by email address to view a private video.

The YouTube Data API and generated Node.js client do not appear to expose this same capability.

I expected the API to allow automation of the same private-sharing workflow available in YouTube Studio:

- Set a video to Private
- Add invited viewers by email address / Google account
- List invited viewers
- Remove invited viewers

Instead, the API rejects the `recipients` part as unsupported.

This blocks AI agents (for example with [Antigravity CLI](https://antigravity.google/docs/cli-overview) or [Codex CLI](https://developers.openai.com/codex/cli) or [Claude Code](https://claude.com/product/claude-code), etc). A common agentic workflow is:

1. Upload or generate a draft video
2. Keep it private
3. Invite a specific reviewer, client, student or teammate
4. Wait for human review
5. Update the video, publish it later or revoke access

Because the API cannot manage invited viewers, AI agents and other automation systems using private videos are pushed toward:

1. brittle browser automation against YouTube Studio using Playwright MCP or similar
2. unofficial client libraries that depend on undocumented YouTube Studio internals, such as https://github.com/adasq/youtube-studio

### A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

I expect this behavior because YouTube Studio already supports this private-video sharing workflow in the UI:

Video:

https://github.com/user-attachments/assets/4dbacac6-28bb-462c-898f-6ae0a672de67

Screenshots:

Image

Image

Image

The YouTube Data API currently documents `status.privacyStatus` for videos, including `private`, but there does not appear to be a documented way to manage the invited users for a private video:

https://developers.google.com/youtube/v3/docs/videos

This means there is a mismatch between YouTube Studio functionality and the public API/client surface.

A related earlier report also ran into the same missing API surface when trying to use a `recipients` part:

- https://github.com/googleapis/google-api-nodejs-client/issues/3626

Expected behavior:

The API should expose a documented way to manage private-video invited viewers, for example:

- Adding invited viewers: support a `privateSharing` / `recipients` part on `videos.update`, a `videos.permissions.insert` method or another documented endpoint for adding account-based private video access
- Listing invited viewers: support a `privateSharing` / `recipients` part on `videos.list`, a `videos.permissions.list` method or another documented endpoint for reading the current invited-viewer list
- Removing invited viewers: support a `privateSharing` / `recipients` part on `videos.update`, a `videos.permissions.delete` method or another documented endpoint for revoking account-based private video access
- Validating invited viewers: return clear errors for invalid emails, non-Google accounts, quota issues and permission issues

At minimum, the API should support:

- Adding invited viewers
- Listing invited viewers
- Removing invited viewers
- Returning clear validation errors for invalid emails, non-Google accounts, quota issues and permission issues

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンクされた再現リポジトリから開始し、文書化された環境変数を使って index.ts を実行し、part=recipients を指定した直接の videos.update リクエストを調査します。そのリクエストを YouTube videos API のドキュメントおよび関連する issue #3626 と比較します。完了条件は、招待された視聴者の追加、一覧表示、削除を行うための、サポートされている API/クライアントのサーフェスが確認されること、またはそのようなものが存在しないことが明確に文書化されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
node.js, typescript
領域
api
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
32/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。