Skip to content
OpenPostDocs
OpenPostDocs
Social integrations

YouTube

Create a Google OAuth client and connect a YouTube channel for video uploads.

OpenPost connects a YouTube channel with Google OAuth and uploads one video per YouTube variant. Google controls who can authorize your app and whether API uploads can be public.

What you need

Set up Google Cloud

  1. Create or select a project in Google Cloud Console, then enable YouTube Data API v3 in APIs & Services → Library. Enable YouTube Analytics API too if you will use Analytics.

  2. In Google Auth Platform, configure the OAuth consent screen, audience, app details, and authorized domains. Add your own Google account as a test user while the app is in testing. In Data Access, add the scopes below; submit for verification when Google requires it.

  3. In Clients (or APIs & Services → Credentials), create an OAuth client ID of type Web application. Add this Authorized redirect URI:

    https://post.example.com/api/v1/accounts/youtube/callback
  4. Save the client and copy its Client ID and Client Secret. Keep the secret in your instance's secret store.

OpenPost requests these scopes. Enter the full URLs in Google Auth Platform when configuring data access:

https://www.googleapis.com/auth/youtube.readonly
https://www.googleapis.com/auth/yt-analytics.readonly
https://www.googleapis.com/auth/youtube.upload
https://www.googleapis.com/auth/youtube
https://www.googleapis.com/auth/youtube.force-ssl

The YouTube Analytics API must be enabled before OpenPost can read channel reports.

Comments, replies, and moderation use youtube.force-ssl, including Google's comment moderation endpoint. After upgrading from v7.13.0 or earlier, add this scope in Google Auth Platform and reconnect existing YouTube accounts to grant it. Adding a scope in Google Cloud alone does not update an existing connection.

Google documents YouTube OAuth and the web-server OAuth client flow.

Save the app in OpenPost

Save these credentials with your own domain and app values:

[
  {
    "provider": "youtube",
    "client_id": "your-google-oauth-client-id",
    "client_secret": "your-google-oauth-client-secret",
    "redirect_uri": "https://post.example.com/api/v1/accounts/youtube/callback"
  }
]

Connect and test

  1. In Settings → Workspace → Social accounts, select YouTube. Sign in with the Google account that owns the target channel, grant consent, and choose the channel returned by Google.
  2. Create a post with one video and select the connected channel. Start with a private upload and confirm that OpenPost reports the result and the video appears in YouTube Studio.
  3. Set title, description, privacy, and other YouTube options on the variant as needed. Choose No for Made for kids to send an explicit negative audience declaration. Not specified leaves that choice to YouTube's channel settings. Contains synthetic media also accepts an explicit Yes or No; Not specified omits the disclosure.

To let YouTube publish a video at a set time, choose Private and fill YouTube publish time (publish_at) with an RFC 3339 timestamp including a timezone, such as 2030-10-12T12:00:00Z. This is a setting for an individual post, not a reusable Social Set default. OpenPost uploads when you publish the post or when its OpenPost schedule runs. YouTube then makes the video public at its publish time. A time in the past makes it public immediately, as described in the YouTube API reference.

OpenPost reports the post as published once the upload completes, even if YouTube's public release is later. First comments and repost automation follow that upload completion, not YouTube's publish time. Test public visibility separately: Google can keep API uploads private even when OpenPost requests another privacy level.

Optional Comments and replies and Analytics start disabled per channel. Enable them only with the required permissions.

Troubleshoot

ProblemCheck
Google blocks consentCheck the consent-screen audience, test-user list, requested scopes, and verification status.
No channel appearsConfirm the signed-in Google identity has a channel available to the app and select the right account in Google's chooser.
Upload fails or stays privateConfirm YouTube Data API v3 is enabled and read Google's error. A new unverified API project can only upload private videos until it passes the YouTube audit.
Redirect mismatchCompare the authorized redirect URI with the JSON and public OPENPOST_APP_URL exactly. Reconnect after changing scopes.

On this page