Update bucket
Patches one or more bucket settings. Only the fields you include are changed — everything else is left untouched. Settings that affect S3 (CORS, lifecycle, file-size limit) are applied to AWS as part of the same request.
The response confirms the bucket's id — call
Get bucket to read the updated values.
Path parameters
| Name | Type | Default | Description |
|---|---|---|---|
| idrequired | string | — | The bucket ID to update. |
Body parameters
All fields are optional. Send only the ones you want to change.
| Name | Type | Default | Description |
|---|---|---|---|
| name | string | — | Display name. 1–100 characters. |
| cachePreset | "no-cache" | "short" | "standard" | "aggressive" | "immutable" | — | CDN cache strategy applied to all objects. |
| cacheControlOverride | string | null | — | Raw Cache-Control header to send instead of the preset. Max 256 characters. null restores the preset. |
| corsOrigins | string[] | — | Allow-listed origins for browser uploads. Up to 10 entries. |
| lifecycleTtlDays | number | null | — | Auto-delete objects this many days after upload. Range 1–3650. null disables expiry. |
| maxFileSizeBytes | number | null | — | Reject uploads larger than this size. null applies the default limit for your plan. |
| allowedMimeTypes | string[] | null | — | Allow-listed MIME patterns (e.g. "image/png", "image/*"). Up to 50 entries. null allows any type. |
| optimizationMode | "none" | "light" | "balanced" | "maximum" | — | Image optimization aggressiveness. Anything other than none requires a paid plan. |
Example request
import { Buckt } from "@buckt/sdk";
const client = new Buckt({ apiKey: process.env.BUCKT_API_KEY });
await client.buckets.update("bkt_01H8XYZABCDEFGHJKMNPQRSTVW", {
cachePreset: "aggressive",
corsOrigins: ["https://app.example.com"],
});
// Returns: { object: "bucket", id: "bkt_01H8XYZABCDEFGHJKMNPQRSTVW" }Responses
{
"data": {
"object": "bucket",
"id": "bkt_01H8XYZABCDEFGHJKMNPQRSTVW"
},
"error": null,
"meta": null
}