> ## Documentation Index
> Fetch the complete documentation index at: https://inkbox.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Contact import

> Import visible Slack people into your contacts

Contact import requires an organization admin API key or a human session in the [Inkbox Console](https://inkbox.ai/console). Claimed agent keys cannot run contact imports. SDK and CLI support requires version `0.7.14` or later.

## Import contacts

In the Console, open **Slack → Workspaces → Import contacts**; if no agent is connected, use **Go to Slack Apps** to connect one. After connecting Slack from the Console, choose **Import contacts** or **Not now**; choosing import opens the same dialog, where you review the selected connection and start the import.

Choose an import source:

* **Every source** (default): combine the workspace directory, shared channels, and one-to-one and group direct messages the connected agent can access.
* **Workspace**: import only from the connected workspace's directory.
* **Direct messages**: import participants from all accessible one-to-one and group direct messages, without choosing individual conversations.
* **Channels**: select a named channel the connected agent can access.

The workspace directory already covers local workspace members, so **Every source** scans conversation members only for shared channels and direct messages. Contacts are deduplicated across sources. Keep the dialog open and use **Stop** and **Resume import** to continue after the last confirmed page.

If an existing contact's Slack account is missing from their card, import them again from a source where your agent can see them. Existing contact details are preserved.

**Every source** and **Direct messages** continue past conversations that become unavailable. The import summary shows the number of contacts added or updated. Rate limits and connection or permission problems pause the import so you can resolve the issue and resume without repeating confirmed pages.

```text theme={null}
POST /api/v1/slack/connections/{connection_id}/contacts/import
```

Import one page of visible people into your organization's real contacts. Existing Slack accounts are reused, curated fields are preserved, and retrying a page does not create duplicate accounts. Import does not create allow rules or Companion sponsorship.

| JSON field | Meaning |
| :- | :- |
| `limit` | Requested page size, `1`–`200`, default `100`. Each import page reads at most 20 accounts; follow `next_cursor` until it is null. |
| `cursor` | Optional continuation cursor. |
| `conversation_id` | Optional accessible conversation ID. Import its visible members instead of the connected workspace's directory. |

Bots, deactivated users, and accounts whose home workspace cannot be verified are skipped. A remote member's account retains its own home workspace, not the workspace where the app is installed. Conversation member import does not import that external company's entire directory.

The response contains:

| Field | Meaning |
| :- | :- |
| `imported_count` | Human accounts successfully linked to contacts, including existing contacts. |
| `skipped_count` | Accounts skipped on this page. |
| `contact_ids` | Unique contact UUIDs associated with this page. |
| `next_cursor` | Continue with this cursor, or stop when null. |

<CodeGroup>
  ```python Python theme={null}
  from inkbox import Inkbox

  client = Inkbox(api_key="YOUR_API_KEY")
  connection_id = "22222222-2222-4222-8222-222222222222"
  cursor = None
  while True:
      page = client.slack.import_contacts(connection_id, cursor=cursor)
      print(page.imported_count, page.skipped_count)
      cursor = page.next_cursor
      if cursor is None:
          break
  ```

  ```typescript TypeScript theme={null}
  import { Inkbox } from "@inkbox/sdk";

  const client = new Inkbox({ apiKey: "YOUR_API_KEY" });
  const connectionId = "22222222-2222-4222-8222-222222222222";
  let cursor: string | null = null;
  do {
    const page = await client.slack.importContacts(connectionId, { cursor });
    console.log(page.importedCount, page.skippedCount);
    cursor = page.nextCursor;
  } while (cursor !== null);
  ```

  ```bash CLI theme={null}
  inkbox slack contacts-import \
    --connection-id 22222222-2222-4222-8222-222222222222 \
    --conversation-id C0123456789 --limit 20
  ```
</CodeGroup>

The SDK and CLI fetch one page per call. Reuse the same connection and conversation selection while following cursors. Imported contacts show their Slack accounts on contact cards, where you can select them for [contact rules](/docs/api/slack/contact-rules).

Rust provides `import_contacts` with `SlackContactImportOptions` on `client.slack()`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.