Import buckets
Imports existing S3 buckets in the connected AWS account so Buckt can serve
files from them. For each bucket Buckt reads its region, CORS, and lifecycle
settings, then creates an active Buckt record with isImported: true and
managedSettings defaulting to false for every toggle.
Path parameters
| Name | Type | Default | Description |
|---|---|---|---|
| idrequired | string | — | The AWS account record ID. Must be `active` (validated) for this call to succeed. |
Body parameters
| Name | Type | Default | Description |
|---|---|---|---|
| bucketNamesrequired | string[] | — | S3 bucket names to import. 1–50 entries per request. Each becomes a Buckt-managed bucket with `isImported: true`. |
Example request
import { Buckt } from "@buckt/sdk";
const client = new Buckt({ apiKey: process.env.BUCKT_API_KEY });
const imported = await client.awsAccounts.importBuckets(
"acc_01J5AAAAAAAAAAAAAAAAAAAAAA",
{ bucketNames: ["company-marketing-assets", "company-user-uploads"] }
);
// [
// { object: "bucket", id: "bkt_01J5IMPORTED1XXXXXXXXXXX" },
// { object: "bucket", id: "bkt_01J5IMPORTED2XXXXXXXXXXX" },
// ]Responses
{
"data": [
{
"object": "bucket",
"id": "bkt_01J5IMPORTED1XXXXXXXXXXX"
},
{
"object": "bucket",
"id": "bkt_01J5IMPORTED2XXXXXXXXXXX"
}
],
"error": null,
"meta": null
}