storage
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}/downloadAuthentication
Public — No Auth Required
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
fileId | string | Yes | File ID to download. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
token | string | No | Download token for private files (from signed URL endpoint). |
SDK setup
Create a client instance. No authentication is required for this endpoint.
import { MudbaseClient } from "mudbase";
const client = new MudbaseClient();import { MudbaseClient } from "mudbase";
const client = new MudbaseClient();Example request
Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.
const result = await client.storage.downloadBucketFile({
fileId: "file_aHKademCCocgJZSZ"
});const result = await client.storage.downloadBucketFile({
fileId: "file_aHKademCCocgJZSZ"
});Try It Live
Test 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
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 |