Generate a presigned URL that allows direct file upload to R2 storage without going through the API server. This is useful for large files or client-side uploads.
This endpoint requires authentication via API key.
Name of the file to upload
MIME type of the file (e.g., ‘audio/mpeg’, ‘audio/wav’)
Size of the file in bytes (for validation)
curl -X POST https://api.verbalisai.com/v1/storage/presigned-upload \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filename": "audio-recording.mp3",
"contentType": "audio/mpeg",
"fileSize": 1048576
}'
Success Response
Error Response
{
"success" : true ,
"data" : {
"uploadUrl" : "https://r2-bucket.domain.com/upload-path?X-Amz-Algorithm=..." ,
"fileKey" : "user123/audio-recording-1642234567.mp3" ,
"expiresIn" : 3600 ,
"maxFileSize" : 1073741824 ,
"allowedContentTypes" : [ "audio/mpeg" , "audio/wav" , "audio/flac" ]
}
}
Response Fields
Indicates if the request was successful
Show Upload Information Object
Presigned URL for direct file upload
Unique file key that will be assigned to the uploaded file
URL expiration time in seconds
Maximum allowed file size in bytes
Array of allowed MIME types for upload
Usage Notes
The presigned URL expires after the specified time (typically 1 hour)
Use PUT method to upload the file to the presigned URL
Include the correct Content-Type header when uploading
File size must not exceed the maximum limit
After successful upload, use the fileKey to reference the file in other API calls