File Download
APIs used in this document:
/v1/files/:fileId/download-url
POST
JWT
Issue download URL
Overview
File downloads also use the Presigned URL approach, just like uploads. You obtain a time-limited download URL from the bkend API and download the file directly from storage.
Obtain Download URL
POST /v1/files/:fileId/download-url
curl -X POST https://api-client.bkend.ai/v1/files/{fileId}/download-url \
-H "X-API-Key: {pk_publishable_key}" \
-H "Authorization: Bearer {accessToken}"const response = await fetch(`https://api-client.bkend.ai/v1/files/${fileId}/download-url`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'X-API-Key': '{pk_publishable_key}',
},
});
const { url, filename, contentType, size, expiresAt } = await response.json();Path Parameters
fileId
string
✅
File ID
Response (200 OK)
url
string
Presigned URL
filename
string
Original file name
contentType
string
MIME type
size
number
File size in bytes
expiresAt
string
URL expiration time (ISO 8601)
Download Implementation
Browser Download
Programmatic Download
Error Responses
file/not-found
404
File not found
file/access-denied
403
Access denied
common/authentication-required
401
Authentication required
Using in Your App
The bkendFetch helper automatically includes the required headers.
Next Steps
File List — Search for files to download
File Access Permissions — Configure download permissions
Single File Upload — Upload files
Image Optimization — CDN optimization for public images
Last updated