Skip to main content
The YouTube API in SocialAPI connects a YouTube channel. It uploads, schedules, edits, and deletes videos, reads and moderates comments, posts replies and top-level comments, and reads channel stats. SocialAPI’s own Google app connects the channel, so you register nothing: see Platform apps.

At a glance

Capabilities

An unsupported call returns 501 resource.not_supported. The cross-platform matrix is on Platforms.

Connect an account

Connect with POST /v1/accounts/connect and "platform": "youtube". The shared flow, request fields, and result are in Connect accounts, and the redirect parameters are in Redirect parameters.
Response (HTTP 202):
YouTube-specific rules:
  • One account per channel. Each connected youtube account is 1 YouTube channel. When the Google login manages more than 1 channel, one authorization connects all of them, and the redirect carries their IDs in account_ids. Without brand_id, each channel connects into its own new brand. With a brand_id, the brand takes one channel and each further channel ends with error=account.already_linked: see Reconnect an account.
  • A login with no channel. A Google login that has no YouTube channel ends with status=error and error=platform.youtube.no_channels on your redirect_uri.
  • Reconnect. When YouTube no longer accepts the saved connection, calls return 401 platform.youtube.auth. See Reconnect an account.

Read videos and channel stats

GET /v1/posts?platform=youtube&account_ids={account_id} lists the channel’s videos with their permalink and engagement metrics: see YouTube publishing. GET /v1/platforms/youtube/accounts/{id}/summary returns the channel’s aggregate stats:
Response (HTTP 200):
POST /v1/platforms/youtube/accounts/{id}/sync re-reads the channel’s videos at once and returns {"success": true}. Use it after you upload a video outside SocialAPI.

Comments

YouTube comments are read per video. A video is identified by its YouTube video ID, which is the {postId} in the comment paths. For the cross-platform endpoints, see Comments. This section lists what is specific to YouTube.
Response (HTTP 200):
These query parameters apply to YouTube only: YouTube-specific behavior:
  • Videos with comments. GET /v1/inbox/comments lists commented videos only when you pass account_id. The list is 1 page with no cursor.
  • Comments turned off. Listing the comments of a video with comments turned off returns 422 platform.youtube.comments_disabled. Retrying does not help: stop polling the video until the channel owner turns comments back on in YouTube Studio. After that, the error can continue for up to 24 hours.
  • Reply or top-level comment. POST /v1/inbox/comments/{postId} with comment_id replies to that comment. Without comment_id, it posts a new top-level comment on the video. Each costs 1 interaction credit.
  • Hide. POST /v1/inbox/comments/{postId}/{commentId}/hide sets the comment to rejected, which removes it from public view. DELETE on the same path sets it back to published.
  • Moderate. POST /v1/platforms/youtube/comments/{commentId}/moderate sets the status explicitly.
  • Delete. DELETE /v1/inbox/comments/{postId}/{commentId} removes a comment your channel wrote. capabilities.can_delete is true on every YouTube comment, including other people’s. Deleting another person’s comment returns 422 platform.youtube.processing_failure. Hide it instead.
  • Like and private reply. Not available. can_like and can_private_reply are false.

Moderate a comment

Response (HTTP 200):
A missing account_id or post_id returns 400 validation.field_required.

Edit your own comment

Response (HTTP 200):
account_id, post_id, and text are all required. A missing one returns 400 validation.field_required. YouTube accepts the edit only on a comment your channel wrote.

Webhook events

YouTube sends nothing to SocialAPI, so it emits no comment events: read comments with the endpoints above. Every post.* event in Webhook events is emitted for videos you publish through SocialAPI. You also receive account.connected when you connect a channel, account.disconnected when SocialAPI flags the channel, and account.updated when the account loses permissions you did not remove yourself. See Webhook events.

Suspended or closed channels

When YouTube suspends or closes the account or its channel, every call on it returns 403 platform.youtube.account_suspended. The saved connection is still valid, so reconnecting changes nothing: the owner resolves the suspension with YouTube. SocialAPI sets the account’s reconnect_reason to youtube_account_suspended, and sends an account.disconnected event with that reason.

Limits

The publishing rules are in YouTube publishing.

Scopes

SocialAPI’s Google app requests this scope at connect. You apply for no Google app review. The consent screen is the same whichever permissions you select. YouTube asks for 1 scope that covers reading and writing, so the consent screen shows it whatever you select. The account is still limited to the permissions you selected: an account connected with comments.read alone cannot reply to comments. A call the granted scope does not permit returns 403 platform.youtube.insufficientPermissions. Reconnect the account to grant it again.
Last modified on October 19, 2026