GraphQL API
YouTube
YouTube OAuth, video import, and cross-publishing via GraphQL.
The Rad TV API provides full YouTube integration — connect accounts via OAuth, browse and import videos, and publish Rad content to YouTube.
For end-to-end workflow guides, see YouTube Cross-Publishing.
YouTube Connection
Check Connection Status
{
me {
youtube {
connected
channelId
channelTitle
channelThumbnail
hasUploadScope
connectedAt
}
}
}OAuth Endpoints
| Endpoint | Method | Description |
|---|---|---|
/youtube/connect | GET | Start OAuth flow (pass token query param or Bearer header) |
/youtube/callback | GET | Google redirects back with auth code |
/youtube/disconnect | POST | Revoke token and remove connection |
Queries
List YouTube Videos
Browse videos on the connected YouTube channel:
{
youtubeVideos(limit: 20) {
videos {
videoId
title
description
thumbnail
publishedAt
duration
viewCount
channelTitle
studioUrl
}
nextPageToken
totalResults
}
}Use pageToken for pagination:
{
youtubeVideos(pageToken: "NEXT_TOKEN", limit: 20) {
videos { videoId title }
nextPageToken
}
}YouTube Publish Job Status
{
youtubePublishJob(id: "job-id") {
id
contentId
status
progress
youtubeVideoId
youtubeUrl
error
createdAt
}
}Mutations
Import from YouTube
Create Rad content from a YouTube video (metadata + thumbnail):
mutation {
createContentFromYouTube(videoId: "dQw4w9WgXcQ") {
id
metadata { title summary }
}
}Import and Publish
Single call to import and publish:
mutation {
importYouTubeAndPublish(input: {
videoId: "dQw4w9WgXcQ"
publish: true
}) {
content { id metadata { title } }
}
}Batch Import
Import multiple videos from your YouTube library:
mutation {
importYouTubeLibrary(input: {
maxResults: 50
publishedAfter: "2024-01-01"
autoPublish: true
}) {
imported
failed
results { videoId contentId status }
}
}Publish to YouTube
Upload Rad content to YouTube:
mutation {
publishContentToYouTube(
id: "did:rad.live:content/feature/123"
privacyStatus: PUBLIC
) {
id
status
youtubeUrl
}
}Privacy Status Options
| Value | Description |
|---|---|
PUBLIC | Visible to everyone |
UNLISTED | Link-only access |
PRIVATE | Visible only to you |
Publish Status Lifecycle
PENDING → UPLOADING → PROCESSING → COMPLETE
On error: PENDING → ERROR
hasUploadScope on YouTubeConnection must be true to publish content to YouTube. If it's false, the user needs to reconnect with upload permissions.