Get file
Returns metadata about a single file: size, content type, last-modified timestamp, and the public URL on the bucket's custom domain. Does not return the file bytes — fetch the URL directly to download the object.
Path parameters
| Name | Type | Default | Description |
|---|---|---|---|
| bucketIdrequired | string | — | The bucket containing the file. |
| pathrequired | string | — | The file's object key (e.g. `images/logo.png`). |
Example request
import { Buckt } from "@buckt/sdk";
const client = new Buckt({ apiKey: process.env.BUCKT_API_KEY });
const file = await client.files.get(
"bkt_01H8XYZABCDEFGHJKMNPQRSTVW",
"images/logo.png"
);Responses
{
"data": {
"object": "file",
"id": "images/logo.png",
"key": "images/logo.png",
"size": 24531,
"lastModified": "2026-04-25T11:30:00Z",
"contentType": "image/png",
"url": "https://files.example.com/images/logo.png"
},
"error": null,
"meta": null
}