Title: Issue with PATCH Request for Updating YouTube Video Privacy Status via API
Context:
I am attempting to change the privacy status of a YouTube video from public
to unlisted
using a PATCH request.
- Endpoint:
https://www.googleapis.com/youtube/v3/videos?part=status
- Method:
PATCH
- Authorization:
I am using a valid Bearer token with theyoutube.force-ssl
scope. - Request Body:
{"id": "rOWGJjUUZ6Q","status": {"privacyStatus": "unlisted" }}
What I Tried:
Verified the Video ID:
I confirmed that the video IDrOWGJjUUZ6Q
exists by making a successful GET request to retrieve the video’s current status:GET https://www.googleapis.com/youtube/v3/videos?part=status&id=rOWGJjUUZ6Q
Made a PATCH Request to update the video’s privacy status:
PATCH https://www.googleapis.com/youtube/v3/videos?part=statusAuthorization: Bearer ya29.a0AcM612w9X_EA90n_64XLBguIa_HMwqKpyK9TbZAnm-ky0CaSNzVGzivkmO9Vv_NJlhJziKWLNdEMoTpx5pE8vGjrPePBJmgIFqS2blQjWJsveSjsEeP7qKb8erKHqLvLoXUUZKccLgQQnGjidjTiH1vHhJi4JsnHhe2SoIfMagaCgYKAd8SARASFQHGX2MiAKjW6kcC6NjkyoI_Inm76A0177Content-Type: application/json{"id": "rOWGJjUUZ6Q","status": {"privacyStatus": "unlisted" }}
What I Expected:
I expected the video’s privacy status to change from public
to unlisted
and receive a 200 OK response confirming the update.
What Happened:
Instead, I received a 404 Not Found response, even though the video ID is valid, the video exists, and the OAuth token has the necessary scope for modifying video status.
Minimal Reproducible Example:
Request:
PATCH https://www.googleapis.com/youtube/v3/videos?part=statusAuthorization: Bearer ya29.a0AcM612w9X_EA90n_64XLBguIa_HMwqKpyK9TbZAnm-ky0CaSNzVGzivkmO9Vv_NJlhJziKWLNdEMoTpx5pE8vGjrPePBJmgIFqS2blQjWJsveSjsEeP7qKb8erKHqLvLoXUUZKccLgQQnGjidjTiH1vHhJi4JsnHhe2SoIfMagaCgYKAd8SARASFQHGX2MiAKjW6kcC6NjkyoI_Inm76A0177Content-Type: application/json{"id": "rOWGJjUUZ6Q","status": {"privacyStatus": "unlisted" }}
Response:
{"error": {"code": 404,"message": "Not Found","errors": [ {"message": "Not Found","domain": "global","reason": "notFound" } ] }}
Tags:
- #YouTubeAPI
- #PATCHRequest
- #VideoPrivacyStatus
- #404Error
- #OAuthPermissions