OverviewPlatformsAPI ReferenceResources
All platforms

YouTube

Social Posting

Publish videos and Shorts to YouTube with the Zernio API, with custom thumbnails, visibility, playlists, COPPA and AI disclosure flags, and description edits after publishing.

Authentication details

Connecting accounts guide

Permissions5 scopes

Always requested
Posting
Analytics
Comments

Pass scopes=posting,analytics to the connect endpoint to ask only for those areas. The first row comes with every connection.

Publish videos and Shorts to YouTube with POST /v1/posts and platform: "youtube". The same account serves analytics and comments.

Quick reference

PropertyValue
Title limit100 characters
Description limit5,000 characters
TagsTop-level tags array on the create request; 100 characters per tag, 500 combined
Videos per post1
Video formatsMP4, MOV, AVI, WMV, FLV, 3GP, WebM
Video max size256 GB
Video max duration15 minutes (unverified channel), 12 hours (verified)
Thumbnail formatsJPEG, PNG, GIF
Thumbnail max size2 MB
Post typesVideo, Shorts
SchedulingYes (a public video is uploaded early as private and released by YouTube at the scheduled time)
Editing published postsYes (description only; title and tags through a separate endpoint)
Inbox (comments)Yes
Comment automationsPublic reply only, read by the comment poll (comment automations)
Inbox (DMs)No (YouTube has no DM system)
AnalyticsYes

Before you start

YouTube requires a channel owned by the Google identity you authorize, on a personal Google account or a Brand Account. See Brand Accounts and multiple channels.

Every post is exactly one video, so there are no image-only or text-only posts.

Unverified channels are limited to 15-minute videos. Verify the channel by phone at youtube.com/verify for longer uploads.

Daily upload quotas vary by channel. Shorts are detected from duration and aspect ratio, not chosen with a flag.

If a channel is suspended, every upload fails with a 403. Call Account health before scheduling posts to a channel you do not control.

Connect

Call GET /v1/connect/youtube with profileId on Get OAuth connect URL.

The connecting accounts guide covers the OAuth flow and scopes in general. Account health reports what a connected account can do with the scopes the user granted.

Brand Accounts and multiple channels

There is no channel picker. YouTube connects straight after Google's OAuth screen.

The channel Zernio connects is the one owned by the Google identity you pick in Google's account chooser. Zernio forces that chooser on every connect (prompt=select_account), so the choice is always yours to make:

  • A channel on your personal Google account: pick your personal identity.
  • A channel that lives on a Brand Account: pick the Brand Account entry in the chooser, not your personal identity. You need owner or manager access to the Brand Account at account.google.com/brandaccounts.
  • YouTube Studio "Manage access" permissions do not grant API access. Someone added as an editor or manager only inside YouTube Studio cannot connect that channel; a Brand Account owner or manager has to do it.

No channel found. The identity you picked may own no channel: a personal identity chosen by mistake, Studio-only access, or no channel created yet. The connect then fails with:

Text
We couldn't find a YouTube channel for the Google account you authorized...

Restart the flow and pick the right entry in the chooser.

Several channels. A profile holds one YouTube channel. To connect another one:

  1. Create a second profile and select it.
  2. Start the YouTube connect again.
  3. Pick the other channel's identity in the chooser.

Each channel then has its own accountId.

Publish a post

This request uploads a public video to YouTube right away. platformSpecificData sets the title, visibility and category.

TypeScript
import Zernio from '@zernio/node';

const zernio = new Zernio();

const { data: published } = await zernio.posts.createPost({
  body: {
    content: 'In this tutorial, I walk through building a REST API from scratch.\n\n#programming #tutorial',
    tags: ['rest api', 'node.js', 'backend tutorial'],
    mediaItems: [{
      type: 'video',
      url: 'https://cdn.example.com/long-form-video.mp4',
      thumbnail: 'https://cdn.example.com/thumbnail.jpg'
    }],
    platforms: [{
      platform: 'youtube',
      accountId: '66b2e19d8c3f5a7e9d0b1c2d',
      platformSpecificData: {
        title: 'Build a REST API from scratch',
        visibility: 'public',
        categoryId: '27',
        madeForKids: false
      }
    }],
    publishNow: true
  }
});

console.log(published.post.platforms[0].platformPostUrl);

Every option is on Videos & Shorts.

In this section

Was this page helpful?

On this page