BucktDocs

Import buckets

POST/v1/aws-accounts/{id}/importbuckets:writeSDK: awsAccounts.importBuckets

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

NameTypeDefaultDescription
idrequiredstringThe AWS account record ID. Must be `active` (validated) for this call to succeed.

Body parameters

NameTypeDefaultDescription
bucketNamesrequiredstring[]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
}