Get upload URL
Request a presigned URL for uploading a media file directly to storage. The returned URL is valid for 1 hour.
Upload Process:
- Call this endpoint with the filename
- Use the returned
upload_urlto upload your file via HTTP PUT - After successful upload, call
POST /v1/media/{id}/confirmto finalize
Example upload with curl:
curl -X PUT -T "your-file.jpg" -H "Content-Type: image/jpeg" "<upload_url>"POST
/v1/media/uploadfilenamestring
The filename for the media file. Should include the file extension.
Length
1 <= length <= 255content_type?string
The MIME type of the file. If not provided, it will be inferred from the filename extension.
Length
1 <= lengthResponse Body
curl -X POST "https://api.outstand.so/v1/media/upload" \ -H "Content-Type: application/json" \ -d '{ "filename": "product-image.jpg" }'{
"success": true,
"data": {
"id": "9dyJS",
"upload_url": "https://media-bucket.r2.cloudflarestorage.com/...",
"expires_in": 3600
}
}{
"success": false,
"error": "Invalid request",
"details": {
"filename": {
"_errors": [
"Required"
]
}
}
}{
"success": false,
"error": "Internal server error",
"message": "Failed to generate upload URL"
}