# Bucket imports

Copy a scanned S3 bucket's objects into Pantech object storage, keyless, then resync until you switch over.

Source: https://docs.pantechdynamics.com/api/bucket-imports

Copying objects needs a second, opt-in role in your AWS account: choose the buckets with `PUT /cloud-connections/{connection_id}/copy-access`, create a stack from the template it returns, and send its `CopyRoleArn` output. That role may read only the buckets you chose, and Pantech checks it without reading any object. Then start an import per bucket, into a new Pantech bucket or one you have, and follow it until it `succeeded`. A resync copies only what changed; run a last one after writes to the source stop. Object storage is available on request: until it is on for your organization, starting an import answers `403 OBJECT_STORAGE_NOT_ENABLED`. See [moving buckets](https://docs.pantechdynamics.com/move/buckets).

Endpoints:

- `GET /public/v1/cloud-connections/{connection_id}/copy-access`: Get copy access
- `PUT /public/v1/cloud-connections/{connection_id}/copy-access`: Set copy access
- `GET /public/v1/bucket-imports`: List bucket imports
- `POST /public/v1/bucket-imports`: Copy a bucket into Pantech
- `GET /public/v1/bucket-imports/{import_id}`: Get a bucket import
- `POST /public/v1/bucket-imports/{import_id}/cancel`: Cancel a bucket import
- `POST /public/v1/bucket-imports/{import_id}/resync`: Resync a bucket import

## The copy access object



- `connection_id` (string, required)
- `status` (string, required): One of `not_requested`, `awaiting_role`, `verifying`, `verified`, `failed`.
- `failure` (BucketImportFailure, required): Why it failed; null when it didn't. `message` says what to do.
  - `code` (string, required)
  - `message` (string, required)
- `role_arn` (string or null, required)
- `buckets` (array of CopyAccessBucket, required)
  - `name` (string, required)
  - `region` (string or null, required)
  - `versioning` (string or null, required): One of `enabled`, `suspended`, `off`, `null`.
  - `ready` (boolean, required): Verified: an import may copy this bucket.
  - `failure` (BucketImportFailure, required): Why it failed; null when it didn't. `message` says what to do.
    - `code` (string, required)
    - `message` (string, required)
- `verified_at` (string or null, required)
- `setup` (CopyAccessSetup, required)
  - `issuer_url` (string, required)
  - `audience` (string, required)
  - `subject` (string, required): The copy role's token subject: the connection id followed by `:copy`.
  - `template` (string or null, required): The CloudFormation template (JSON text) for a role that may read only the chosen buckets; null until buckets are chosen.
## The bucket import object



- `id` (string, required)
- `connection_id` (string, required)
- `migration_id` (string or null, required)
- `source` (object, required)
  - `provider` (string, required)
  - `bucket` (string, required)
  - `region` (string or null, required)
- `destination` (object, required)
  - `bucket_id` (string, required)
  - `bucket_name` (string, required)
  - `public_read` (boolean, required)
- `status` (string, required): One of `queued`, `running`, `succeeded`, `failed`, `cancelled`.
- `failure` (BucketImportFailure, required): Why it failed; null when it didn't. `message` says what to do.
  - `code` (string, required)
  - `message` (string, required)
- `cancel_requested` (boolean, required)
- `pass` (integer, required): 1 for the first copy; each resync adds one.
- `progress` (BucketImportProgress, required)
  - `objects_copied` (integer, required)
  - `objects_skipped` (integer, required): Already in the Pantech bucket unchanged.
  - `objects_failed` (integer, required)
  - `bytes_copied` (integer, required)
  - `bytes_skipped` (integer, required)
- `total_bytes_copied` (integer, required): Bytes copied over every pass.
- `mirror_deletes` (boolean, required): The current pass was asked to delete what this import copied and the source no longer has.
- `objects_deleted` (integer, required): Objects deleted by mirror passes, over every pass.
- `next_attempt_at` (string or null, required): When a queued import waiting on an unreachable side is tried again.
- `created_at` (string, required)
- `started_at` (string or null, required)
- `finished_at` (string or null, required)
- `updated_at` (string, required)
- `failures` (array of BucketImportObjectFailure, required): The first 100 objects that failed this pass; null in a list.
  - `key` (string, required)
  - `reason` (string, required): One of `object_archived`, `object_access_denied`, `invalid_key`, `object_too_large`, `source_changed`, `verification_failed`, `transfer_failed`, `destination_rejected`.
  - `message` (string, required)
  - `at` (string, required)
- `events` (array of BucketImportEvent, required): The audit trail; null in a list.
  - `action` (string, required): One of `started`, `cancel_requested`, `resync_requested`, `succeeded`, `failed`, `cancelled`, `mirror_deleted`, `mirror_skipped`.
  - `actor_user_id` (string or null, required): Null for Pantech's own steps.
  - `detail` (string or null, required)
  - `occurred_at` (string, required)
## Get copy access

```http
GET /public/v1/cloud-connections/{connection_id}/copy-access
```

The connection's opt-in copy access: the buckets chosen for copying, the copy role and what its last verification found, and the CloudFormation template for that role. `status` is `not_requested` until buckets are chosen. The copy role is separate from the connection's read-only role and may read only the chosen buckets' objects.

Scope: `read`.

Path parameters:

- `connection_id`

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/cloud-connections/ccn_06gk3x9tq7m2v8r4y1c5d0zp8w/copy-access" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "status": "not_requested",
  "failure": {
    "code": "starter",
    "message": "message"
  },
  "role_arn": "role-arn",
  "buckets": [
    {
      "name": "web-1",
      "region": "af-abj",
      "versioning": "enabled",
      "ready": true,
      "failure": {
        "code": "starter",
        "message": "message"
      }
    }
  ],
  "verified_at": "2026-10-03T09:30:00Z",
  "setup": {
    "issuer_url": "issuer-url",
    "audience": "audience",
    "subject": "subject",
    "template": "template"
  }
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the scope this endpoint needs (`read` for GET, `write` for changes; an AI app's key also needs `delete` for a destructive call). Use a key with that scope, or reconnect the AI app with "Manage and delete" access.
`FORBIDDEN`: the member who created the key may not do this in the organization. Use a key created by an owner or admin.
`AI_APPS_DISABLED`: the organization has turned AI app access off, and this request was made with an AI app's key or sent by Pantech's MCP server (`Pantech-Client: mcp/…`). An owner can turn it on in the console under Organization › AI apps.
- `404`: `CLOUD_CONNECTION_NOT_FOUND`: no cloud connection with this id exists in your organization.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `MIGRATE_UNAVAILABLE`: Pantech Migrate is not available on this deployment yet. Try again later.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Set copy access

```http
PUT /public/v1/cloud-connections/{connection_id}/copy-access
```

Chooses the buckets Pantech may copy (`buckets`, needed the first time; at most 50) and returns the CloudFormation template for a copy role that may read only those buckets. Create a stack from it (or update the stack when the list changes), then set `role_arn` to its `CopyRoleArn` output; Pantech then verifies the role against each bucket without reading any object. `retry: true` verifies again. Owners and admins only.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `connection_id`

Body:

- `buckets` (array of string): The source buckets Pantech may copy, 1 to 50, each once. Required the first time. At most 50 items.
- `role_arn` (string): The copy stack's `CopyRoleArn` output. Setting it queues a verification.
- `retry` (boolean): Verify the role again.

Example:

```sh
curl -X PUT "https://api.pantechdynamics.com/public/v1/cloud-connections/ccn_06gk3x9tq7m2v8r4y1c5d0zp8w/copy-access" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

Response `200`:

```json
{
  "connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "status": "not_requested",
  "failure": {
    "code": "starter",
    "message": "message"
  },
  "role_arn": "role-arn",
  "buckets": [
    {
      "name": "web-1",
      "region": "af-abj",
      "versioning": "enabled",
      "ready": true,
      "failure": {
        "code": "starter",
        "message": "message"
      }
    }
  ],
  "verified_at": "2026-10-03T09:30:00Z",
  "setup": {
    "issuer_url": "issuer-url",
    "audience": "audience",
    "subject": "subject",
    "template": "template"
  }
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the scope this endpoint needs (`read` for GET, `write` for changes; an AI app's key also needs `delete` for a destructive call). Use a key with that scope, or reconnect the AI app with "Manage and delete" access.
`FORBIDDEN`: the member who created the key may not do this in the organization. Use a key created by an owner or admin.
`AI_APPS_DISABLED`: the organization has turned AI app access off, and this request was made with an AI app's key or sent by Pantech's MCP server (`Pantech-Client: mcp/…`). An owner can turn it on in the console under Organization › AI apps.
- `404`: `CLOUD_CONNECTION_NOT_FOUND`: no cloud connection with this id exists in your organization.
- `409`: `COPY_ACCESS_VERIFYING`: the copy access is still being checked. `CONFLICT`: it changed at the same time.
- `422`: `VALIDATION_FAILED`: `buckets` must name 1 to 50 buckets, each once; `role_arn` must be a role in the connected account.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `MIGRATE_UNAVAILABLE`: Pantech Migrate is not available on this deployment yet. Try again later.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## List bucket imports

```http
GET /public/v1/bucket-imports
```

The organization's bucket imports, newest first.

Scope: `read`.

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/bucket-imports" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "data": [
    {
      "id": "bim_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "migration_id": "mig_06gk3x9tq7m2v8r4y1c5d0zp8w",
      "source": {
        "provider": "provider",
        "bucket": "bucket",
        "region": "af-abj"
      },
      "destination": {
        "bucket_id": "bkt_06gk3x9tq7m2v8r4y1c5d0zp8w",
        "bucket_name": "bucket-name",
        "public_read": true
      },
      "status": "queued",
      "failure": {
        "code": "starter",
        "message": "message"
      },
      "cancel_requested": true,
      "pass": 1,
      "progress": {
        "objects_copied": 1,
        "objects_skipped": 1,
        "objects_failed": 1,
        "bytes_copied": 1,
        "bytes_skipped": 1
      },
      "total_bytes_copied": 1,
      "mirror_deletes": true,
      "objects_deleted": 1,
      "next_attempt_at": "2026-10-03T09:30:00Z",
      "created_at": "2026-10-03T09:30:00Z",
      "started_at": "2026-10-03T09:30:00Z",
      "finished_at": "2026-10-03T09:30:00Z",
      "updated_at": "2026-10-03T09:30:00Z",
      "failures": [
        {
          "key": "key",
          "reason": "object_archived",
          "message": "message",
          "at": "2026-10-03T09:30:00Z"
        }
      ],
      "events": [
        {
          "action": "started",
          "actor_user_id": "actor-user-id",
          "detail": "detail",
          "occurred_at": "2026-10-03T09:30:00Z"
        }
      ]
    }
  ],
  "next_cursor": null
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the scope this endpoint needs (`read` for GET, `write` for changes; an AI app's key also needs `delete` for a destructive call). Use a key with that scope, or reconnect the AI app with "Manage and delete" access.
`FORBIDDEN`: the member who created the key may not do this in the organization. Use a key created by an owner or admin.
`AI_APPS_DISABLED`: the organization has turned AI app access off, and this request was made with an AI app's key or sent by Pantech's MCP server (`Pantech-Client: mcp/…`). An owner can turn it on in the console under Organization › AI apps.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `MIGRATE_UNAVAILABLE`: Pantech Migrate is not available on this deployment yet. Try again later.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Copy a bucket into Pantech

```http
POST /public/v1/bucket-imports
```

Copies one source bucket's objects into a Pantech bucket: a new one (`destination_bucket_name`, made now and billed as any bucket) or one the organization has (`destination_bucket_id`). The bucket must have verified copy access. Objects stream from the source, are checked against their MD5s, and keep their content type, cache control, content disposition, user metadata and tags; only current versions are copied and nothing is deleted on either side. Follow it with `GET /public/v1/bucket-imports/{import_id}`. Moving is free; stored data bills as usual. Owners and admins only.

Scope: `write`. Send an `Idempotency-Key` header.

Body:

- `connection_id` (string, required)
- `source_bucket` (string, required): The source bucket's name. It must have verified copy access.
- `destination_bucket_name` (string): A new Pantech bucket to make and copy into.
- `destination_bucket_id` (string): An existing Pantech bucket of the organization to copy into.
- `versioning` (boolean): Versioning on a new bucket.
- `public_read` (boolean): Make a new bucket publicly readable. Off unless asked, even when the source was public.
- `migration_id` (string): The plan the move belongs to; its size for the bucket is checked against the storage left.

Example:

```sh
curl -X POST "https://api.pantechdynamics.com/public/v1/bucket-imports" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w",
    "source_bucket": "source-bucket"
  }'
```

Response `202`:

```json
{
  "id": "bim_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "migration_id": "mig_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "source": {
    "provider": "provider",
    "bucket": "bucket",
    "region": "af-abj"
  },
  "destination": {
    "bucket_id": "bkt_06gk3x9tq7m2v8r4y1c5d0zp8w",
    "bucket_name": "bucket-name",
    "public_read": true
  },
  "status": "queued",
  "failure": {
    "code": "starter",
    "message": "message"
  },
  "cancel_requested": true,
  "pass": 1,
  "progress": {
    "objects_copied": 1,
    "objects_skipped": 1,
    "objects_failed": 1,
    "bytes_copied": 1,
    "bytes_skipped": 1
  },
  "total_bytes_copied": 1,
  "mirror_deletes": true,
  "objects_deleted": 1,
  "next_attempt_at": "2026-10-03T09:30:00Z",
  "created_at": "2026-10-03T09:30:00Z",
  "started_at": "2026-10-03T09:30:00Z",
  "finished_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "failures": [
    {
      "key": "key",
      "reason": "object_archived",
      "message": "message",
      "at": "2026-10-03T09:30:00Z"
    }
  ],
  "events": [
    {
      "action": "started",
      "actor_user_id": "actor-user-id",
      "detail": "detail",
      "occurred_at": "2026-10-03T09:30:00Z"
    }
  ]
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `FORBIDDEN` or `INSUFFICIENT_SCOPE`: the key may not do this. `BUCKET_IMPORT_LIMIT_REACHED`: 20 imports are already in progress. `BUCKET_IMPORT_TOO_LARGE`: the bucket is larger than the storage your organization has left. `OBJECT_STORAGE_NOT_ENABLED`: object storage is not enabled for your organization. `BUCKET_LIMIT_REACHED`: the organization has the most buckets allowed.
- `404`: `CLOUD_CONNECTION_NOT_FOUND`, `MIGRATION_NOT_FOUND` or `BUCKET_NOT_FOUND`.
- `409`: `COPY_ACCESS_NOT_READY`: grant and verify copy access to this bucket first. `BUCKET_IMPORT_IN_PROGRESS`: the bucket is already being copied. `BUCKET_NAME_TAKEN`: a bucket with that name exists. `CLOUD_CONNECTION_NOT_CONNECTED`, `CLOUD_CONNECTION_VERIFYING` or `IDEMPOTENCY_CONFLICT`.
- `422`: `VALIDATION_FAILED`: name the source bucket, and exactly one of `destination_bucket_name` (a valid bucket name) and `destination_bucket_id`.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `MIGRATE_UNAVAILABLE`: Pantech Migrate is not available on this deployment yet. Try again later.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Get a bucket import

```http
GET /public/v1/bucket-imports/{import_id}
```

An import's status and progress for its current pass, the first 100 objects that failed it with the reason, and its audit trail (who started, resynced and cancelled it, and how each pass ended).

Scope: `read`.

Path parameters:

- `import_id`

Example:

```sh
curl "https://api.pantechdynamics.com/public/v1/bucket-imports/bim_06gk3x9tq7m2v8r4y1c5d0zp8w" \
  -H "Authorization: Bearer $PANTECH_API_KEY"
```

Response `200`:

```json
{
  "id": "bim_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "migration_id": "mig_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "source": {
    "provider": "provider",
    "bucket": "bucket",
    "region": "af-abj"
  },
  "destination": {
    "bucket_id": "bkt_06gk3x9tq7m2v8r4y1c5d0zp8w",
    "bucket_name": "bucket-name",
    "public_read": true
  },
  "status": "queued",
  "failure": {
    "code": "starter",
    "message": "message"
  },
  "cancel_requested": true,
  "pass": 1,
  "progress": {
    "objects_copied": 1,
    "objects_skipped": 1,
    "objects_failed": 1,
    "bytes_copied": 1,
    "bytes_skipped": 1
  },
  "total_bytes_copied": 1,
  "mirror_deletes": true,
  "objects_deleted": 1,
  "next_attempt_at": "2026-10-03T09:30:00Z",
  "created_at": "2026-10-03T09:30:00Z",
  "started_at": "2026-10-03T09:30:00Z",
  "finished_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "failures": [
    {
      "key": "key",
      "reason": "object_archived",
      "message": "message",
      "at": "2026-10-03T09:30:00Z"
    }
  ],
  "events": [
    {
      "action": "started",
      "actor_user_id": "actor-user-id",
      "detail": "detail",
      "occurred_at": "2026-10-03T09:30:00Z"
    }
  ]
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the scope this endpoint needs (`read` for GET, `write` for changes; an AI app's key also needs `delete` for a destructive call). Use a key with that scope, or reconnect the AI app with "Manage and delete" access.
`FORBIDDEN`: the member who created the key may not do this in the organization. Use a key created by an owner or admin.
`AI_APPS_DISABLED`: the organization has turned AI app access off, and this request was made with an AI app's key or sent by Pantech's MCP server (`Pantech-Client: mcp/…`). An owner can turn it on in the console under Organization › AI apps.
- `404`: `BUCKET_IMPORT_NOT_FOUND`: no bucket import with this id exists in your organization.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `MIGRATE_UNAVAILABLE`: Pantech Migrate is not available on this deployment yet. Try again later.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Cancel a bucket import

```http
POST /public/v1/bucket-imports/{import_id}/cancel
```

Stops the import: a queued one at once, a running one at its next checkpoint. Uploads in flight are abandoned; objects already copied stay. Owners and admins only.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `import_id`

Example:

```sh
curl -X POST "https://api.pantechdynamics.com/public/v1/bucket-imports/bim_06gk3x9tq7m2v8r4y1c5d0zp8w/cancel" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
```

Response `202`:

```json
{
  "id": "bim_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "migration_id": "mig_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "source": {
    "provider": "provider",
    "bucket": "bucket",
    "region": "af-abj"
  },
  "destination": {
    "bucket_id": "bkt_06gk3x9tq7m2v8r4y1c5d0zp8w",
    "bucket_name": "bucket-name",
    "public_read": true
  },
  "status": "queued",
  "failure": {
    "code": "starter",
    "message": "message"
  },
  "cancel_requested": true,
  "pass": 1,
  "progress": {
    "objects_copied": 1,
    "objects_skipped": 1,
    "objects_failed": 1,
    "bytes_copied": 1,
    "bytes_skipped": 1
  },
  "total_bytes_copied": 1,
  "mirror_deletes": true,
  "objects_deleted": 1,
  "next_attempt_at": "2026-10-03T09:30:00Z",
  "created_at": "2026-10-03T09:30:00Z",
  "started_at": "2026-10-03T09:30:00Z",
  "finished_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "failures": [
    {
      "key": "key",
      "reason": "object_archived",
      "message": "message",
      "at": "2026-10-03T09:30:00Z"
    }
  ],
  "events": [
    {
      "action": "started",
      "actor_user_id": "actor-user-id",
      "detail": "detail",
      "occurred_at": "2026-10-03T09:30:00Z"
    }
  ]
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the scope this endpoint needs (`read` for GET, `write` for changes; an AI app's key also needs `delete` for a destructive call). Use a key with that scope, or reconnect the AI app with "Manage and delete" access.
`FORBIDDEN`: the member who created the key may not do this in the organization. Use a key created by an owner or admin.
`AI_APPS_DISABLED`: the organization has turned AI app access off, and this request was made with an AI app's key or sent by Pantech's MCP server (`Pantech-Client: mcp/…`). An owner can turn it on in the console under Organization › AI apps.
- `404`: `BUCKET_IMPORT_NOT_FOUND`: no bucket import with this id exists in your organization.
- `409`: `BUCKET_IMPORT_FINISHED`: the import has already finished.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `MIGRATE_UNAVAILABLE`: Pantech Migrate is not available on this deployment yet. Try again later.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
## Resync a bucket import

```http
POST /public/v1/bucket-imports/{import_id}/resync
```

Queues another pass over the source. Objects Pantech already holds unchanged are skipped, so it copies only what changed. Run a last resync after writes to the source stop, then switch over. `mirror_deletes: true` (off by default, for that pass only) also deletes the objects this import copied that the source no longer has; it never deletes an object the import did not write, needs the `delete` scope, and is recorded in the import's audit trail. Owners and admins only.

Scope: `write`. Send an `Idempotency-Key` header.

Path parameters:

- `import_id`

Body:

- `mirror_deletes` (boolean): Off unless set. After this pass has listed the whole source, delete the objects this import copied that the source no longer has, and only those still holding the bytes the import wrote. Objects the import did not write are never deleted. Needs the delete scope.

Example:

```sh
curl -X POST "https://api.pantechdynamics.com/public/v1/bucket-imports/bim_06gk3x9tq7m2v8r4y1c5d0zp8w/resync" \
  -H "Authorization: Bearer $PANTECH_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

Response `202`:

```json
{
  "id": "bim_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "connection_id": "ccn_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "migration_id": "mig_06gk3x9tq7m2v8r4y1c5d0zp8w",
  "source": {
    "provider": "provider",
    "bucket": "bucket",
    "region": "af-abj"
  },
  "destination": {
    "bucket_id": "bkt_06gk3x9tq7m2v8r4y1c5d0zp8w",
    "bucket_name": "bucket-name",
    "public_read": true
  },
  "status": "queued",
  "failure": {
    "code": "starter",
    "message": "message"
  },
  "cancel_requested": true,
  "pass": 1,
  "progress": {
    "objects_copied": 1,
    "objects_skipped": 1,
    "objects_failed": 1,
    "bytes_copied": 1,
    "bytes_skipped": 1
  },
  "total_bytes_copied": 1,
  "mirror_deletes": true,
  "objects_deleted": 1,
  "next_attempt_at": "2026-10-03T09:30:00Z",
  "created_at": "2026-10-03T09:30:00Z",
  "started_at": "2026-10-03T09:30:00Z",
  "finished_at": "2026-10-03T09:30:00Z",
  "updated_at": "2026-10-03T09:30:00Z",
  "failures": [
    {
      "key": "key",
      "reason": "object_archived",
      "message": "message",
      "at": "2026-10-03T09:30:00Z"
    }
  ],
  "events": [
    {
      "action": "started",
      "actor_user_id": "actor-user-id",
      "detail": "detail",
      "occurred_at": "2026-10-03T09:30:00Z"
    }
  ]
}
```

Errors:

- `401`: `UNAUTHENTICATED`: the request has no API key, or the key is mistyped, revoked or expired, or its creator has left the organization. Send `Authorization: Bearer PAN_…` with a valid key; create one in the console under Organization › API keys.
- `403`: `INSUFFICIENT_SCOPE`: the API key lacks the scope this endpoint needs (`read` for GET, `write` for changes; an AI app's key also needs `delete` for a destructive call). Use a key with that scope, or reconnect the AI app with "Manage and delete" access.
`FORBIDDEN`: the member who created the key may not do this in the organization. Use a key created by an owner or admin.
`AI_APPS_DISABLED`: the organization has turned AI app access off, and this request was made with an AI app's key or sent by Pantech's MCP server (`Pantech-Client: mcp/…`). An owner can turn it on in the console under Organization › AI apps.
- `404`: `BUCKET_IMPORT_NOT_FOUND`: no bucket import with this id exists in your organization.
- `409`: `BUCKET_IMPORT_RUNNING`: the import is still queued or running. `COPY_ACCESS_NOT_READY`: copy access to the bucket was withdrawn. `BUCKET_IMPORT_IN_PROGRESS`: another import of the bucket is open.
- `429`: `RATE_LIMITED`: this API key, verified user or organization used its request budget for the current window, or this address exceeded an IP/failed-auth limit. Wait `Retry-After` seconds, then retry. For authenticated quota denials, `RateLimit-Scope` identifies the denying quota and `RateLimit-Reset` reports its remaining window in seconds.
- `503`: `MIGRATE_UNAVAILABLE`: Pantech Migrate is not available on this deployment yet. Try again later.
`SERVICE_UNAVAILABLE`: request quota storage is unavailable. Wait a few seconds, then retry.
