Skip to content
postpeg

YouTube API

Upload and schedule YouTube videos through one API

postpeg publishes videos to YouTube through its official API, from the same POST /v1/posts that posts everywhere else. Send the video by public https URL with its text, and put the title and privacy in platform_options.youtube.

  • Publish
  • Schedule
  • Analytics
  • YouTube57/5000
    video

    What changed in the scheduler this week, in four minutes.

    Ready

The example below, checked against YouTube’s rules

Because YouTube needs a title and a video, postpeg checks for both before anything is uploaded, and tells you exactly which field is missing.

What you can do on YouTube

  • Publish. Publish to YouTube now with POST /v1/posts, alone or in the same request as any of the other networks. More on the Posting API.
  • Schedule. Schedule up to a year ahead with scheduled_at, and cancel with DELETE /v1/posts/{id} any time before it goes out. More on the Scheduling API.
  • Analytics. Read impressions, likes, shares and more per post with GET /v1/posts/{id}/analytics, and follower growth with GET /v1/accounts/{id}/analytics. More on the Analytics API.

Not available on YouTube: comments and direct messages. The coverage table shows what each network supports.

YouTube’s rules, checked before sending

A YouTube post can have up to 5,000 characters, counted as people see them (an emoji is one). Media is required: exactly 1 video, no images. It also needs platform_options.youtube.title. postpeg runs these checks on every request, so a post that won’t fit YouTube is refused with a 400 before anything is published, on any network.

YouTube limits as postpeg checks them
Max text5,000 characters
MediaVideo required
ImagesNone
Videos1
Images and video togetherNone
Required optionsyoutube.title
Connects withHosted OAuth

Connecting YouTube accounts

Call POST /v1/accounts/connect with a profile and "platform": "youtube", and send the account’s owner to the URL you get back. It’s valid for 15 minutes. They approve access on YouTube’s own screen and land on your redirect_url with status=success and the new account_id.

The channel owner connects YouTube through the hosted OAuth screen. Videos can take a while to process after upload; the target stays publishing until YouTube is done.

If YouTube ever expires a login, the account turns reconnect_required so you can ask its owner to connect again. More in Profiles and accounts.

Example: a scheduled YouTube post

One request, with an Idempotency-Key so a retry on your side never posts twice. To post to YouTube and other networks together, add more ids to account_ids.

curl https://api.postpeg.com/v1/posts \
  -H "Authorization: Bearer $POSTPEG_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: youtube-example-2026-10-01" \
  -d '{
    "account_ids": [
      "acc_mfz23e4a7s1d5f9g3h6j0k2l8z"
    ],
    "content": "What changed in the scheduler this week, in four minutes.",
    "media": [
      {
        "url": "https://example.com/scheduler-update.mp4",
        "type": "video"
      }
    ],
    "scheduled_at": "2026-10-01T09:00:00Z",
    "platform_options": {
      "youtube": {
        "title": "Scheduler update",
        "privacy": "unlisted"
      }
    }
  }'
Response · 201 Created
{
  "id": "post_mfz2k3v8q1w5e9r4t7y0u2i6o3",
  "content": "What changed in the scheduler this week, in four minutes.",
  "media": [
    {
      "url": "https://example.com/scheduler-update.mp4",
      "type": "video"
    }
  ],
  "platform_options": {
    "youtube": {
      "title": "Scheduler update",
      "privacy": "unlisted"
    }
  },
  "status": "scheduled",
  "scheduled_at": "2026-10-01T09:00:00.000Z",
  "targets": [
    {
      "account_id": "acc_mfz23e4a7s1d5f9g3h6j0k2l8z",
      "platform": "youtube",
      "status": "pending",
      "platform_post_id": null,
      "url": null,
      "error": null,
      "attempts": 0,
      "published_at": null
    }
  ],
  "created_at": "2026-09-24T14:02:11.418Z"
}

From 09:00 the target moves through queued and publishing to published with the live url, or to failed with the reason in error. Temporary failures are retried, up to 5 attempts with growing waits. See Publishing for every status.

Questions

How do I schedule a YouTube post?
Add scheduled_at (ISO 8601, up to a year ahead) to POST /v1/posts. The post waits as scheduled and goes out within a minute of that time. DELETE /v1/posts/{id} cancels it any time before.
What happens if a post breaks YouTube’s rules?
postpeg checks the text (up to 5,000 characters), the media, and platform_options.youtube.title before anything is sent. A post that doesn’t fit comes back as a 400 with every problem listed in issues, and nothing is published on any network.
Which YouTube features does postpeg support?
Publishing, scheduling, analytics. Comments and direct messages are not available on YouTube; asking for them returns a 400 naming the feature.
Is a title required for YouTube?
Yes. platform_options.youtube.title (1–100 characters) is required. Without it the request is refused with a 400 whose issues point at that field.
Can I upload an unlisted or private video?
Yes. Set platform_options.youtube.privacy to public, unlisted or private. It defaults to public.

The same request publishes to all ten networks. Often paired with YouTube:

Or see all 10: X, Instagram, Facebook, LinkedIn, TikTok, Threads, Pinterest, Bluesky and Google Business, in the platform reference.

Send your first post in a few minutes

The 7-day trial has every feature and 3 connected accounts, with no card. The quickstart takes you from a key to a published post.