Skip to main content

How to import contacts

contacts-import loads the contacts in a dataset into your active account under a tag. This guide covers finding the dataset and running the import.
Before you start, make sure you’re signed in and have an active account selected — see how to select and onboard an account. Without an active account, contacts-import exits with No account id....

1. Find the dataset to import

The CLI doesn’t create datasets — you import one produced by a prior search or agent run. List your datasets to get its id:
landbase-cli datasets list
[
  {
    "id": "ds_abc123",
    "name": "CRM Export Jun 2026",
    "created_at": "2026-06-05T10:00:00Z",
    "row_count": 952,
    "status": "ready"
  }
]
Inspect a specific one if you need to confirm its contents before importing:
landbase-cli datasets show ds_abc123
See the datasets command reference for the full set of dataset commands.

2. Start the import and watch it

Pass the dataset id and a tag for the imported contacts. --watch streams progress to stderr and writes the terminal status to stdout when the import finishes:
echo '{"datasetId":"ds_abc123","tagName":"Q2 outreach"}' \
  | landbase-cli contacts-import start --json - --watch
{
  "importId": 7,
  "phase": "completed",
  "percent": 100,
  "counts": { "total": 952, "imported": 940, "merged": 12, "skipped": 40, "invalid": 8 },
  "error": null
}
Read counts to see what landed: imported rows were written, merged rows folded into existing contacts, and skipped + invalid rows didn’t count toward the processed total. Once the import is completed, you can review it in the web app on the import history page at app.landbase.com/data/imported-contacts?tab=history. Make sure you’re viewing the same account you imported into.
Prefer --watch (or contacts-import wait <importId>) over rolling your own polling loop. Drive your own loop only if you need a custom cadence — call contacts-import status <importId> on a backoff.

3. If something fails

  • No account id... — no active account; see how to select and onboard an account.
  • VALIDATION_ERROR — the datasetId is unknown or not accessible to this account; confirm it with landbase-cli datasets show <dataset-id>.
  • CONFLICT — the import was already enqueued; don’t retry, just poll landbase-cli contacts-import status <importId>.
  • TIMEOUT on --watch — the import is still running server-side under the importId in the error’s meta; resume with landbase-cli contacts-import status <importId>.