# Import

**Manage commercetools Import API containers, import operations, and import summaries from the terminal.**

The `import` topic provides commands for working with the [commercetools Import API](/api/import-export/overview.md). It covers three resources:

- Import containers define the scope and configuration of an import.
- Import operations are the individual records being imported.
- Import summaries give an aggregate view of the import results per container.

Commands that call the API need an authenticated session. For how to log in, see [Authentication](/dev-tooling/cli/overview.md#authentication).

## Import containers

Import containers define the namespace for a set of import operations.

```bash title="Manage import containers"
# List all import containers
commercetools import import-containers list [--limit <n>] [--offset <n>]

# Get an import container by key
commercetools import import-containers get --key <key>

# Create an import container
commercetools import import-containers create --body '{"key":"my-container","resourceType":"product-drafts"}'

# Update an import container
commercetools import import-containers update 
  --key <key> 
  --version <n> 
  --actions '[{"action":"changeResourceType","resourceType":"prices"}]'

# Delete an import container
commercetools import import-containers delete --key <key>
```

### Flag reference

#### `list`

| Flag | Description | Default |
| --- | --- | --- |
| `--limit` | Maximum number of results | `20` |
| `--offset` | Number of results to skip | `0` |

#### `get` / `delete`

| Flag | Description |
| --- | --- |
| `--key` | Import container key (required) |

#### `create`

| Flag | Description |
| --- | --- |
| `--body` | JSON string or path to a JSON file prefixed with `@` |

#### `update`

| Flag | Description |
| --- | --- |
| `--key` | Import container key |
| `--version` | Current version of the container |
| `--actions` | JSON array of update actions or path to a JSON file prefixed with `@` |

## Import operations

Import operations represent individual resources being imported into a container.

```bash title="Manage import operations"
# List import operations for a container
commercetools import import-operations list 
  --container-key <key> 
  [--limit <n>] 
  [--offset <n>]

# Get a specific import operation by ID
commercetools import import-operations get --id <id>
```

### Flag reference

#### `list`

| Flag | Description | Default |
| --- | --- | --- |
| `--container-key` | Key of the import container (required) |  |
| `--limit` | Maximum number of results | `20` |
| `--offset` | Number of results to skip | `0` |

#### `get`

| Flag | Description |
| --- | --- |
| `--id` | Import operation ID (required) |

## Import summaries

Import summaries provide an aggregate view of all import operations in a container, grouped by status.

```bash title="Get an import summary"
# Get the import summary for a container
commercetools import import-summaries get --container-key <key>
```

### Flag reference

| Flag | Description |
| --- | --- |
| `--container-key` | Key of the import container (required) |

## Examples

```bash title="Set up and monitor a product import"
# 1. Create an import container
commercetools import import-containers create 
  --body '{"key":"product-import","resourceType":"product-drafts"}'

# 2. Check the summary after importing via API
commercetools import import-summaries get --container-key product-import

# 3. Inspect failed operations
commercetools import import-operations list 
  --container-key product-import 
  --limit 50 | jq '.results[] | select(.state=="rejected")'
```

## Related pages

- [Area overview page with navigation](/dev-tooling.md)
- [Previous page: Connect](/dev-tooling/cli/connect.md)
- [Next page: Use the CLI with AI agents](/dev-tooling/cli/ai-agents.md)
- [Search documentation and API specs](/search.md)