Appearance
File Uploads
The Blond API uses a secure three-step file upload process for optimal performance and security.
The file upload process involves:
- Request a signed upload URL - Get temporary upload credentials
- Upload file directly - Upload file using the provided signed URL
- Register the file - Use the UUID and key from the signed URL response to register the file in the system
This approach enables direct uploads with progress tracking while maintaining security.
Uploading Files
Step 1: Request Signed Upload URL
post
/vapor/signed-storage-url
| Attribute (* required) | Type | Description |
|---|---|---|
content_type * | String | MIME type of the file being uploaded |
The file is always uploaded privately to Blond's storage bucket. The signed URL is valid for 5 minutes.
Example response
json
// HTTP 201 Created
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"bucket": "blond-files",
"key": "tmp/550e8400-e29b-41d4-a716-446655440000",
"url": "https://blond-files.<storage-host>/tmp/550e8400-e29b-41d4-a716-446655440000?X-Amz-Algorithm=...",
"headers": {
"Content-Type": "image/jpeg",
"x-amz-acl": "private"
}
}Step 2: Upload File to Signed URL
Use the signed URL to upload your file directly:
javascript
const response = await fetch(signedData.url, {
method: 'PUT',
headers: signedData.headers,
body: file
});Important Notes:
- Remove the
Hostheader if present (it's automatically set by browsers) - Use PUT method, not POST
- Include all headers from the signed URL response
- Upload progress can be tracked using XMLHttpRequest or axios
Step 3: Register the File
After uploading, use the response data from the signed URL request in subsequent API calls like the ones below. Uploads that are not registered within 24 hours are deleted.
Pass uuid and key exactly as the signed URL response returned them. The request is rejected with 422 Unprocessable Entity when:
keyis nottmp/<uuid>for the submitteduuid- the
uuidhas already been registered (each upload can be registered once)
json
// HTTP 422 Unprocessable Entity
{
"message": "The upload is invalid. Please upload the file again.",
"errors": {
"key": ["The upload is invalid. Please upload the file again."]
}
}File Size Limits
File uploads are subject to size limits. Maximum file size varies by file type and endpoint, and available storage quotas may apply per organization. Refer to specific endpoint documentation for size limits.