API ReferenceMedia
Request media upload URL
Request a presigned URL for uploading media. Videos are uploaded to Cloudflare Stream, images are uploaded directly to R2 storage.
After receiving the upload URL, upload your file to it, then call the complete endpoint.
Authorization
bearerAuth AuthorizationBearer <token>
API keys start with cue_sk_ prefix. Get your key from the Cue dashboard.
Example: cue_sk_abc123def456ghi789jkl012mno345pqr678stu901vwx234
In: header
Request Body
application/json
filename*string
Original filename
Length
1 <= length <= 255mimeType*string
File MIME type
Value in
"image/jpeg" | "image/png" | "image/gif" | "image/webp" | "video/mp4" | "video/quicktime" | "video/webm"size*integer
File size in bytes (max 10MB for images, 2GB for videos)
Range
1 <= valueResponse Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.oncue.so/v1/media/upload" \ -H "Content-Type: application/json" \ -d '{ "filename": "product-photo.jpg", "mimeType": "image/jpeg", "size": 1024000 }'{
"data": {
"assetId": "med_x9k4m2n7pqhj",
"uploadUrl": "/v1/media/med_x9k4m2n7pqhj/upload-direct",
"r2Key": "media/usr_x9k4m2n7pqhj/med_x9k4m2n7pqhj/original",
"isVideo": false,
"expiresAt": "2025-01-15T10:10:00Z"
}
}{
"error": "File too large"
}{
"error": "Unauthorized"
}{
"error": "Media storage not configured"
}