Taskwind
Start free trial

YouTube upload API: videos.insert, quota and limits (2026)

By Natnael Girma ยท Published

To upload a video through the YouTube API, you call videos.insert in the YouTube Data API v3 with an OAuth token that has the youtube.upload scope, usually through a resumable upload: one request with the metadata, then one or more requests with the file. As of December 2026, each Google Cloud project gets 100 videos.insert calls per day by default, in their own quota bucket, and videos from unverified projects are no longer locked to private.

Those last two facts are recent. Many guides still say an upload costs 1,600 quota units and that unaudited apps can only upload private videos. Both stopped being true in the last year, so this guide starts with what changed.

What changed in 2025 and 2026

From the YouTube Data API revision history:

Date Change
December 4, 2025 The quota cost of an upload dropped from about 1,600 units to about 100 units
June 1, 2026 videos.insert and search.list moved to their own quota buckets
November 2, 2026 Uploads from unverified API projects are no longer restricted to private viewing, reversing the July 28, 2020 policy
November 3, 2026 thumbnails.set can set custom thumbnails on Shorts after processing
November 16, 2026 paidProductPlacementDetails.hasPaidProductPlacement no longer defaults to false

The videos.insert reference now reads 100 calls per day at 1 unit each in the Video Uploads bucket. Under the old rules, the default 10,000 units bought about 6 uploads a day. Now you get 100 uploads a day, and the 10,000 units are left for everything else.

What you need

  1. A Google Cloud project with the YouTube Data API v3 enabled.
  2. An OAuth 2.0 client (web application for a server) and a configured consent screen.
  3. A scope that allows uploads. https://www.googleapis.com/auth/youtube.upload is the narrowest. youtube, youtube.force-ssl and youtubepartner also work.
  4. A YouTube channel on the Google account that signs in.

Google's OAuth rules that catch people out

Step 1: Get an access token with a refresh token

Send the user to Google's consent page. access_type=offline asks for a refresh token, and prompt=consent makes Google return one even if the user approved your app before:

https://accounts.google.com/o/oauth2/v2/auth
  ?client_id=<CLIENT_ID>
  &redirect_uri=<REDIRECT_URI>
  &response_type=code
  &access_type=offline
  &prompt=consent
  &scope=https://www.googleapis.com/auth/youtube.upload
  &state=<STATE>

Exchange the code on your server:

curl -X POST https://oauth2.googleapis.com/token \
  -d code=<CODE> \
  -d client_id=<CLIENT_ID> \
  -d client_secret=<CLIENT_SECRET> \
  -d redirect_uri=<REDIRECT_URI> \
  -d grant_type=authorization_code

Store the refresh_token and use it to get new access tokens with grant_type=refresh_token.

Step 2: Start a resumable upload

The resumable upload guide starts with a POST that carries the video's metadata and the file's size and type:

curl -i -X POST \
  "https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  -H "X-Upload-Content-Length: 3000000" \
  -H "X-Upload-Content-Type: video/mp4" \
  -d '{
    "snippet": {
      "title": "My video title",
      "description": "This is a description of my video",
      "tags": ["cool", "video"],
      "categoryId": "22"
    },
    "status": {
      "privacyStatus": "public",
      "selfDeclaredMadeForKids": false
    }
  }'

A 200 OK response has an empty body and a Location header. That URL is your upload session.

Step 3: Upload the file

curl -X PUT "$UPLOAD_URL" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: video/mp4" \
  -H "Content-Length: 3000000" \
  --data-binary @video.mp4

A 201 Created response returns the video resource, including its id. The video is at https://www.youtube.com/watch?v={id}, though it still has to process.

Resuming a failed upload

If the connection drops or you get a 500, 502, 503 or 504, ask how much arrived by sending an empty PUT with Content-Range: bytes */3000000. A 308 Resume Incomplete response includes a Range header such as bytes=0-999999. Send the rest starting at the next byte with Content-Range: bytes 1000000-2999999/3000000. Use exponential backoff between retries. Session URIs expire, and a request to an expired one returns 404, so start the upload as soon as you get the URI.

The metadata that matters

From the videos resource:

Property Rules
snippet.title Required, up to 100 characters, no < or >
snippet.description Up to 5,000 bytes, not characters. Emoji and accented letters use more than one byte each.
snippet.tags Up to 500 characters in total, counting commas, and quotes around tags with spaces
snippet.categoryId A category ID from videoCategories.list
status.privacyStatus public, unlisted or private. Defaults to public if you leave it out.
status.publishAt Schedule time in ISO 8601 (see below)
status.selfDeclaredMadeForKids Declares the video as made for kids or not
status.containsSyntheticMedia Discloses realistic altered or synthetic content
paidProductPlacementDetails.hasPaidProductPlacement Set to false explicitly if the video has no paid placement. It no longer defaults to false.

The maximum file size is 256 GB, and the accepted types are video/* and application/octet-stream. Add notifySubscribers=false to the request URL if you are uploading a back catalog and do not want to ping every subscriber.

Leaving privacyStatus out does not guarantee a public video. Google notes that some uploads may default to private based on the creator's account settings.

Schedule a video with publishAt

Upload the video as private and set status.publishAt:

"status": {
  "privacyStatus": "private",
  "publishAt": "2026-12-15T15:00:00Z"
}

publishAt only works on private videos that have never been published. A time in the past publishes immediately. When you change it later with videos.update, you must send privacyStatus: "private" again even though the video is already private.

Uploading Shorts

There is no Shorts endpoint or flag. You upload through videos.insert like any other video, and YouTube decides. Per YouTube Help, a video uploaded after October 15, 2024 counts as a Short if it has a square or vertical aspect ratio and is up to three minutes long. Since November 3, 2026, you can also set a custom Shorts thumbnail with thumbnails.set once processing is done. Sending the same vertical video to TikTok works very differently, and our TikTok posting API guide covers that flow.

Quota math

The quota cost table gives every project three default allowances: 100 videos.insert calls, 100 search.list calls and 10,000 units for everything else, resetting at midnight Pacific Time. Invalid requests still cost at least one point.

A worked example for a channel tool that uploads 40 videos a day, each with a custom thumbnail and one status check:

Call Bucket Per video 40 videos
videos.insert Video Uploads 1 call 40 of 100
thumbnails.set General 50 units 2,000 of 10,000
videos.list General 1 unit 40 of 10,000

That fits the default quota. At 100 uploads a day you hit the upload bucket, and thumbnails would use half the general bucket. Above that, YouTube's quota and compliance audits page says you must first pass an audit of your project's compliance with the YouTube API Services Terms of Service, through the Audit and Quota Extension Form. Google publishes no price for the Data API. The limit is quota, not money.

Common errors

Error Meaning Fix
quotaExceeded (403) A daily bucket is used up Wait for the midnight PT reset, or request more quota
uploadLimitExceeded (400) The user has hit the number of videos they may upload Wait; this limit is on the user's account, not your project quota
invalidTitle, invalidDescription, invalidTags (400) Metadata breaks a length or character rule Check the table above, especially the byte limit on descriptions
invalidPublishAt (400) Bad schedule time or the video is not private Send privacyStatus: "private" with an ISO 8601 time
forbiddenPrivacySetting (403) Privacy value not allowed Use public, unlisted or private
invalid_grant on refresh Refresh token expired or revoked Check for Testing mode's 7-day expiry; have the user reconnect
404 on the upload URL Resumable session expired Start a new session

What we ran into building this

Taskwind's YouTube connector uses this exact flow. A few details from running it:

The same upload through Taskwind

With Taskwind, you connect a channel through Google sign-in once, then upload with two REST calls. First the file:

curl -X POST https://taskwind.ai/v1/media \
  -H "Authorization: Bearer $TASKWIND_API_KEY" \
  -H "Content-Type: video/mp4" \
  --data-binary @video.mp4

Then the post. The first line becomes the title and the full text the description:

curl -X POST https://taskwind.ai/v1/posts \
  -H "Authorization: Bearer $TASKWIND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content":"How we pack 200 orders an hour\nA walk through the new packing line.","account_ids":["acc_..."],"media_ids":["med_..."],"scheduled_at":1798000000}'

Taskwind holds scheduled posts and uploads them at scheduled_at, rather than using publishAt. The response includes a targets array with the status, video link and any error per account, and the same call can send the video to your Facebook, Instagram, Threads or Telegram accounts too. See the REST API docs.

The limits are worth knowing. Taskwind uploads are public, with no unlisted, private or publishAt option. Files must be under 95 MB. It does not set tags, categories, custom thumbnails or playlists, and it has no analytics yet. If you need those, call videos.insert directly. Plans start at $49/month with a 7-day trial (pricing).

Questions

Can I upload to YouTube with an API key instead of OAuth?

No. The videos.insert reference requires authorization with one of the YouTube OAuth scopes, so you need an OAuth 2.0 token from the channel owner.

Can I upload to someone else's channel?

Only if the channel owner signs in to your app and grants the scope. The video always goes to the channel that authorized the token.

Do I still need a YouTube API audit?

Not to make uploads public. YouTube's audit page now says you don't need an audit to upload public or unlisted videos within the default quota, but you do need one to get more than the default 100 uploads a day.