> 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/exports-imports-and-tools/imports)

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

Supports all [global flags](https://developer.celigo.com/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: whitelisted fields as one atomic PATCH, any other field through 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 document against a sample record when no id is given; `--connection` runs either through another connection. No job is created, and every form writes to the destination. |
| `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. Rows are projected to `_id`, `name`, and the table columns by default; `--fields all` returns complete documents.

**Signature**

```bash
celigo imports list [--integration <id>] [--fields <spec>] [--limit <n>]
```

**Arguments**

None.

**Flags**

| Flag                 | Type    | Default   | Description                                                                                                                                                                                                                                                                                  |
| -------------------- | ------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--integration <id>` | string  | —         | List only imports belonging to this integration. Since celigo-cli 2026.11.2, an id that matches no integration is reported as not found instead of printing an empty list.                                                                                                                   |
| `--fields <spec>`    | string  | `default` | Fields to request per row: `default` (`_id`, `name`, and the table columns), `all` (complete documents), or a comma-separated field list (dot notation allowed). See [field projection](https://developer.celigo.com/cli/getting-started/global-flags.md#field-projection-on-list-commands). |
| `--limit <n>`        | integer | —         | Return at most `<n>` rows, fetching a single page.                                                                                                                                                                                                                                           |

Output columns: `_id`, `name`, `adaptorType`, `_connectionId`, `lastModified`. Since celigo-cli 2026.10.1, `--fields a,b,…` with `--format table` draws `_id`, `name`, and the fields you name instead.

**Example**

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

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

***

## `celigo imports get <id>`

Fetch a single import by ID. With `--merge-instance-flow <flowId>`, the answer is the import as one instance flow runs it.

**Signature**

```bash
celigo imports get <id> [--merge-instance-flow <flowId>]
```

**Arguments**

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

**Flags**

| Flag                             | Type   | Default | Description                                                                                                                                                                                                                                             |
| -------------------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--merge-instance-flow <flowId>` | string | —       | Return the import as one instance flow runs it: that instance's overrides for the import, such as `_connectionId` or `http.relativeURI`, in place of the stored values. Nothing is saved. Sent as `mergeInstanceFlowId`. Added in celigo-cli 2026.11.2. |

The API answers `400` for a flow that is not an instance flow, or whose abstract flow does not use this import, and `404` for a flow id that matches no flow. The error's hint says which: the flow is not an instance flow, or no flow has that id.

**Example**

```bash
celigo imports get 5f8d43a1b9e5a80011a35f2c

# The import as one instance flow runs it, with that instance's overrides
celigo imports get 5f8d43a1b9e5a80011a35f2c --merge-instance-flow 6a1b2c3d4e5f6a7b8c9d0e1f
```

**Corresponds to**: [`GET /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#get-v1-imports-_id) → Imports API reference, with `mergeInstanceFlowId=<flowId>` as a query parameter for `--merge-instance-flow`.

***

## `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.

Since celigo-cli 2026.10.1, the body is checked before it is sent. It is validated against the published API schemas — the pack [`celigo lint`](https://developer.celigo.com/cli/local-tree/lint-and-resolve.md#celigo-lint) uses: a field the spec does not document, a wrong JSON type, or a value outside an enum prints a `warning` line on stderr, and the import is still created. A body that is not a JSON object, and masked `"******"` credential placeholders (a create would store the asterisks as the credential), are refused before any request, with no override.

**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/exports-imports-and-tools/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.

Since celigo-cli 2026.10.1, the body is checked against the published API schemas before the PUT (when it has findings, the current import is read first, so only what the update adds or changes is reported); findings are stderr warnings and never block. A body that is not a JSON object is refused. On an Integration App's import (`_connectorId` set), the platform answers `200` and keeps its own value for every field the app locks: each field the update changed whose reply still holds the previous value is named on stderr, and the command exits `1`.

**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. Since celigo-cli 2026.10.1, a masked value is four or more asterisks and nothing else: a lone `*` is a value and needs no `--force`. |

**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/exports-imports-and-tools/imports#put-v1-imports-_id) → Imports API reference

***

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

Safely edit one or more fields on an import. The imports PATCH whitelist — `debugUntil`, `aiAgent.attachedKnowledgeBaseIds`, and `guardrail.aiAgent.attachedKnowledgeBaseIds` — is 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.

Since celigo-cli 2026.11.2, the whitelist holds `aiAgent.attachedKnowledgeBaseIds` and `guardrail.aiAgent.attachedKnowledgeBaseIds`: the [knowledge bases](https://developer.celigo.com/cli/commands/knowledge-bases.md) that an AI agent, or an `ai_agent` guardrail, retrieves from. Assign the whole list, for example `'aiAgent.attachedKnowledgeBaseIds=["<knowledgeBaseId>"]'`. The platform accepts the AI agent's path on a guardrail, and the guardrail's path on an AI agent, with a success, and stores nothing. [`ai-agents set`](https://developer.celigo.com/cli/commands/ai-agents.md#celigo-ai-agents-set) and [`guardrails set`](https://developer.celigo.com/cli/commands/guardrails.md#celigo-guardrails-set) check the type first, and refuse the other type's path.

A `set` sent as one PATCH prints the PATCH's answer. When that answer has no body, stdout stays empty, stderr says `Updated import <id>.`, and the exit code is `0`. Earlier releases sent the two knowledge-base paths through the GET + PUT, which prints the PUT's answer, so read the import with `imports get <id>` where a script needs the document.

In `operate` mode, `set` takes only `debugUntil`. Since celigo-cli 2026.10.1, `set <id> disabled=true` and any other field are refused in `operate` mode instead of opening a GET + PUT of the whole import. See [permission modes](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).

Since celigo-cli 2026.10.1, `set` checks what it sends and what landed. The assigned values (PATCH) or the document it would PUT are checked against the published API schemas, as warnings that never block. After a GET + PUT, a field the server's reply still holds at its previous value prints `not stored <field> the server answered the PUT but still holds its previous value …` on stderr, and the command exits `1` — the platform answers `200` for a change it ignores. On an Integration App's import (`_connectorId` set), one line names the fields the app kept instead (`celigo: imports set: the platform kept its own value for <fields> — the Integration App locks them`), with the same exit code.

Since celigo-cli 2026.10.2, `set` refuses a bare rules array for `filter` (`imports set <id> 'filter=[...]'`) before any request. The field holds a filter object. The platform answers `200` to an array there, stores no filter, and drops the one the import held, so every record would pass. The refusal names the expression form the published Filter schema takes, `{"type": "expression", "expression": {"version": "1", "rules": [...]}}`. `filter=null` still removes a filter.

Since celigo-cli 2026.11.2, `set <id> lookups=…` on an HTTP import is refused after the CLI reads the import and before the PUT. The platform keeps an HTTP import's lookups under `http.lookups`. It drops a top-level `lookups` array sent on its own, with `200` and no error, and earlier releases reported that write as done. The refusal names the path to assign:

```
Refusing to set lookups on import <id>: an HTTP import keeps its lookups under http.lookups and the platform drops a top-level lookups array sent on its own, with 200 and no error, so nothing would change. Set http.lookups instead.
```

An import without an `http` block keeps its lookups at the top level and is not refused, and neither is a `set` that assigns `http.lookups` too.

Since celigo-cli 2026.10.2, the GET + PUT route sends a value that reads as a JSON object or array — typed or loaded with `file://` — as the text itself where the published spec types the field as a string. An HTTP import's `http.body[0]` is one: a request template is text, not the object it spells. In an array the spec types as strings, such as `http.body` (`imports set <id> 'http.body=[{...}]'`), each object is sent as its JSON text. Earlier releases sent the parsed object, and the import stored it in the template's place. A field the spec lets hold an object or an array, and a field it does not document, keep the parsed value. Only an assignment's last write counts: a later assignment in the same call to that field, or to a path inside it, wins.

**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; a JSON object or array assigned to a field the spec types as a string is sent as text (see above). |

**Flags**

None beyond [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).

**Example**

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

# Replace the import's filter: wrap the rules in the expression form
celigo imports set 5f8d43a1b9e5a80011a35f2c \
  'filter={"type":"expression","expression":{"version":"1","rules":["notempty",["string",["extract","email"]]]}}'

# Load a request template from a file: http.body[0] is a string, so the JSON is sent as text
celigo imports set 5f8d43a1b9e5a80011a35f2c 'http.body[0]=file://./body.json'
```

**Corresponds to**: [`PATCH /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports) for `debugUntil`, `aiAgent.attachedKnowledgeBaseIds`, and `guardrail.aiAgent.attachedKnowledgeBaseIds`; otherwise [`GET /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#get-v1-imports-_id) + [`PUT /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/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/exports-imports-and-tools/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`. Since celigo-cli 2026.10.1, an id that matches no import is reported as not found instead of as having no dependents.

**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](https://developer.celigo.com/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. Since celigo-cli 2026.10.1, every page of the log is read, and the table shows `_id`, `resourceType`, `event`, `source`, `byUser.email`, and `time` — `resourceType` tells the import's own entries from the related ones the log returns with them.

**Signature**

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

**Arguments**

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

**Flags**

None beyond [global flags](https://developer.celigo.com/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. **Every form writes**: each record it runs is sent to the destination — `invoke` is never a dry run, and a saved `mockResponse` does not stand in for the destination. Three modes, selected by whether you pass an `<id>` and `--connection`:

* **With `<id>`** — run a *saved* import, through its own connection, against an array of records piped on stdin (or read with `--file`); the records go through the import's mapping and upsert logic (`POST /v1/imports/{_id}/invoke`). The API answers HTTP 200 whatever happened to the records, so check each result's `statusCode` and `errors`. Since celigo-cli 2026.10.1, a count prints on stderr (described below), and a piped `{"import": …}` document is refused before any request: the platform ignores it and writes the records through the saved import. Requires `operate` mode.
* **Without `<id>`** — pipe `{"import": {...}, "data": [{...}]}`, an import document and a sample record, for its stage-by-stage output without saving the document (`POST /v1/imports/preview`). The preview executes the composed request against the destination too. It runs only the first record of `data` and sends none of the others; to run a document over every record, add `--connection`. Since celigo-cli 2026.10.1, a bare import document is previewed against one empty record, a body that is not a JSON object — or an envelope whose `import` is not a document or whose `data` is not an array — is refused before any request, and this form requires `full` mode.
* **With `--connection <id>`** — run either form through that connection instead, as a *virtual import*; the document's own `_connectionId` is not used. With an `<id>`, the saved import is read first and run against the piped records (`[{...}, ...]` or `{"data": [...]}`; a piped document is refused). Without one, the piped `{"import": {...}, "data": [...]}` is sent as written — a bare document is refused, because no record is implied. The output is one result per record, counted on stderr as for a saved run, not the preview's stages. Requires `full` mode. Added in celigo-cli 2026.10.1.

**The count on stderr.** A saved run and a run through `--connection` answer HTTP 200 with one result per record, and the CLI counts the results on stderr. Since celigo-cli 2026.10.2, the count sorts the records by cause:

```
4 record(s): 1 accepted, 1 rejected by the destination, 1 failed before sending, 0 failed after sending (the destination may already hold them), 1 ignored and never sent.
```

* **Rejected by the destination** — the destination refused the record: an error with `source: application`, or an error at stage `apiCall` that a postSubmit hook reworded (it then carries the hook's source). A failure the CLI cannot place before or after the send counts here too.
* **Failed before sending** — nothing was sent for the record: a mapping row named an undefined lookup, the import could not parse its body as JSON, or a preMap or postMap hook threw.
* **Failed after sending** — a postSubmit or postAggregate hook failed after the destination answered, at the hook's own stage (`postSubmitHook`, `postAggregateHook`). The destination may already hold the record, so a retry is not safe.
* **Ignored and never sent** — the record was skipped, whatever skipped it: the input filter, or the import's ignore-existing or ignore-missing rule.

Whether an error came after the send is judged by its stage when it names one, and by its source only when it names none.

Earlier releases counted every failed record as rejected by the destination, and every skipped one as ignored by the input filter.

**Running as a step of a parent.** On its own, a virtual import sees only its own settings: `{{settings.integration.*}}` and `{{settings.flow.*}}` render empty. With `--integration <id>` and exactly one of `--flow`, `--tool`, or `--api <id>`, it runs as a step of that parent, so hooks and templates get the settings a real run gives them: the integration's settings and `_integrationId`, and for a flow its own settings and `_flowId` too. The parent must be in the integration (the API answers `400` otherwise), and the connection must be registered to the integration — the API's `403` then comes with the hint `Register the connection to the integration first: celigo integrations register-connections <integrationId> <connectionId>` (see [`integrations register-connections`](https://developer.celigo.com/cli/commands/integrations.md#celigo-integrations-register-connections)). Added in celigo-cli 2026.10.1.

The options are checked before anything is read or sent: `--integration`, `--flow`, `--tool`, and `--api` are refused without `--connection`; a parent needs `--integration` and exactly one of the other three; and a blank value (an unset shell variable), or one holding `/`, `?`, `#`, `\`, or whitespace, is refused.

Input is required in every form — an empty stdin or file errors rather than silently previewing. Since celigo-cli 2026.10.1, a blank `[id]` (an unset `$ID`) is refused instead of turning an intended `invoke <id>` into a preview, and no form is resent after a timeout or a 5xx: the request may have landed, and a resend would write the records again. Since celigo-cli 2026.11.1, no form is resent after a `429` either; earlier releases retried it.

Since celigo-cli 2026.11.1, a credential the results carry prints as `********`, in every form: a virtual import's records, for example, can echo the connection's own `Authorization` header in their `_headers`. The value of each credential header, and a captured request URL's userinfo and credential query parameters, are masked. See [Credentials in a run's result](https://developer.celigo.com/cli/using-the-cli/output-formats.md#credentials-in-a-runs-result).

**Signature**

```bash
celigo imports invoke [id] [-f <path>]
celigo imports invoke [id] --connection <id> [--integration <id> (--flow <id> | --tool <id> | --api <id>)] [-f <path>]
```

**Arguments**

| Argument | Type   | Required | Description                                                                                                 |
| -------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------- |
| `[id]`   | string | No       | Import `_id`. Omit to preview a piped import document, or, with `--connection`, to run it over its records. |

**Flags**

| Flag                 | Type   | Default | Description                                                                                                                               |
| -------------------- | ------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `-f, --file <path>`  | string | stdin   | Read the records or the import document from a file instead of stdin (`-` also means stdin).                                              |
| `--connection <id>`  | string | —       | Run the import through this connection instead, as a virtual import. Needs `full` mode. Added in celigo-cli 2026.10.1.                    |
| `--integration <id>` | string | —       | With `--connection`: run as a step of a parent in this integration, named by one of the three flags below. Added in celigo-cli 2026.10.1. |
| `--flow <id>`        | string | —       | The flow the step runs in (with `--connection` and `--integration`). Added in celigo-cli 2026.10.1.                                       |
| `--tool <id>`        | string | —       | The tool the step runs in (with `--connection` and `--integration`). Added in celigo-cli 2026.10.1.                                       |
| `--api <id>`         | string | —       | The API the step runs in (with `--connection` and `--integration`). Added in celigo-cli 2026.10.1.                                        |

**Request body**

| Form           | Body                                                                                                                                                                                                     |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| With `<id>`    | The records: `[{...}, ...]`. With `--connection`, `{"data": [...]}` is accepted too.                                                                                                                     |
| Without `<id>` | `{"import": {...}, "data": [{...}, ...]}`. Without `--connection`, the preview runs only the first record of `data`, and a bare import document is also accepted and previewed against one empty record. |

**Examples**

```bash
# Invoke a saved import against records (the count prints on stderr)
echo '[{"name":"rec1"}]' | celigo imports invoke 5f8d43a1b9e5a80011a35f2c

# Preview an unsaved import document against a sample record (full mode; only the first record runs)
celigo imports invoke < preview.json    # {"import": {...}, "data": [{...}]}

# Run an unsaved import document over every record, through a connection (full mode)
celigo imports invoke --connection 60a2c4e6f321d800129a1a3c < run.json    # {"import": {...}, "data": [...]}

# Run the saved import through another connection (full mode)
echo '[{"email":"ops@example.com"}]' \
  | celigo imports invoke 5f8d43a1b9e5a80011a35f2c --connection 60a2c4e6f321d800129a1a3c

# The same, as a step of a flow, so hooks see the integration's and the flow's settings
echo '[{"email":"ops@example.com"}]' \
  | celigo imports invoke 5f8d43a1b9e5a80011a35f2c --connection 60a2c4e6f321d800129a1a3c \
      --integration 5f83a9b2c7d3e8f1a2b3c4d5 --flow 6a1b2c3d4e5f6a7b8c9d0e1f
```

**Corresponds to**: [`POST /v1/imports/{_id}/invoke`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports#post-v1-imports-_id-invoke) (with `id`) or `POST /v1/imports/preview` (without). With `--connection`, [`POST /v1/connections/{_id}/import`](https://developer.celigo.com/api/api-reference/connections-and-http-connectors/connections) (after [`GET /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/imports) when an id is given); with a parent, [`POST /v1/integrations/{_id}/flows/{_flowId}/connections/{_connectionId}/import`](https://developer.celigo.com/api/api-reference/integrations-and-flows/integrations), or `tools`/`apis` in place of `flows`.

***

## `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, or pass it with `--file`: `{"connectionMap":{"sourceConnId":"targetConnId", ...}}`.

An import whose hooks or wrapper connections run on a [stack](https://developer.celigo.com/cli/commands/stacks.md) clones only when the request names one. Without `_stackId`, the platform refuses the clone with `400 stack_not_found`. Since celigo-cli 2026.10.2, `--stack-id` names the stack; earlier releases built the request body without `_stackId`, so such an import could not be cloned from the CLI.

**Signature**

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

**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.                                                                                                                                                                         |
| `-f, --file <path>` | string | —                       | Read the `connectionMap` body from a file instead of stdin. `--file -` waits until stdin closes. Added in celigo-cli 2026.10.1.                                                                                                                 |
| `--stack-id <id>`   | string | —                       | The stack the copy's hooks and wrapper connections run on, sent as `_stackId`. Required when the clone preview says `stackRequired: true`; without it the platform refuses the clone with `400 stack_not_found`. Added in celigo-cli 2026.10.2. |

**Request body**

Optional. Reads JSON on stdin, or from `--file`: `{ "connectionMap": { "<sourceConnId>": "<targetConnId>", ... } }`. See the `POST /v1/imports/{_id}/clone` request schema in the Imports OpenAPI spec. Since celigo-cli 2026.10.2, a string `_stackId` in the body is sent too, as `--stack-id` is; `--stack-id` wins when both are given. Since celigo-cli 2026.10.1, a body piped without `--file` must start arriving within one second and is then read to its end, however long the rest takes; behind a slower producer, use `--file -`. A body that is not a JSON object is refused before any request. Since celigo-cli 2026.11.2, a blank `--name` or `--stack-id` (an unset shell variable) is refused before any request too.

**Example**

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

# An import whose hooks run on a stack: name the stack the copy runs on
celigo imports clone 5f8d43a1b9e5a80011a35f2c --stack-id 7c3d4e5f6a7b8c9d0e1f2a3b
```

**Corresponds to**: [`POST /v1/imports/{_id}/clone`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/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](https://developer.celigo.com/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/exports-imports-and-tools/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). Requires `operate` mode.

**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. Since celigo-cli 2026.10.1, a value that is not a positive whole number is refused instead of setting a window that has already ended. |

**Example**

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

**Corresponds to**: [`PATCH /v1/imports/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/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. Requires `operate` mode.

**Signature**

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

**Arguments**

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

**Flags**

None beyond [global flags](https://developer.celigo.com/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/exports-imports-and-tools/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 `{"import": …, "data": […]}` (or a bare import document, previewed against one empty record) to see its stage-by-stage output (`POST /imports/preview`) — there's no separate `preview` command. The preview runs only the first record of `data`; to run a document over every record, add `--connection`. The preview writes to the destination too, so it needs `full` mode. For full flow-level preview use `flows test-run` once the import is wired into a flow.
* **`invoke` is never a dry run.** Every form writes to the destination — the preview its first record, the other forms every record — and the HTTP status is `200` whatever the records did: read the per-record results, or the count `invoke <id>` and `--connection` print on stderr.
* **`create`, `clone`, and `invoke` are sent once.** Since celigo-cli 2026.10.1, a timeout or a 5xx on any of them is reported and never retried, and since celigo-cli 2026.11.1 neither is a `429`, which earlier releases retried: the request may have reached the server, so check for the result before you run the command again.
* **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>` (or `apis`/`tools debug-requests`).
* **Permission modes.** `list`, `get`, `dependencies`, and `audit` work in `read` mode. `invoke <id>`, `enable-debug`, `disable-debug`, and `set <id> debugUntil=…` need `operate`, and `read` mode refuses every form of `invoke` before any request. `invoke` without an id, `invoke --connection`, `create`, `update`, `delete`, `clone`, `replace-connection`, and any other `set` need `full`. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).

## Related

* [flows](https://developer.celigo.com/cli/commands/flows.md) — imports plug into `pageProcessors[]`; use `flows debug-requests` to inspect recorded traffic.
* [exports](https://developer.celigo.com/cli/commands/exports.md) — the source side.
* [connections](https://developer.celigo.com/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
