Today I learned
YouTube API: containsSyntheticMedia not set after upload
I upload AI-voiced Shorts through the YouTube Data API with status.containsSyntheticMedia: true in videos.insert. The upload works, but the "Altered content" flag in Studio stays off.
The fix is to set the flag in a second call, videos.update on the status part. That call replaces the whole status object, so send every field again. Any field you leave out goes back to its default.
await fetch('https://www.googleapis.com/youtube/v3/videos?part=status', {
method: 'PUT',
headers: { authorization: `Bearer ${token}`, 'content-type': 'application/json' },
body: JSON.stringify({
id: videoId,
status: {
privacyStatus: 'private', // resend, or it changes
selfDeclaredMadeForKids: false,
embeddable: true,
license: 'youtube',
containsSyntheticMedia: true,
},
}),
})
Check status.containsSyntheticMedia in the response and warn if it is still false. Calls made right after a fresh upload can return 409 ABORTED or a 5xx for a while, so retry them with backoff.
Hit this while building the bot that turns my TIL notes into Shorts with a cloned voice.
Docs: https://developers.google.com/youtube/v3/docs/videos#status.containsSyntheticMedia