GraphQL API

Uploads

Upload video and image assets using TUS resumable uploads.

The Rad TV API uses the TUS protocol for resumable file uploads. This ensures large video files can be uploaded reliably, with automatic resume on network interruptions.

Upload Flow

Create an ingestion session

Use createContentAsset to get a TUS upload endpoint:

curl -X POST https://api.rad.live/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "query": "mutation { createContentAsset(id: \"did:rad.live:content/feature/123\", input: { filename: \"video.mp4\", size: 524288000 }) { id endpoint tus { filename } metadata { mimeType } } }"
  }'
const response = await fetch('https://api.rad.live/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY',
  },
  body: JSON.stringify({
    query: `
      mutation {
        createContentAsset(
          id: "did:rad.live:content/feature/123"
          input: { filename: "video.mp4", size: 524288000 }
        ) {
          id
          endpoint
          tus { filename }
          metadata { mimeType }
        }
      }
    `,
  }),
});

const session = (await response.json()).data.createContentAsset;
console.log(session.endpoint); // TUS upload URL
response = requests.post(
    "https://api.rad.live/graphql",
    headers={
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_API_KEY",
    },
    json={
        "query": """
        mutation {
          createContentAsset(
            id: "did:rad.live:content/feature/123"
            input: { filename: "video.mp4", size: 524288000 }
          ) {
            id
            endpoint
            tus { filename }
            metadata { mimeType }
          }
        }
        """
    },
)

session = response.json()["data"]["createContentAsset"]
print(session["endpoint"])  # TUS upload URL

Upload the file

POST the file to the returned endpoint with your API key:

curl -X POST <ENDPOINT_URL> \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@video.mp4"

The endpoint handles TUS protocol chunking and resumability.

Track progress

Check upload status via the ingestion session:

{
  me {
    ingestion(id: "ingestion-id") {
      id
      progress { current total }
      metadata { mimeType filename }
    }
  }
}

ContentAssetInput

FieldTypeRequiredDescription
filenameString!YesFile name with extension
sizeLong!YesFile size in bytes
videoVideoHintInputNoVideo spatial hint

VideoHintInput

ValueDescription
NONEStandard landscape video
PORTRAITVertical/portrait video
EQUIRECTANGULAR360° VR video
CUBEMAPCubemap VR format
STEREOSCOPICStereoscopic 3D

Playlist Assets

Upload images for playlists using createPlaylistAsset:

mutation {
  createPlaylistAsset(
    id: "did:rad.live:content/playlist/456"
    input: { filename: "cover.jpg", size: 2048000 }
  ) {
    id
    endpoint
  }
}

IngestionSession Type

FieldTypeDescription
idIngestionID!Session identifier
endpointURLTUS upload endpoint
tusTUSInfoFile metadata (filename, initiator)
metadataIngestionMetadataMIME type, filename
progressIngestionProgressCurrent/total bytes uploaded

For a simpler upload experience, use the publishVideo compound mutation which handles ingestion session creation automatically. See Publish to Rad.

On this page