YouTube API
Upload videos to YouTube through the PublishQ API with full metadata control: title, description, custom thumbnail, privacy, tags, COPPA, and AI disclosure.
What you can post
| Type | Supported | Notes |
|---|---|---|
| Video | ✅ | Max 12 hours (verified) or 15 min (unverified). MP4, MOV, AVI, WMV, FLV, 3GPP, WebM. Max 256 GB. |
| Shorts | ✅ | ≤3 min AND vertical (9:16). Auto-detected by YouTube — no flag needed |
| Image | ❌ | YouTube is video-only |
| Text | ❌ | A video file is always required |
Limitations
- Video required. Every YouTube post needs exactly one video file.
- Title max 100 characters. Cannot contain
<or>. - Description max 5000 characters. Cannot contain
<or>. - Tags total max 500 characters. Tags with spaces count as quoted (+2 chars).
- Max duration: 12 hours (verified projects) or 15 minutes (unverified).
YouTube Shorts
There is no separate API endpoint or post type for Shorts. YouTube automatically classifies a video as a Short when it is 3 minutes or shorter with a vertical aspect ratio (9:16). Upload it the same way as any other video.
- Videos under 15 seconds will loop on playback
- Custom thumbnails on Shorts can only be set in YouTube Studio. See Set a custom thumbnail.
Quick start
Upload a video
Get your media ready
curl -X POST https://publishq.com/api/v1/media \
-H "Authorization: Bearer pq_live_..." \
-F "[email protected]"curl https://publishq.com/api/v1/media \
-H "Authorization: Bearer pq_live_..."Pick the id of the video you want to use.
Create the post
curl -X POST https://publishq.com/api/v1/posts \
-H "Authorization: Bearer pq_live_..." \
-H "Content-Type: application/json" \
-d '{
"content": "My video title",
"mediaIds": ["med_abc123"],
"accounts": [
{
"accountId": "acc_youtube_123",
"platformSpecificSettings": {
"description": "Full video description with links and timestamps.\n\n0:00 Intro\n1:30 Main topic",
"privacyStatus": "public",
"categoryId": "28",
"tags": ["tech", "tutorial", "how to"],
"madeForKids": false,
"containsSyntheticMedia": false
}
}
]
}'content is the video title (max 100 characters). The longer description goes in platformSpecificSettings.description.
Title overflow
A content over 100 characters is rejected for YouTube with Title must be under 100 characters. Nothing is trimmed for you, because a video published under a title you did not write is worse than a request that fails. When one caption is going to several platforms, give the YouTube account a postOverrides.content with a title that fits, as the example below does.
Set a custom thumbnail
Upload the image to your media library the same way as the video, then pass its id as thumbnailMediaId in that YouTube account's platformSpecificSettings. Each YouTube account in a post takes its own thumbnail.
curl -X POST https://publishq.com/api/v1/posts \
-H "Authorization: Bearer pq_live_..." \
-H "Content-Type: application/json" \
-d '{
"content": "My video title",
"mediaIds": ["med_video_123"],
"accounts": [
{
"accountId": "acc_youtube_123",
"platformSpecificSettings": {
"description": "Full video description.",
"thumbnailMediaId": "med_thumbnail_456"
}
}
]
}'| Property | Requirement |
|---|---|
| Format | JPEG or PNG |
| Max file size | 50 MB |
| Recommended size | 1280x720 (16:9) |
The thumbnail is set right after the video uploads. Custom thumbnails need a verified YouTube channel. The account's thumbnail in GET /api/v1/posts/{id} says whether it was applied. When YouTube refuses the image, the video is still published, thumbnail.status is FAILED and thumbnail.errorMessage says why, so you can set it in YouTube Studio instead.
To add or replace the thumbnail of a draft or scheduled post, send just the new id for that account in PATCH /api/v1/posts/{id}. Only the settings you send change, so the description, privacy and every other setting keep their values:
curl -X PATCH https://publishq.com/api/v1/posts/post_abc123 \
-H "Authorization: Bearer pq_live_..." \
-H "Content-Type: application/json" \
-d '{
"accounts": [
{
"accountId": "acc_youtube_123",
"platformSpecificSettings": {
"thumbnailMediaId": "med_thumbnail_789"
}
}
]
}'To remove the thumbnail, send "thumbnailMediaId": null. Any other setting is removed the same way, by sending it as null.
Thumbnails on Shorts
YouTube receives the thumbnail of a Short but replaces it with a frame from the Short, even when it is set after processing. Its API does not support Short thumbnails yet, so change them in YouTube Studio. We will update this page once the API supports them.
Post to YouTube + other platforms
When your title works for other platforms but is too long for YouTube's 100-char limit, use postOverrides:
curl -X POST https://publishq.com/api/v1/posts \
-H "Authorization: Bearer pq_live_..." \
-H "Content-Type: application/json" \
-d '{
"content": "This is a longer caption that works great on Instagram and TikTok but exceeds YouTube 100 char limit for titles",
"mediaIds": ["med_abc123"],
"accounts": [
{
"accountId": "acc_youtube_123",
"postOverrides": {
"content": "Short YouTube title"
},
"platformSpecificSettings": {
"description": "Full description for YouTube...",
"privacyStatus": "public"
}
},
{
"accountId": "acc_instagram_456"
}
]
}'Video specs
| Property | Limit |
|---|---|
| Max file size | 256 GB |
| Max duration | 12 hours (verified) / 15 min (unverified) |
| Shorts | ≤3 min AND vertical (9:16). Auto-detected |
| Formats | MP4, MOV, AVI, WMV, FLV, 3GPP, WebM |
| Title | Max 100 characters |
| Description | Max 5000 characters |
| Tags | Max 500 characters total |
| Privacy | public, unlisted, private |
Platform settings
| Field | Type | Description |
|---|---|---|
description | string (optional) | Video description. Max 5000 characters. Shown below the video title on the watch page. |
privacyStatus | enum (optional) | Video privacy status. Defaults to public. Unverified API projects are restricted to private. |
madeForKids | boolean (optional) | Declare the video as made for kids (COPPA). When true, personalized ads are disabled and some features (comments, notifications) are turned off. |
containsSyntheticMedia | boolean (optional) | Disclose that the video contains realistic altered or synthetic (AI-generated) content. |
categoryId | enum (optional) | YouTube video category. Defaults to "22" (People & Blogs). Valid IDs: 1 (Film & Animation), 2 (Autos & Vehicles), 10 (Music), 15 (Pets & Animals), 17 (Sports), 19 (Travel & Events), 20 (Gaming), 22 (People & Blogs), 23 (Comedy), 24 (Entertainment), 25 (News & Politics), 26 (Howto & Style), 27 (Education), 28 (Science & Technology), 29 (Nonprofits & Activism). |
tags | pipe | Keyword tags for the video. Duplicates are removed. Total of all tags must be under 500 characters. Tags with spaces count as quoted (2 extra chars). Commas between tags also count. |
embeddable | boolean (optional) | Whether the video can be embedded on other websites. Defaults to true. |
playlistId | string (optional) | Playlist ID to add the video to after upload. |
thumbnailMediaId | string (optional) | ID of an image in your media library to set as the custom thumbnail of this video. JPEG or PNG, up to 50MB; YouTube recommends 1280x720 (16:9). Upload the image with the media endpoints first. The thumbnail is set right after the video uploads. If YouTube refuses it (custom thumbnails need a verified channel), the video still publishes and `thumbnail` on the account says why. To replace it on a draft or scheduled post, update the account with the new id; to remove it, send `thumbnailMediaId: null`. |
Posting from the PublishQ app
Posting from the app rather than the API? Posting to YouTube in the Help Center walks through the same options on screen.
Not yet supported
- Adding to playlists after upload
- Captions / subtitles