> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/imports.md).

# imports

Data-destination steps — an import writes records to a connection with field mappings, lookups, and upsert logic, and plugs into a flow's `pageProcessors[]`.

**REST API**: [Imports](https://developer.celigo.com/api/api-reference/imports)

```
celigo imports <subcommand> [args] [flags]
```

Supports all [global flags](/cli/getting-started/global-flags.md).

***

## Subcommands

| Subcommand                                  | Purpose                                                                                                       |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `list`                                      | List all imports.                                                                                             |
| `get <id>`                                  | Fetch one import by ID.                                                                                       |
| `create`                                    | Create an import from a JSON body (`--file <path>` or stdin).                                                 |
| `update <id>`                               | Full replace from a JSON body (`--file <path>` or stdin); destructive `PUT`.                                  |
| `set <id> key=value ...`                    | Safe field edit: GET → modify → PUT. Supports `key=file://<path>`.                                            |
| `delete <id>`                               | Delete an import.                                                                                             |
| `dependencies <id>` (alias `used-by`)       | List resources that depend on this import.                                                                    |
| `audit <id>`                                | Show the audit log (change history) for one import.                                                           |
| `invoke [id]`                               | Run a saved import against piped records, or preview a piped import doc when no id is given (no job created). |
| `clone <id>`                                | Clone an import (same-env or cross-env).                                                                      |
| `replace-connection <id> <newConnectionId>` | Swap the import's connection reference.                                                                       |
| `enable-debug <id>`                         | Turn on request-level debug logging.                                                                          |
| `disable-debug <id>`                        | Turn off request-level debug logging.                                                                         |

***

## `celigo imports list`

List all imports on the account.

**Signature**

```bash
celigo imports list [--integration <id>]
```

**Arguments**

None.

**Flags**

| Flag                 | Type   | Default | Description                                      |
| -------------------- | ------ | ------- | ------------------------------------------------ |
| `--integration <id>` | string | —       | List only imports belonging to this integration. |

**Example**

```bash
celigo imports list --format table
```

**Corresponds to**: [`GET /v1/imports`](https://developer.celigo.com/api/api-reference/imports#get-v1-imports) → Imports API reference

***

## `celigo imports get <id>`

Fetch a single import by ID.

**Signature**

```bash
celigo imports get <id>
```

**Arguments**

| Argument | Type   | Required | Description   |
| -------- | ------ | -------- | ------------- |
| `<id>`   | string | Yes      | Import `_id`. |

**Flags**

None beyond [global flags](/cli/getting-started/global-flags.md).

**Example**

```bash
celigo imports get 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`GET /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/imports#get-v1-imports-_id) → Imports API reference

***

## `celigo imports create`

Create an import from a JSON body. Read the body from a file with `-f, --file` (recommended), or pipe it on stdin.

**Signature**

```bash
celigo imports create --file <path>
celigo imports create < import.json     # or pipe on stdin
```

**Arguments**

None.

**Flags**

| Flag                | Type   | Default | Description                                                                                                  |
| ------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------ |
| `-f, --file <path>` | string | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1. |

**Request body**

A JSON object matching the `POST /v1/imports` request schema (adaptor variants, mappings, lookups).

**Example**

```bash
celigo imports create --file ./import.json
cat import.json | celigo imports create
```

**Corresponds to**: [`POST /v1/imports`](https://developer.celigo.com/api/api-reference/imports#post-v1-imports) → Imports API reference

***

## `celigo imports update <id>`

Full replace of an import from a JSON body. Read the body from a file with `-f, --file`, or pipe it on stdin. `PUT` erases any field not present in the payload, so prefer `set` for partial edits.

> ⚠️ **`PUT` fully replaces the import.** Any field omitted from the body is erased. `GET` the import first, edit, then send the complete object back — or use `set` for targeted edits.

**Signature**

```bash
celigo imports update <id> --file <path>
celigo imports update <id> < import.json     # or pipe on stdin
```

**Arguments**

| Argument | Type   | Required | Description   |
| -------- | ------ | -------- | ------------- |
| `<id>`   | string | Yes      | Import `_id`. |

**Flags**

| Flag                | Type    | Default | Description                                                                                                  |
| ------------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `-f, --file <path>` | string  | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1. |
| `--force`           | boolean | `false` | Submit even if the body contains masked credential values (`***`) copied from a GET.                         |

**Request body**

A complete import object matching the `PUT /v1/imports/{_id}` request schema.

**Example**

```bash
celigo imports update 5f8d43a1b9e5a80011a35f2c --file ./import.json
cat import.json | celigo imports update 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`PUT /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/imports#put-v1-imports-_id) → Imports API reference

***

## `celigo imports set <id> [assignments...]`

Safely edit one or more fields on an import. Whitelisted fields (e.g. `name`, `debugUntil`, `schedule.*`) are applied via an atomic PATCH; other fields go through GET → modify → PUT. Values are auto-parsed as JSON (`disabled=false` → boolean, `debugUntil=null` → removes the field). Dot and array-index notation are supported (`http.relativeURI=/api/v2/items`, `mapping.fields[0].generate=tranid`). Use `key=file://<path>` to load a value from a file (a leading `~` and relative paths are supported); added in celigo-cli 2026.6.1.

**Signature**

```bash
celigo imports set <id> key=value [key2=value2 ...]
```

**Arguments**

| Argument           | Type              | Required  | Description                                                        |
| ------------------ | ----------------- | --------- | ------------------------------------------------------------------ |
| `<id>`             | string            | Yes       | Import `_id`.                                                      |
| `[assignments...]` | `key=value` pairs | Yes (≥ 1) | Field assignments to apply. Value is parsed as JSON when possible. |

**Flags**

None beyond [global flags](/cli/getting-started/global-flags.md).

**Example**

```bash
celigo imports set 5f8d43a1b9e5a80011a35f2c disabled=false oneToMany=false
```

**Corresponds to**: [`GET /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/imports#get-v1-imports-_id) + [`PUT /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/imports#put-v1-imports-_id) → Imports API reference

***

## `celigo imports delete <id>`

Delete an import by ID.

> ⚠️ **Deleting an import is destructive.** Flows that reference it will break. Run `dependencies` first to confirm nothing depends on it.

**Signature**

```bash
celigo imports delete <id> [-y]
```

**Arguments**

| Argument | Type   | Required | Description   |
| -------- | ------ | -------- | ------------- |
| `<id>`   | string | Yes      | Import `_id`. |

**Flags**

| Flag          | Type    | Default | Description                   |
| ------------- | ------- | ------- | ----------------------------- |
| `-y`, `--yes` | boolean | `false` | Skip the confirmation prompt. |

**Example**

```bash
celigo imports delete 5f8d43a1b9e5a80011a35f2c -y
```

**Corresponds to**: [`DELETE /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/imports#delete-v1-imports-_id) → Imports API reference

***

## `celigo imports dependencies <id>`

List resources that depend on this import (flows, tools, APIs, and so on). Use it to check whether an import is safe to delete: empty means no dependents. Aliased as `used-by`.

**Signature**

```bash
celigo imports dependencies <id>
celigo imports used-by <id>
```

**Arguments**

| Argument | Type   | Required | Description   |
| -------- | ------ | -------- | ------------- |
| `<id>`   | string | Yes      | Import `_id`. |

**Flags**

None beyond [global flags](/cli/getting-started/global-flags.md).

**Example**

```bash
celigo imports dependencies 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: `GET /v1/imports/{_id}/dependencies`

***

## `celigo imports audit <id>`

Show the audit log (change history) for one import.

**Signature**

```bash
celigo imports audit <id>
```

**Arguments**

| Argument | Type   | Required | Description   |
| -------- | ------ | -------- | ------------- |
| `<id>`   | string | Yes      | Import `_id`. |

**Flags**

None beyond [global flags](/cli/getting-started/global-flags.md).

**Example**

```bash
celigo imports audit 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: `GET /v1/imports/{_id}/audit`

***

## `celigo imports invoke [id]`

Run an import with no job created. Two modes, selected by whether you pass an `<id>`:

* **With `<id>`** — run a *saved* import against an array of records piped on stdin; the records go through the import's mapping and upsert logic (`POST /v1/imports/{_id}/invoke`).
* **Without `<id>`** — pipe a full *import document* on stdin to preview its output without saving it (`POST /v1/imports/preview`).

Stdin is required either way — an empty stdin errors rather than silently previewing (so an unset `$ID` fails loudly instead of turning an intended `invoke <id>` into a preview).

**Signature**

```bash
celigo imports invoke [id]
```

**Arguments**

| Argument | Type   | Required | Description                                            |
| -------- | ------ | -------- | ------------------------------------------------------ |
| `[id]`   | string | No       | Import `_id`. Omit to preview a piped import document. |

**Examples**

```bash
# Invoke a saved import against records
echo '[{"name":"rec1"}]' | celigo imports invoke 5f8d43a1b9e5a80011a35f2c

# Preview an unsaved import document
celigo imports invoke < import.json
```

**Corresponds to**: [`POST /v1/imports/{_id}/invoke`](https://developer.celigo.com/api/api-reference/imports#post-v1-imports-_id-invoke) (with `id`) or `POST /v1/imports/preview` (without).

***

## `celigo imports clone <id>`

Clone an import. For a same-env clone the CLI auto-builds a self-map from the source import's connection — no stdin needed. For a cross-env clone pipe the connection map on stdin: `{"connectionMap":{"sourceConnId":"targetConnId", ...}}`.

**Signature**

```bash
celigo imports clone <id> [--name <name>]
```

**Arguments**

| Argument | Type   | Required | Description          |
| -------- | ------ | -------- | -------------------- |
| `<id>`   | string | Yes      | Source import `_id`. |

**Flags**

| Flag            | Type   | Default                 | Description                                                             |
| --------------- | ------ | ----------------------- | ----------------------------------------------------------------------- |
| `--name <name>` | string | `Clone - <source name>` | Name for the cloned import. Defaults to matching the UI's clone naming. |

**Request body**

Optional. Reads JSON on stdin: `{ "connectionMap": { "<sourceConnId>": "<targetConnId>", ... } }`. See the `POST /v1/imports/{_id}/clone` request schema in the Imports OpenAPI spec.

**Example**

```bash
celigo imports clone 5f8d43a1b9e5a80011a35f2c --name "Write orders to NetSuite (staging)"
```

**Corresponds to**: [`POST /v1/imports/{_id}/clone`](https://developer.celigo.com/api/api-reference/imports#post-v1-imports-_id-clone) → Imports API reference

***

## `celigo imports replace-connection <id> <newConnectionId>`

Replace the connection on an import. Any related running jobs are cancelled by the API.

**Signature**

```bash
celigo imports replace-connection <id> <newConnectionId>
```

**Arguments**

| Argument            | Type   | Required | Description                         |
| ------------------- | ------ | -------- | ----------------------------------- |
| `<id>`              | string | Yes      | Import `_id`.                       |
| `<newConnectionId>` | string | Yes      | `_id` of the connection to swap in. |

**Flags**

None beyond [global flags](/cli/getting-started/global-flags.md).

**Example**

```bash
celigo imports replace-connection 5f8d43a1b9e5a80011a35f2c 60a2c4e6f321d800129a1a3c
```

**Corresponds to**: [`PUT /v1/imports/{_id}/replaceConnection`](https://developer.celigo.com/api/api-reference/imports#put-v1-imports-_id-replaceconnection) → Imports API reference

***

## `celigo imports enable-debug <id>`

Enable request-level debug logging on an import by setting `debugUntil` via PATCH. Maximum duration is 60 minutes (the API caps longer values).

**Signature**

```bash
celigo imports enable-debug <id> [--duration <minutes>]
```

**Arguments**

| Argument | Type   | Required | Description   |
| -------- | ------ | -------- | ------------- |
| `<id>`   | string | Yes      | Import `_id`. |

**Flags**

| Flag                   | Type   | Default | Description                                                             |
| ---------------------- | ------ | ------- | ----------------------------------------------------------------------- |
| `--duration <minutes>` | number | `60`    | How long debug stays on, in minutes. Values above 60 are clamped to 60. |

**Example**

```bash
celigo imports enable-debug 5f8d43a1b9e5a80011a35f2c --duration 30
```

**Corresponds to**: [`PATCH /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/imports#patch-v1-imports-_id) (JSON Patch `replace /debugUntil`) → Imports API reference

***

## `celigo imports disable-debug <id>`

Disable request-level debug logging on an import by removing `debugUntil` via PATCH.

**Signature**

```bash
celigo imports disable-debug <id>
```

**Arguments**

| Argument | Type   | Required | Description   |
| -------- | ------ | -------- | ------------- |
| `<id>`   | string | Yes      | Import `_id`. |

**Flags**

None beyond [global flags](/cli/getting-started/global-flags.md).

**Example**

```bash
celigo imports disable-debug 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`PATCH /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/imports#patch-v1-imports-_id) (JSON Patch `remove /debugUntil`) → Imports API reference

***

## Gotchas

* **`adaptorType` is PascalCase and case-sensitive.** `NetSuiteDistributedImport`, `HTTPImport`, `FTPImport`, `RDBMSImport`, `SalesforceImport`, `AiAgentImport`, `GuardrailImport`, etc.
* **NetSuite needs `internalId: true`** on every field that maps to a numeric internal-ID reference (entity, item, subsidiary, location, class).
* **`responseMapping` lives on the flow**, under `pageProcessors[]` — not on the import resource.
* **Mapper 2.0 uses the `record.` prefix** (`record.orderId`). Mapper 1.0 (legacy NetSuite/Salesforce) does not.
* **Preview is folded into `invoke`.** Run `imports invoke` with no `<id>` and pipe an import document to preview its output (`POST /imports/preview`) — there's no separate `preview` command. For full flow-level preview use `flows test-run` once the import is wired into a flow.
* **Debug request inspection is on flows, not imports.** `enable-debug`/`disable-debug` here toggle the `debugUntil` field; the actual request/response log entries are read via `celigo flows debug-requests <flowId> <importId>`.

## Related

* [flows](/cli/commands/flows.md) — imports plug into `pageProcessors[]`; use `flows debug-requests` to inspect recorded traffic.
* [exports](/cli/commands/exports.md) — the source side.
* [connections](/cli/commands/connections.md) — the credential resource referenced by `_connectionId`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.celigo.com/cli/commands/imports.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
