Error
A valid request URL is required to generate request examples{
"success": true,
"data": {
"uploadUrl": "<string>",
"token": "<string>",
"publicUrl": "<string>",
"blobName": "<string>"
}
}Uploads
Mint signed upload URL
Get a direct-to-storage signed upload URL for large files, then register the finished upload as a media library asset.
POST
/
uploads
/
signed-url
Error
A valid request URL is required to generate request examples{
"success": true,
"data": {
"uploadUrl": "<string>",
"token": "<string>",
"publicUrl": "<string>",
"blobName": "<string>"
}
}Mints a short-lived signed upload URL so the file bytes go directly to
storage without passing through the API server. Use this for files too large
for POST /uploads (or whenever you want to
skip the server hop).
The 3-step flow
1
Mint the URL
POST /uploads/signed-url with a fileName. The response contains
uploadUrl and blobName.2
PUT the file bytes
PUT the raw file to uploadUrl with the correct Content-Type header.3
Register the asset
POST /uploads/complete with the
blobName — this verifies the object exists and records it in your media
library.The upload is not in your library until you call
/uploads/complete. Unregistered blobs are
not listed and cannot be managed via the API.Example
# 1. Mint
RESPONSE=$(curl -s -X POST "https://mvp2.tryunsora.com/api/v1/uploads/signed-url" \
-H "Authorization: Bearer uns_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "fileName": "big-video.mp4" }')
UPLOAD_URL=$(echo "$RESPONSE" | jq -r .data.uploadUrl)
BLOB_NAME=$(echo "$RESPONSE" | jq -r .data.blobName)
# 2. PUT the bytes straight to storage
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: video/mp4" \
--data-binary @big-video.mp4
# 3. Register the asset
curl -X POST "https://mvp2.tryunsora.com/api/v1/uploads/complete" \
-H "Authorization: Bearer uns_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d "{ \"blobName\": \"$BLOB_NAME\", \"fileName\": \"big-video.mp4\" }"
The Unsora CLI does this automatically:
unsora upload ./big-video.mp4.
