YouTube Posting API
Upload videos to YouTube with title, description and privacy set, without writing the upload flow yourself.
- Video uploads with title, description and privacy
- Large files uploaded in resumable chunks
- Channels connect through Google's login
- A webhook when YouTube finishes processing
const pk = new Postkey(process.env.POSTKEY_API_KEY);
await pk.posts.create({
content: "Full walkthrough of the v2 dashboard, chapters in the description.",
mediaItems: [
{
type: "video",
url: "https://cdn.example.com/walkthrough.mp4"
}
],
platforms: [
{
platform: "youtube",
accountId: "acc_yt_654",
platformSpecificData: {
title: "Postkey v2 dashboard walkthrough",
visibility: "public",
madeForKids: false
}
}
],
publishNow: true
});- YouTubeprocessing
YouTube is processing it · webhook on finish
Your first YouTube post in three steps
- 1
Connect YouTube
Your customer signs in through YouTube's own login. You get an account ID, never a password.
- 2
Get the account id
List connected accounts. The id of the new account is the accountId you post with.
- 3
Post
Send the post to /v1/posts with that accountId. The YouTube result comes back in the response and by webhook.
Every YouTube format, one endpoint
Pick a format to see the exact request and what comes back. Options that only make sense on YouTube sit under "youtube".
A regular upload with title, description and privacy.
1POST https://api.postkey.dev/v1/posts2x-access-key: pk_live_…3Content-Type: application/json4 5{6 "content": "Full walkthrough of the v2 dashboard, chapters in the description.",7 "mediaItems": [8 {9 "type": "video",10 "url": "https://cdn.example.com/walkthrough.mp4"11 }12 ],13 "platforms": [14 {15 "platform": "youtube",16 "accountId": "acc_yt_654",17 "platformSpecificData": {18 "title": "Postkey v2 dashboard walkthrough",19 "visibility": "public",20 "madeForKids": false21 }22 }23 ],24 "publishNow": true25}202 · publishing
YouTube processes this first. The final result arrives by webhook.
{
"success": true,
"postId": "post_3k9d2",
"status": "publishing",
"platforms": [
{
"platform": "youtube",
"accountId": "acc_yt_654",
"success": true
}
]
}Everything you need for YouTube posting
Checked against YouTube's rules
Before anything is sent, Postkey checks it against YouTube's published limits:
Resumable uploads
Big files go up in chunks and pick up where they stopped if the connection drops. You just send a URL or a file.
Privacy and audience
Set public, unlisted or private, and the made-for-kids flag YouTube requires, in the same call.
Processing tracked
YouTube processes every upload. You get a webhook when the video is ready, or the reason it was rejected.
Quota-aware queue
Uploads use a large share of YouTube's daily API quota. Postkey queues uploads to stay inside it.
Google login
Channel owners connect through Google's own consent screen. You never see their password.
Also for YouTube
Built in
Connect, publish, get told
Your users connect YouTube through a connect link. If YouTube fails inside a multi-network post, the others still go out and the YouTube credits come back.
Works with your stack
Your code
Node and Python SDKs with the same calls, or plain REST from anything that speaks HTTP.
- Node
- Python
- {}REST
No-code tools
Call the REST API from an HTTP step in n8n, Make or Zapier. One request posts to every network.
- n8n
- Make
- Zapier
AI agents & MCP
The MCP server lets Claude, Cursor and other agent tools publish and schedule posts, and read the results.
- MCP server
Beyond YouTube
Same request shape on every platform. Add an account ID and the post goes there too.
- X Posting APIText · Image · Video · Thread
- Instagram Posting APIFeed post · Reel · Story · Carousel
- Facebook Posting APIText · Photo · Video
- TikTok Posting APIVideo · Photo
- LinkedIn Posting APIText · Image · Document
- You're hereYouTube Posting APIVideo
- YouTube Shorts Posting APIShort
- Pinterest Posting APIPin
- Google Business Posting APIUpdate post · Offer · Event
YouTube posting questions
Something not here? Email hello@postkey.dev.
What can I upload to YouTube?
Regular videos with title, description, privacy and the made-for-kids setting. For vertical short clips, see the YouTube Shorts page.
Why does the response say 'processing'?
YouTube processes every upload before it's watchable. The call returns right away and a webhook follows when it's done.
Why would an upload end up private?
YouTube locks uploads from API projects that haven't passed its audit to private. It's a YouTube rule for all API apps.
Can I set the publish time on YouTube itself?
Yes. Use the scheduling API and the video is uploaded as private with a publish time, so YouTube makes it public on time.
Do large files work?
Yes. Uploads are resumable, so a dropped connection doesn't mean starting over.
Can I schedule YouTube posts instead?
Yes. Add scheduledFor to the same request. See the YouTube Scheduling API page for details.
Post to YouTube for every customer.
Get a key, connect an account, send the request above.
Free while it's early. Read the docs