contacts-import
Import contacts into the Execution platform via landbase-cli contacts-import — covers building and validating an AI-driven header mapping, tracking an import to completion, and repairing failures using the server's authoritative header list.
Skill body
Contacts Import (Execution platform) with AI header mapping
Import a dataset’s contacts into the current account on the Execution platform
(where campaigns run). NEVER run a bare contacts-import start — default header
resolution drops every column it can’t match. The drop is reported in the final
status, not silent, but the user’s data is still not imported. Build a mapping
first. Violating the letter of these rules is violating their spirit.
Prereqs: landbase-cli auth login, then landbase-cli account set (or
--account=<id>). You need a dataset id from a prior search/agent run or
upload — those commands print dataset_id; pass that same value as
datasetId (camelCase) in the start body.
Mechanics (command list, body/response shapes, phases, polling) live in
landbase-cli contacts-import --help. This skill is the authority on when to
stop, what to repair, and what to report to the user.
Red Flags — STOP
- About to run
contacts-import startwithout amappingin the body - About to guess a field from its header name alone (“Contact”, “Info”, “ID”)
instead of checking sample values via
datasets peek - About to read the local CSV for headers when a
datasetIdexists —datasets fieldsis the authoritative source; upload/publish can change the columns - About to
startwhileresolvestill reportsinvalidMappingEntries,missingRequired, orviolatedRowRules - About to proceed with non-empty
unmappedHeaderswithout the user’s explicit OK to drop those columns
The mapping flow
- Headers come from the DATASET, not your local file:
landbase-cli datasets fields <datasetId>is the authoritative column list. For ambiguous header names, check sample values:landbase-cli datasets peek <datasetId> --sql "SELECT * FROM input_dataset LIMIT 3". landbase-cli contacts-import schema— match each column to a catalog field by itsdescriptionand by comparing sample values toexamples/format.rowRulesin the response is the authoritative list ofrequiredfields andatLeastOneOfgroups (server-owned; never hardcode the rules).- Preflight:
landbase-cli contacts-import resolve --json -on{ "headers": [...], "mapping": { "company": {...}, "contact": {...} } }. Stop conditions — fix, re-resolve, only then start:invalidMappingEntries:unknown_field→ use itsdidYouMean;header_not_in_file→ use itssuggestion.resolvetolerates unknown field names;startrejects them outright.missingRequired/violatedRowRulesnon-empty → the import WILL fail.unmappedHeadersnon-empty → those columns will NOT be imported — remap them or confirm the loss with the user.
- Start with the same mapping and watch to terminal:
echo '{"datasetId":"<id>","tagName":"<tag>","mapping":{...}}' | landbase-cli contacts-import start --json - --watch(or pollstatus <importId>/ block withwait <importId>).
Reading the terminal status — what to report
unmapped.total > 0→ name the non-imported columns to the user (unmapped.headerscaps at the first 50;totalis the real count — say so when the list is truncated).failedwith non-nullmappingErrors→ resolution failed BEFORE any rows ran. The repair source isfileHeadersin the SAME status — the server-side header list, authoritative over your local parse (first 50;totalFileHeadersis the real count). Rebuild the mapping against it, re-resolve, re-start.partial→ some rows landed (countsshows what),errorsays why the rest didn’t.- On
completed, reportcounts(imported/merged/skipped/invalid).
Dataset imports: the server sees the dataset’s columns plus LB_* system
columns — those are excluded from mapping checks automatically; never map to
them.
Failure modes
CONFLICTonstart— that importId is already enqueued; don’t retry, pollstatus <importId>.http_404onschema/resolve— the server predates these endpoints (an older deployment’s route-level 404 carries no error envelope, so it surfaces as the fallbackhttp_404code, notNOT_FOUND).TIMEOUTonwait/--watchafter 30min — the import keeps running; resume withstatus <importId>(the id rides in the error’smeta.importId).VALIDATION_ERRORonstart— usually a datasetId unknown or not accessible to this account.
Integration
Called by: landbase-email-campaigns, landbase-linkedin-campaigns,
dataset-pipeline — each hands off here before importing contacts. Return to
the calling skill only after the import reaches a terminal phase and the outcome
(counts + any dropped columns) has been reported to the user.
Skill frontmatter
Work with this as data
Every skill here is available over the APIs.io API and to AI agents over MCP.