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

EndpointMethodDescription
/youtube/connectGETStart OAuth flow (pass token query param or Bearer header)
/youtube/callbackGETGoogle redirects back with auth code
/youtube/disconnectPOSTRevoke 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

ValueDescription
PUBLICVisible to everyone
UNLISTEDLink-only access
PRIVATEVisible only to you

Publish Status Lifecycle

PENDINGUPLOADINGPROCESSINGCOMPLETE

On error: PENDINGERROR

hasUploadScope on YouTubeConnection must be true to publish content to YouTube. If it's false, the user needs to reconnect with upload permissions.

On this page