Files
Download file from bucket
Download a file from a bucket. For public files, no authentication is required. For private files, a download token (obtained via signed URL endpoint) is required in the query parameter. Accepts: Token-based authentication via query parameter (for private files), or no authentication (for public files).
GET
/api/bucket/files/{fileId}/downloadSDK setup
Create a client instance. No authentication is required for this endpoint.
import { Configuration, FilesApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const files = new FilesApi(configuration);import { Configuration, FilesApi } from 'mudbase-sdk';
const configuration = new Configuration({
basePath: 'https://cloud.mudbase.dev',
});
const files = new FilesApi(configuration);Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const { data: result } = await files.downloadBucketFile("file_LnkV6fyeCQ60kiAP");const { data: result } = await files.downloadBucketFile("file_LnkV6fyeCQ60kiAP");Playground
liveTest this endpoint with your own credentials. Your requests will be sent to the live API.
No Request Yet
Send a request to see the full inspector
Authentication
Public — No Auth Required
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
fileId | string | Yes | — |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | No | — |
Responses
200File download
403Access denied or invalid token
json
{
"error": "Invalid or expired download token"
}{
"error": "Invalid or expired download token"
}404File not found
json
{
"error": "File not found"
}{
"error": "File not found"
}Errors
| Code | Meaning |
|---|---|
403 | Access denied or invalid token |
404 | File not found |