Uploads a video to YouTube and optionally sets the video's metadata.
This method requires a media upload using the Upload URI; metadata-only requests fail with 400 badRequest. Uploaded files must conform to these constraints:
- Maximum file size:
256 GiB(about 275 GB) - Accepted media MIME types:
video/*,application/octet-stream
Every part included in the Video request body must also appear in the part query parameter. No request body properties are required: omitted snippet.title defaults to the Slug HTTP header or "unknown", omitted snippet.categoryId uses the default category, and omitted status.privacyStatus defaults to public.
Writable parts are brandPartner, localizations, paidProductPlacementDetails, recordingDetails, snippet, and status. Within those parts, fields marked Output only. on the Video resource can't be set.
Quota impact: A call to this method uses the dedicated Video Uploads quota bucket (1 unit per call, with default limits of 100 uploads per day and 100 per minute per project).
For method-specific error responses, see videos.insert errors. For code examples, see videos.insert code snippets.
HTTP request
- Upload URI, for media upload requests:
POST https://youtube.googleapis.com/upload/youtube/v3/videos - Metadata URI, for metadata-only requests:
POST https://youtube.googleapis.com/youtube/v3/videos
The URL uses gRPC Transcoding syntax.
Query parameters
| Parameters | |
|---|---|
notifySubscribers |
Indicates whether YouTube should notify channel subscribers about the new video. Set to |
part[] |
Required. Serves two purposes in this operation: it identifies the properties that the write operation sets as well as the properties that the API response includes. Accepted values are |
onBehalfOfContentOwner |
Indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter can only be used in a properly authorized request and is intended exclusively for YouTube content partners. You must also specify |
onBehalfOfContentOwnerChannel |
Specifies the YouTube channel ID of the channel to which a video is being added. This parameter can only be used in a properly authorized request and is intended exclusively for YouTube content partners. This parameter is required when |
Request body
The request body contains an instance of Video.
Response body
If successful, the response body contains an instance of Video.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/youtubehttps://www.googleapis.com/auth/youtubepartnerhttps://www.googleapis.com/auth/youtube.force-sslhttps://www.googleapis.com/auth/youtube.upload
For more information, see the OAuth 2.0 Overview.