Appearance
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/upload
Request Body
application/json
filenamestring
The filename for the media file. Should include the file extension.
Length1 <= length <= 255
content_type?string
The MIME type of the file. If not provided, it will be inferred from the filename extension.
Length1 <= length
Response Body
200application/json
400application/json
500application/json
JavaScript
Go
Java
C#
cURL
TypeScript
Python
Swift
const body = JSON.stringify({
"filename": "product-image.jpg"
})
fetch(" {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body
})200400500
{
"success": true,
"data": {
"id": "9dyJS",
"upload_url": "
"expires_in": 3600
}
}{
"success": false,
"error": "Invalid request",
"details": {
"filename": {
"_errors": [\
"Required"\
]
}
}
}{
"success": false,
"error": "Internal server error",
"message": "Failed to generate upload URL"
}Get post replies/comments GET\ \ Previous Page Confirm upload POST\ \ Next Page