> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# mammoth connector

> All 42 mammoth connector commands with examples, arguments and confirmation flags: Manage data connectors and connector profiles.

> Generated from mammoth-cli 2.4.2, released 2026-11-02: `mammoth schema list`, `mammoth capability list` and the CLI's own `--help`. Do not edit by hand; run `npm run docs:capabilities`.

Manage data connectors and connector profiles. 42 commands.

Every command also takes the [global flags](https://mammoth.io/docs/build/cli/global-flags/) (`--output`, `--yes`, `--confirm`, `--dry-run`, `--input`, `--profile`, ...), which are not repeated below. `--input` takes a JSON or YAML document of the input fields; `mammoth schema get COMMAND_ID` prints a command's full input schema.

**Confirmation.** Commands marked `--yes --confirm TARGET` or `--yes` always need those flags, even at a terminal: they never prompt. Commands marked "`--yes` or prompt" ask at an interactive terminal (table output, no `--no-input`) and otherwise need `--yes`. `--dry-run` skips confirmation and sends nothing.

## Summary

| Command | What it does | Effect | Confirmation |
|---|---|---|---|
| [`connector active`](#mammoth-connector-active) | List active connectors with established connections (workspace-scoped). | Read | — |
| [`connector get`](#mammoth-connector-get) | Get one connector's details by key (workspace-scoped, no project). | Read | — |
| [`connector list`](#mammoth-connector-list) | List all available connectors (workspace-scoped, no project). | Read | — |
| [`connector ai chat`](#mammoth-connector-ai-chat) | Send a message to the older connector chat, not the AI connector builder. | Benign mutation | — |
| [`connector ai history`](#mammoth-connector-ai-history) | Get chat history for a connection. The connection key is positional. | Read | — |
| [`connector ai session list`](#mammoth-connector-ai-session-list) | List connector chat sessions in the active project. | Read | — |
| [`connector ai session messages`](#mammoth-connector-ai-session-messages) | Get messages for a connector chat session. The session id is positional. | Read | — |
| [`connector ai submit-column-selection`](#mammoth-connector-ai-submit-column-selection) | Submit a column selection to the connector chat flow. 'body' is required input. | Benign mutation | — |
| [`connector ai submit-credentials`](#mammoth-connector-ai-submit-credentials) | Submit connector credentials to the connector chat flow. | Benign mutation | — |
| [`connector connection create`](#mammoth-connector-connection-create) | Create a connection for a connector. '--yes' is always required. | External effect | `--yes` |
| [`connector connection delete`](#mammoth-connector-connection-delete) | Delete a connection. Prompt or '--yes' required. | Destructive | `--yes` or prompt |
| [`connector connection get`](#mammoth-connector-connection-get) | Get one connection's details. Connector and connection keys are positional. | Read | — |
| [`connector connection list`](#mammoth-connector-connection-list) | List connections for one connector type, or for every connector with a saved one. | Read | — |
| [`connector connection list-all`](#mammoth-connector-connection-list-all) | List every connection in a project, across all connector types, in one call. | Read | — |
| [`connector connection query`](#mammoth-connector-connection-query) | Run one SELECT on a connection and return sample rows; saves nothing, no '--yes'. | Read | — |
| [`connector connection test`](#mammoth-connector-connection-test) | Run a health check on one connection now, and keep the result. | Benign mutation | — |
| [`connector connection update`](#mammoth-connector-connection-update) | Update a connection's credentials. '--yes' is always required. | External effect | `--yes` |
| [`connector draft browse`](#mammoth-connector-draft-browse) | List a folder of a files-shaped source (the top when 'folder' is omitted). | Read | — |
| [`connector draft create`](#mammoth-connector-draft-create) | Start an AI connector draft and send its request as the builder's first turn. | Benign mutation | — |
| [`connector draft discard`](#mammoth-connector-draft-discard) | Hide a draft from every list; its chat thread stays. | Destructive | `--yes` or prompt |
| [`connector draft fill`](#mammoth-connector-draft-fill) | Fill one target column by joining an uploaded file or a dataset onto the main source. | Benign mutation | — |
| [`connector draft get`](#mammoth-connector-draft-get) | Get one draft, with its target columns, sources and thread. | Read | — |
| [`connector draft known-sources`](#mammoth-connector-draft-known-sources) | List the sources with no built-in connector that a draft can still start on. | Read | — |
| [`connector draft list`](#mammoth-connector-draft-list) | List the project's connector drafts, newest first. | Read | — |
| [`connector draft open`](#mammoth-connector-draft-open) | Open a workbook into the draft: each tab becomes a table of the draft. | Benign mutation | — |
| [`connector draft read-tables`](#mammoth-connector-draft-read-tables) | Queue reading again every table not read yet, and every one a try failed on. | Benign mutation | — |
| [`connector draft sample`](#mammoth-connector-draft-sample) | Shape the draft's table from a sample CSV, TSV or Excel file. | Benign mutation | — |
| [`connector draft save`](#mammoth-connector-draft-save) | Start the job that saves a draft. | Benign mutation | — |
| [`connector draft source join-candidates`](#mammoth-connector-draft-source-join-candidates) | List the column pairs that could join a source onto the main one. | Read | — |
| [`connector draft source list`](#mammoth-connector-draft-source-list) | List a draft's sources. | Read | — |
| [`connector draft source preview`](#mammoth-connector-draft-source-preview) | Read up to 'limit' rows of one source through its connection. | Benign mutation | — |
| [`connector draft spec get`](#mammoth-connector-draft-spec-get) | Read the spec an AI-built connector's draft is building, with secrets left out. | Read | — |
| [`connector draft update`](#mammoth-connector-draft-update) | Change a draft. | Benign mutation | — |
| [`connector ds-config create`](#mammoth-connector-ds-config-create) | Sample a data source config; REST 'query' is a JSON string. '--yes' always needed. | External effect | `--yes` |
| [`connector ds-config delete`](#mammoth-connector-ds-config-delete) | Delete a data source configuration. Prompt or '--yes' required. | Destructive | `--yes` or prompt |
| [`connector ds-config delete-all`](#mammoth-connector-ds-config-delete-all) | Bulk-delete data source configurations for a connection. Prompt or '--yes' required. | Destructive | `--yes` or prompt |
| [`connector ds-config get`](#mammoth-connector-ds-config-get) | Get one data source configuration by key. | Read | — |
| [`connector ds-config list`](#mammoth-connector-ds-config-list) | List data source configurations for a connection. | Read | — |
| [`connector ds-config update`](#mammoth-connector-ds-config-update) | Update a data source configuration via JSON-patch ops. '--yes' is always required. | External effect | `--yes` |
| [`connector query generate`](#mammoth-connector-query-generate) | Generate a query for a connector using AI. 'query' (the intent) is required input. | Read | — |
| [`connector query status`](#mammoth-connector-query-status) | Get the status of an AI chat session for a connector connection. | Read | — |
| [`connector version spec get`](#mammoth-connector-version-spec-get) | Read one stored version of the workspace's AI-built connector, secrets left out. | Read | — |

## connector commands

### mammoth connector active

List active connectors with established connections (workspace-scoped).

```bash
mammoth connector active
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Id:** `connector.active` · **Result:** `ConnectorActiveResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.active_connectors`, API `GET /workspaces/{workspace_id}/active_connectors` (GetActiveConnectors)

### mammoth connector get

Get one connector's details by key (workspace-scoped, no project).

```bash
mammoth connector get postgres
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Required inputs: CONNECTOR_KEY.
- **Id:** `connector.get` · **Result:** `ConnectorGetResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.get`, API `GET /workspaces/{workspace_id}/connectors/{connector_key}` (GetConnector)

### mammoth connector list

List all available connectors (workspace-scoped, no project).

```bash
mammoth connector list
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Id:** `connector.list` · **Result:** `ConnectorListResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.list`, API `GET /workspaces/{workspace_id}/connectors` (ListWorkspaceConnectors)

## connector ai

### mammoth connector ai chat

Send a message to the older connector chat, not the AI connector builder.

```bash
mammoth connector ai chat --input '{"body": {"messages": [{"content": "Quarterly revenue summary", "role": "user"}]}}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `body` | `--input` field | yes | — | `dict[str, any]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Id:** `connector.ai.chat` · **Result:** `ConnectorAiChatResult` · **Backed by:** SDK `mammoth.api.connector_ai.ConnectorAIAPI.chat`, API `POST /workspaces/{workspace_id}/projects/{project_id}/ai/connector-chat` (Chat)

### mammoth connector ai history

Get chat history for a connection. The connection key is positional.

```bash
mammoth connector ai history prod-warehouse
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Required inputs: CONNECTION_KEY.
- **Id:** `connector.ai.history` · **Result:** `ConnectorAiHistoryResult` · **Backed by:** SDK `mammoth.api.connector_ai.ConnectorAIAPI.history`, API `GET /workspaces/{workspace_id}/projects/{project_id}/ai/connector-chat/history` (GetChatHistory)

### mammoth connector ai session list

List connector chat sessions in the active project.

```bash
mammoth connector ai session list
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Id:** `connector.ai.session.list` · **Result:** `ConnectorAiSessionListResult` · **Backed by:** SDK `mammoth.api.connector_ai.ConnectorAIAPI.session_list`, API `GET /workspaces/{workspace_id}/projects/{project_id}/ai/connector-chat/sessions` (ListSessions)

### mammoth connector ai session messages

Get messages for a connector chat session. The session id is positional.

```bash
mammoth connector ai session messages 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `SESSION_ID` | positional | yes | — | `int` | ID of the session. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Required inputs: SESSION_ID.
- **Id:** `connector.ai.session.messages` · **Result:** `ConnectorAiSessionMessagesResult` · **Backed by:** SDK `mammoth.api.connector_ai.ConnectorAIAPI.session_messages`, API `GET /workspaces/{workspace_id}/projects/{project_id}/ai/connector-chat/sessions/{session_id}/messages` (GetSessionMessages)

### mammoth connector ai submit-column-selection

Submit a column selection to the connector chat flow. 'body' is required input.

```bash
mammoth connector ai submit-column-selection --input '{"body": {"selected_columns": ["Status"], "session_id": "resource-123"}}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `body` | `--input` field | yes | — | `dict[str, any]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Id:** `connector.ai.submit-column-selection` · **Result:** `ConnectorAiSubmitColumnSelectionResult` · **Backed by:** SDK `mammoth.api.connector_ai.ConnectorAIAPI.submit_column_selection`, API `POST /workspaces/{workspace_id}/projects/{project_id}/ai/connector-chat/column-selection` (SubmitColumnSelection)

### mammoth connector ai submit-credentials

Submit connector credentials to the connector chat flow.

```bash
mammoth connector ai submit-credentials --input '{"body": {"credentials": {}, "session_id": "resource-123"}}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `body` | `--input` field | yes | — | `dict[str, any]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Id:** `connector.ai.submit-credentials` · **Result:** `ConnectorAiSubmitCredentialsResult` · **Backed by:** SDK `mammoth.api.connector_ai.ConnectorAIAPI.submit_credentials`, API `POST /workspaces/{workspace_id}/projects/{project_id}/ai/connector-chat/credentials` (SubmitCredentials)

## connector connection

### mammoth connector connection create

Create a connection for a connector. '--yes' is always required.

```bash
mammoth connector connection create postgres --input /private/path/request.json --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `config` | `--input` field | yes | — | `dict[str, any]` |  |

- **Effect:** External effect, scope `workspace` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** The connection document depends on connector_key (see `connector get KEY` for its fields); credentials in it are secrets, so pass them through a protected --input FILE.
- **Id:** `connector.connection.create` · **Result:** `ConnectorConnectionCreateResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.create_connection`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections` (SaveConnection)

### mammoth connector connection delete

Delete a connection. Prompt or '--yes' required.

```bash
mammoth connector connection delete postgres prod-warehouse --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |

- **Effect:** Destructive, scope `workspace` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Resolve immutable key before confirmation.
- **Id:** `connector.connection.delete` · **Result:** `ConnectorConnectionDeleteResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.delete_connection`, API `DELETE /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}` (DeleteConnection)

### mammoth connector connection get

Get one connection's details. Connector and connection keys are positional.

```bash
mammoth connector connection get postgres prod-warehouse
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Secrets in the returned config are redacted. Without --project it looks for the project that holds the connection; when none or several do, it fails with project_required and names them.
- **Id:** `connector.connection.get` · **Result:** `ConnectorConnectionGetResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.get_connection`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}` (GetConnection)

### mammoth connector connection list

List connections for one connector type, or for every connector with a saved one.

```bash
mammoth connector connection list postgres
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | no | — | `str` | Key identifying the connector. Leave it out to list the connections of every connector that has one. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Preconditions:** Without a connector key the result lists the connections of every connector in 'connector active', each row with its connector_key. Secrets in a connection's config are redacted.
- **Id:** `connector.connection.list` · **Result:** `ConnectorConnectionListResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.list_connections`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections` (ListConnections)

### mammoth connector connection list-all

List every connection in a project, across all connector types, in one call.

```bash
mammoth connector connection list-all
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `limit` | `--input` field | no | — | `int` |  |
| `offset` | `--input` field | no | — | `int` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Id:** `connector.connection.list-all` · **Result:** `ConnectorConnectionListAllResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.list_all_connections`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connections` (ListAllConnections)

### mammoth connector connection query

Run one SELECT on a connection and return sample rows; saves nothing, no '--yes'.

```bash
mammoth connector connection query postgres prod-warehouse --input '{"query": "SELECT region, SUM(revenue) FROM data GROUP BY region"}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |
| `query` | `--input` field | yes | — | `str` |  |
| `table` | `--input` field | no | — | `str` |  |
| `profile` | `--input` field | no | — | `str` |  |
| `timeout` | `--input` field | no | `60.0` | `float` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Preconditions:** Runs one SELECT on the connected database and returns a sample of its rows in data_sample (dataschema and rows). It saves no data source configuration and creates no dataset, so it needs no --yes; Mammoth keeps only the short-lived job that carried the request. The CLI refuses anything but a single SELECT or WITH ... SELECT, and the connection's database user decides what the database allows. The sample is limited to the first rows of the result, so add your own LIMIT or aggregate for a large table. To turn a query into a dataset use dataset create.
- **Id:** `connector.connection.query` · **Result:** `ConnectorConnectionQueryResult`

### mammoth connector connection test

Run a health check on one connection now, and keep the result.

```bash
mammoth connector connection test prod-warehouse
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** Needs project admin; the check reaches the connection's own service and its result is kept.
- **Id:** `connector.connection.test` · **Result:** `ConnectorConnectionTestResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.test_connection`, API `PATCH /workspaces/{workspace_id}/projects/{project_id}/connections/{connection_key}/test` (TestConnection)

### mammoth connector connection update

Update a connection's credentials. '--yes' is always required.

```bash
mammoth connector connection update postgres prod-warehouse --input /private/path/request.json --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |
| `credentials` | `--input` field | yes | — | `dict[str, any]` |  |

- **Effect:** External effect, scope `workspace` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** Needs --yes if validation contacts the destination.
- **Id:** `connector.connection.update` · **Result:** `ConnectorConnectionUpdateResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.update_connection`, API `PATCH /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}` (UpdateConnection)

## connector draft

### mammoth connector draft browse

List a folder of a files-shaped source (the top when 'folder' is omitted).

```bash
mammoth connector draft browse 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |
| `folder` | `--input` field | no | — | `str` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Read-only. A files-shaped source only; for Google Sheets it lists the account's recent spreadsheets.
- **Id:** `connector.draft.browse` · **Result:** `ConnectorDraftBrowseResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.browse`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/browse` (BrowseConnectorDraftFolderConnectorDrafts)

### mammoth connector draft create

Start an AI connector draft and send its request as the builder's first turn.

```bash
mammoth connector draft create --input '{"origin": "connections", "connector_key": "hubspot"}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `origin` | `--input` field | no | `connections` | `str` |  |
| `connector_key` | `--input` field | no | — | `str` |  |
| `connection_key` | `--input` field | no | — | `str` |  |
| `kind` | `--input` field | no | — | `str` |  |
| `url` | `--input` field | no | — | `str` |  |
| `request_text` | `--input` field | no | — | `str` |  |
| `title` | `--input` field | no | — | `str` |  |
| `session_id` | `--input` field | no | — | `str` |  |
| `start` | `--input` field | no | `true` | `bool` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** Without `session_id` the server starts an agent chat for the draft. A draft with no `connection_key` needs the project admin role. Another live draft for the same connector or connection comes back as `resume_candidate`.
- **Id:** `connector.draft.create` · **Result:** `ConnectorDraftCreateResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.create`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connector-drafts` (CreateConnectorDraft)

### mammoth connector draft discard

Hide a draft from every list; its chat thread stays.

```bash
mammoth connector draft discard 123 --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |

- **Effect:** Destructive, scope `workspace` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Hides the draft from every list; its chat thread stays.
- **Id:** `connector.draft.discard` · **Result:** `ConnectorDraftDiscardResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.discard`, API `DELETE /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}` (DiscardConnectorDraft)

### mammoth connector draft fill

Fill one target column by joining an uploaded file or a dataset onto the main source.

```bash
mammoth connector draft fill 123 --input '{"column": "region", "file_object_id": 77}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |
| `column` | `--input` field | yes | — | `str` |  |
| `file_object_id` | `--input` field | no | — | `int` |  |
| `dataset_id` | `--input` field | no | — | `int` |  |
| `key_columns` | `--input` field | no | — | `list[str]` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** Pass exactly one of `file_object_id` or `dataset_id`. 409 while the file is still being read; retry once it is.
- **Id:** `connector.draft.fill` · **Result:** `ConnectorDraftFillResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.fill`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/fill` (FillConnectorDraftGap)

### mammoth connector draft get

Get one draft, with its target columns, sources and thread.

```bash
mammoth connector draft get 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** A per-parent table's `each` block says how its preview was sampled. `each.summary` reads like "sampled 20 of 76 parents; 17 read, 3 failed", or "capped at 20 parents, total unknown" when the parent table's row count is not known. `each.total` is the sample size, not the parent count (`each.parents_total` is).
- **Id:** `connector.draft.get` · **Result:** `ConnectorDraftGetResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.get`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}` (GetConnectorDraft)

### mammoth connector draft known-sources

List the sources with no built-in connector that a draft can still start on.

```bash
mammoth connector draft known-sources
```

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Read-only. Sources with no built-in connector that a draft can still start on, deep ones first.
- **Id:** `connector.draft.known-sources` · **Result:** `ConnectorDraftKnownSourcesResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.known_sources`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/known-sources` (ListConnectorKnownSources)

### mammoth connector draft list

List the project's connector drafts, newest first.

```bash
mammoth connector draft list --input '{"status": "all"}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `status` | `--input` field | no | — | `str` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Read-only. `status`: live (not saved yet, the default), saved or all.
- **Id:** `connector.draft.list` · **Result:** `ConnectorDraftListResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.list`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connector-drafts` (ListConnectorDrafts)

### mammoth connector draft open

Open a workbook into the draft: each tab becomes a table of the draft.

```bash
mammoth connector draft open 123 --input '{"ref": "sheet-ref", "name": "Sales 2026"}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |
| `ref` | `--input` field | yes | — | `str` |  |
| `name` | `--input` field | yes | — | `str` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** Take `ref` and `name` from a `connector draft browse` entry; each tab becomes a table of the draft.
- **Id:** `connector.draft.open` · **Result:** `ConnectorDraftOpenResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.open`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/open` (OpenConnectorDraftEntry)

### mammoth connector draft read-tables

Queue reading again every table not read yet, and every one a try failed on.

```bash
mammoth connector draft read-tables 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** Queues the reads and returns how many; each table shows as not read yet until its answer lands on the draft.
- **Id:** `connector.draft.read-tables` · **Result:** `ConnectorDraftReadTablesResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.read_tables`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/read-tables` (ReadConnectorDraftTables)

### mammoth connector draft sample

Shape the draft's table from a sample CSV, TSV or Excel file.

```bash
mammoth connector draft sample 123 deals_2026-10.csv
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the connector draft. |
| `PATH` | positional | yes | — | `str` | Path to a local CSV, TSV or Excel file shaped like the table wanted. |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** A CSV, TSV or Excel file of about 5 MB at most; the server reads its header and first rows and does not keep it. Sets the draft's target columns.
- **Id:** `connector.draft.sample` · **Result:** `ConnectorDraftSampleResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.sample`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/sample` (ShapeConnectorDraftFromSample)

### mammoth connector draft save

Start the job that saves a draft.

```bash
mammoth connector draft save 123 --input '{"refresh": "daily", "dataset_name": "HubSpot deals"}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |
| `refresh` | `--input` field | no | `manual` | `str` |  |
| `dataset_name` | `--input` field | no | — | `str` |  |
| `folder_resource_id` | `--input` field | no | — | `int` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none · **Waits:** waits for the job to finish (`--job-timeout`, `--return-running`)
- **Preconditions:** Makes one dataset per source and joins the others onto the main one; `refresh: daily` refreshes each API or table source daily. The draft's `result` is set when the job is done.
- **Id:** `connector.draft.save` · **Result:** `ConnectorDraftSaveResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.save`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/save` (StartConnectorDraftSave)

### mammoth connector draft source join-candidates

List the column pairs that could join a source onto the main one.

```bash
mammoth connector draft source join-candidates 123 resource-123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |
| `SOURCE_ID` | positional | yes | — | `str` | ID of the source. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Read-only. Match counts are an estimate over the rows read so far.
- **Id:** `connector.draft.source.join-candidates` · **Result:** `ConnectorDraftSourceJoinCandidatesResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.join_candidates`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/sources/{source_id}/join-candidates` (ListConnectorDraftJoinCandidates)

### mammoth connector draft source list

List a draft's sources.

```bash
mammoth connector draft source list 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** A per-parent table's `each.summary` says how many parents its preview sampled, out of how many when that is known (`each.parents_total`).
- **Id:** `connector.draft.source.list` · **Result:** `ConnectorDraftSourceListResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.sources`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/sources` (ListConnectorDraftSources)

### mammoth connector draft source preview

Read up to 'limit' rows of one source through its connection.

```bash
mammoth connector draft source preview 123 resource-123 --input '{"limit": 20}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |
| `SOURCE_ID` | positional | yes | — | `str` | ID of the source. |
| `limit` | `--input` field | no | — | `int` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** Reads up to `limit` (1-100) rows through the connection and records what came back on the source. The limit is sent as given, but the server can return fewer rows; when the rows come back short of `limit` and the source holds more, the answer sets `capped` true with `limit_requested`, `limit_applied` and `source_row_count`. A preview is a sample; save the draft to read every row.
- **Id:** `connector.draft.source.preview` · **Result:** `ConnectorDraftSourcePreviewResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.preview_source`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}/sources/{source_id}/preview` (PreviewConnectorDraftSource)

### mammoth connector draft spec get

Read the spec an AI-built connector's draft is building, with secrets left out.

```bash
mammoth connector draft spec get 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Each table's request path, records path and paging, then the whole spec; credentials are references and anything that could be a secret reads \[redacted\].
- **Id:** `connector.draft.spec.get` · **Result:** `ConnectorDraftSpecGetResult`

### mammoth connector draft update

Change a draft.

```bash
mammoth connector draft update 123 --input '{"title": "HubSpot deals"}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `DRAFT_ID` | positional | yes | — | `int` | ID of the draft. |
| `title` | `--input` field | no | — | `str` |  |
| `target_columns` | `--input` field | no | — | `list[dict[str, any]]` |  |
| `sources` | `--input` field | no | — | `list[dict[str, any]]` |  |
| `primary_source_id` | `--input` field | no | — | `str` |  |
| `joins` | `--input` field | no | — | `list[dict[str, any]]` |  |
| `echo` | `--input` field | no | — | `str` |  |

- **Effect:** Benign mutation, scope `workspace` · **Confirmation:** none
- **Preconditions:** `target_columns` replaces the list whole. `echo` adds a quiet note to the draft's thread for the agent's next turn.
- **Id:** `connector.draft.update` · **Result:** `ConnectorDraftUpdateResult` · **Backed by:** SDK `mammoth.api.connector_drafts.ConnectorDraftsAPI.update`, API `PATCH /workspaces/{workspace_id}/projects/{project_id}/connector-drafts/{draft_id}` (PatchConnectorDraft)

## connector ds-config

### mammoth connector ds-config create

Sample a data source config; REST 'query' is a JSON string. '--yes' always needed.

```bash
mammoth connector ds-config create postgres prod-warehouse --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |
| `query` | `--input` field | no | — | `str` |  |
| `file_source` | `--input` field | no | — | `str` |  |
| `table` | `--input` field | no | — | `str` |  |
| `profile` | `--input` field | no | — | `str` |  |
| `validate` | `--input` field | no | `true` | `bool` |  |
| `data_sample` | `--input` field | no | `false` | `bool` |  |

- **Effect:** External effect, scope `workspace` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** Needs exactly one source; validate and data_sample cannot be combined.
- **Id:** `connector.ds-config.create` · **Result:** `ConnectorDsConfigCreateResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.create_ds_config`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}/ds_configs` (ValidateAndGetDsConfig)

### mammoth connector ds-config delete

Delete a data source configuration. Prompt or '--yes' required.

```bash
mammoth connector ds-config delete postgres prod-warehouse orders-config --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |
| `DS_CONFIG_KEY` | positional | yes | — | `str` | Key identifying the ds config. |

- **Effect:** Destructive, scope `workspace` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Resolve immutable key before confirmation.
- **Id:** `connector.ds-config.delete` · **Result:** `ConnectorDsConfigDeleteResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.delete_ds_config`, API `DELETE /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}/ds_configs/{ds_config_key}` (DeleteDsConfig)

### mammoth connector ds-config delete-all

Bulk-delete data source configurations for a connection. Prompt or '--yes' required.

```bash
mammoth connector ds-config delete-all postgres prod-warehouse --input '{"config_ids": ["resource-123"]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |
| `config_ids` | `--input` field | yes | — | `list[str] \| str` |  |

- **Effect:** Destructive, scope `workspace` · **Confirmation:** `--yes`, or answer the prompt at an interactive terminal
- **Preconditions:** Required inputs: CONNECTOR_KEY, CONNECTION_KEY.
- **Id:** `connector.ds-config.delete-all` · **Result:** `ConnectorDsConfigDeleteAllResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.ds_config_delete_all`, API `DELETE /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}/ds_configs` (DeleteDsConfigs)

### mammoth connector ds-config get

Get one data source configuration by key.

```bash
mammoth connector ds-config get postgres prod-warehouse orders-config
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |
| `DS_CONFIG_KEY` | positional | yes | — | `str` | Key identifying the ds config. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Reads one data-source config by key (from `connector ds-config list`); secrets in it are redacted.
- **Id:** `connector.ds-config.get` · **Result:** `ConnectorDsConfigGetResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.get_ds_config`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}/ds_configs/{ds_config_key}` (GetDsConfig)

### mammoth connector ds-config list

List data source configurations for a connection.

```bash
mammoth connector ds-config list postgres prod-warehouse
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Pages:** `single_page`
- **Preconditions:** Secrets in nested configuration are redacted.
- **Id:** `connector.ds-config.list` · **Result:** `ConnectorDsConfigListResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.list_ds_configs`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}/ds_configs` (ListDsConfigs)

### mammoth connector ds-config update

Update a data source configuration via JSON-patch ops. '--yes' is always required.

```bash
mammoth connector ds-config update postgres prod-warehouse orders-config --input '{"patch": [{"op": "replace", "path": "query", "value": "SELECT * FROM orders"}]}' --yes
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |
| `DS_CONFIG_KEY` | positional | yes | — | `str` | Key identifying the ds config. |
| `patch` | `--input` field | yes | — | `list[DsConfigPatchOp]` |  |

- **Effect:** External effect, scope `workspace` · **Confirmation:** always `--yes`, even at a terminal
- **Preconditions:** Only the query path is supported by the server today; other paths are refused. Read the config first with `connector ds-config get`.
- **Id:** `connector.ds-config.update` · **Result:** `ConnectorDsConfigUpdateResult` · **Backed by:** SDK `mammoth.api.connectors.ConnectorsAPI.update_ds_config`, API `PATCH /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}/ds_configs/{ds_config_key}` (UpdateDsConfigs)

## connector query

### mammoth connector query generate

Generate a query for a connector using AI. 'query' (the intent) is required input.

```bash
mammoth connector query generate postgres prod-warehouse --input '{"query": "Total sales for January"}'
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |
| `query` | `--input` field | yes | — | `str` |  |
| `profile` | `--input` field | no | — | `str` |  |

- **Effect:** Read, scope `workspace` · **Confirmation:** none · **Waits:** waits for the job to finish (`--job-timeout`, `--return-running`)
- **Preconditions:** Keys are nonempty and cannot contain '/'.
- **Id:** `connector.query.generate` · **Result:** `ConnectorQueryGenerateResult` · **Backed by:** SDK `mammoth.api.ai.AIAPI.query_gen`, API `POST /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}/chat` (GetQuerySuggestion)

### mammoth connector query status

Get the status of an AI chat session for a connector connection.

```bash
mammoth connector query status postgres prod-warehouse
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_KEY` | positional | yes | — | `str` | Key identifying the connector. |
| `CONNECTION_KEY` | positional | yes | — | `str` | Key identifying the connection. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** Required inputs: CONNECTOR_KEY, CONNECTION_KEY.
- **Id:** `connector.query.status` · **Result:** `ConnectorQueryStatusResult` · **Backed by:** SDK `mammoth.api.ai.AIAPI.status`, API `GET /workspaces/{workspace_id}/projects/{project_id}/connectors/{connector_key}/connections/{connection_key}/chat` (GetChatStatus)

## connector version

### mammoth connector version spec get

Read one stored version of the workspace's AI-built connector, secrets left out.

```bash
mammoth connector version spec get isams_ab12cd34 123
```

| Name | Passed as | Required | Default | Type | Notes |
|---|---|---|---|---|---|
| `CONNECTOR_SLUG` | positional | yes | — | `str` | The connector's slug, as 'connector draft spec get' shows it. |
| `VERSION` | positional | yes | — | `int` | The version number, from 1. |

- **Effect:** Read, scope `workspace` · **Confirmation:** none
- **Preconditions:** One stored version of the workspace's AI-built connector, by slug and version number.
- **Id:** `connector.version.spec.get` · **Result:** `ConnectorVersionSpecGetResult`

---
Source: https://mammoth.io/docs/build/cli/connector.md · Updated: 2026-11-02
