Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.social-api.ai/llms.txt

Use this file to discover all available pages before exploring further.

Available Managed connector - SocialAPI handles the Google Cloud project and YouTube Data API access for you. No customer-side Google Cloud setup required. See Platform credentials.

At a glance

FieldValue
Platform slugyoutube
Auth typeOAuth 2.0 (Google)
APIYouTube Data API v3
Best forComment moderation and metadata on owned YouTube channels.

Capabilities

FeatureSupportedNotes
List postsYesReturns uploaded videos
CommentsYesScoped to a specific video
Reply to commentYes
Comment replies (thread)Yes
Moderate comment (hide/delete)YesHide sets moderation status; delete removes permanently
Like commentNoNot supported by YouTube API
Private replyNoNot applicable
DMsNoNot supported by platform
ReviewsNoNot applicable
MentionsNoNot supported via YouTube API
Create postYesUpload and publish videos
Update postYesUpdate title, description, tags, privacy, and other metadata
Delete postYes

Connecting

curl -X POST https://api.social-api.ai/v1/accounts/connect \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "youtube",
    "metadata": {
      "redirect_uri": "https://app.example.com/oauth/callback"
    }
  }'
Response:
{
  "auth_url": "https://accounts.google.com/o/oauth2/v2/auth?client_id=...&state=...",
  "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2"
}
Redirect your user to auth_url. After they authorize, Google redirects to your redirect_uri with ?code=...&state=.... Then call:
curl -X POST https://api.social-api.ai/v1/oauth/exchange \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "youtube",
    "code": "4/0AanRR...",
    "metadata": {
      "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2",
      "redirect_uri": "https://app.example.com/oauth/callback"
    }
  }'

Reading samples

List posts

curl "https://api.social-api.ai/v1/posts?account_ids=acc_01HZ9X3Q4R5M6N7P8V2K0W1J" \
  -H "Authorization: Bearer $SOCAPI_KEY"

List comments on a post

curl "https://api.social-api.ai/v1/inbox/comments/{videoId}" \
  -H "Authorization: Bearer $SOCAPI_KEY"
Sample response:
{
  "data": [
    {
      "id": "sapi_cmt_eW91dHViZTpVZ3h...",
      "platform": "youtube",
      "type": "comment",
      "author": {
        "id": "UCxyz123",
        "name": "Jane Smith",
        "avatar_url": "https://yt3.ggpht.com/..."
      },
      "content": {
        "text": "Great video!"
      },
      "metadata": {
        "post_id": "dQw4w9WgXcQ",
        "like_count": 5,
        "has_replies": true
      },
      "created_at": "2026-03-15T10:30:00Z",
      "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
      "platform_id": "Ugxyz..."
    }
  ],
  "count": 1
}

Publishing

Create a video post by providing a video URL and optional metadata via platform_data. See the API reference for the full request schema.
curl -X POST https://api.social-api.ai/v1/posts \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_ids": ["acc_01HZ9X3Q4R5M6N7P8V2K0W1J"],
    "text": "Check out our latest video!",
    "media_ids": ["https://cdn.example.com/video.mp4"],
    "visibility": "public",
    "platform_data": {
      "youtube": {
        "category_id": "22",
        "tags": ["tutorial", "demo"],
        "made_for_kids": false,
        "embeddable": true,
        "notify_subscribers": true
      }
    }
  }'

PlatformData fields

Pass these inside platform_data.youtube when creating or updating a post.
FieldTypeDefaultDescription
category_idstring"22" (People & Blogs)YouTube video category ID. See YouTube category list.
tagsstring[]noneVideo tags for discoverability.
default_languagestringnoneBCP-47 language code (e.g. "en", "fr").
made_for_kidsboolfalseWhether the video is made for children (COPPA).
embeddablebooltrueWhether the video can be embedded on other sites.
licensestring"youtube""youtube" for standard YouTube license, "creativeCommon" for CC BY.
public_stats_viewablebooltrueWhether view counts and likes are publicly visible.
publish_atstringnoneRFC 3339 timestamp for scheduled publish (e.g. "2026-04-10T15:00:00Z"). Only applies when visibility is "private".
recording_datestringnoneDate the video was recorded, in YYYY-MM-DD format.
contains_synthetic_mediaboolfalseWhether the video contains AI-generated or synthetic content.
notify_subscribersbooltrueWhether to send a notification to channel subscribers.
playlist_idstringnoneYouTube playlist ID. The video is added to this playlist after publishing.

Limitations and gotchas

  • No DMs or mentions. YouTube does not expose a messaging or mention API. These endpoints return 501.
  • No webhook handler. YouTube does not push real-time events. Posts and comments are fetched on demand.
  • Comment moderation. Hide sets the comment’s moderation status (held for review). Delete removes it permanently. Like is not supported.
  • Token refresh. Google OAuth tokens expire. SocialAPI handles refresh automatically. If you receive 401 with code: "invalid_token", reconnect the account.

Permissions

SocialAPI’s managed Google Cloud OAuth app already requests YouTube Data API v3 scopes for reading and managing comments on your owned channels. You don’t need to set up a Google Cloud project. See Platform credentials.