Outcome
Import up to 10,000 contacts from CSV text (RFC 4180, at most 2 MB, header row required), parsed and planned by the shared @topolo-io/audience importer. mapping names the column for email and, optionally, firstName, lastName, locale, timezone and attribute keys; omit it to use suggestedMapping (returned on every call, derived from the header names). mode preview writes nothing and reports what would happen; mode commit creates new contacts (source csv) and updates names, locale, timezone and attributes (merged) of existing active contacts, matched case-insensitively by email. Archived contacts are skipped, never unarchived; rows identical to the stored contact count as unchanged; repeated emails in the file keep the first row. invalid[].line is the CSV record number (header = 1).
Before you start
- Verify identity and pin the intended organization and environment before discovering the action.
- Discover a granted Nurture workspace. The application permission is workspace:write; required workspace access is read_write. A permission alone does not supply a workspace grant.
- Organization and workspace come from verified context. Select resourceType/resourceId separately from action input; body fields cannot grant a different organization or workspace. The first authorized product action can initialize an identity-only workspace mirror.
- Obtain authorization for the documented effect or personal-data export before supplying CLI --confirm or MCP confirm:true.
Discover the target
topolo whoami --json
topolo actions get app_topolo_nurture.contacts.import --detail --json
topolo resources topolo-nurture --json
topolo workspaces list topolo-nurture --json
Request
POST /api/contacts/import
Save action input as payload.json. The reviewed plan separates path identifiers, query fields and HTTP body. Set NURTURE_WORKSPACE_ID from granted resource discovery; it is separate from action input.
Inspect and test this action in the signed action console. A test response still requires the verification below.
Input fields
| Field | Required | Type | Constraints |
|---|---|---|---|
csv | Required | string | {"minLength":1,"maxLength":2097152} |
mapping | Optional | object | {} |
mode | Required | string | {"enum":["preview","commit"]} |
delimiter | Optional | string | {"enum":[",",";","\t","|"]} |
Exact input schema:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"csv": {
"type": "string",
"minLength": 1,
"maxLength": 2097152
},
"mapping": {
"type": "object",
"properties": {
"email": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"firstName": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"lastName": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"locale": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"timezone": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"attributes": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,62}$"
},
"additionalProperties": {
"type": "string",
"minLength": 1,
"maxLength": 200
}
}
},
"required": [
"email"
],
"additionalProperties": false
},
"mode": {
"type": "string",
"enum": [
"preview",
"commit"
]
},
"delimiter": {
"type": "string",
"enum": [
",",
";",
"\t",
"|"
]
}
},
"required": [
"csv",
"mode"
],
"additionalProperties": false
}
Effects
- preview: none. commit: creates and updates contacts in the workspace; nothing is sent to anyone.
Interpret the response
This is a bulk import summary. Mode is an outcome, not a contact identifier. Verify individual contacts through contacts.list and contacts.get.
Run preview first and confirm invalid[] and wouldCreate/wouldUpdate with the user; after commit, confirm created and updated match the preview.
Exact success schema:
{
"type": "object",
"required": [
"mode",
"rows",
"valid",
"invalid",
"duplicatesInFile",
"existing"
],
"properties": {
"mode": {
"type": "string"
},
"rows": {
"type": "integer"
},
"valid": {
"type": "integer"
},
"invalid": {
"type": "array",
"items": {
"type": "object",
"required": [
"line",
"reason"
],
"properties": {
"line": {
"type": "integer"
},
"reason": {
"type": "string"
}
}
}
},
"duplicatesInFile": {
"type": "integer"
},
"existing": {
"type": "integer"
},
"skippedArchived": {
"type": "integer"
},
"unchanged": {
"type": "integer"
},
"columns": {
"type": "array",
"items": {
"type": "string"
}
},
"mapping": {
"type": "object"
},
"suggestedMapping": {
"type": [
"object",
"null"
]
},
"warnings": {
"type": "array",
"items": {
"type": "object"
}
},
"wouldCreate": {
"type": "integer"
},
"wouldUpdate": {
"type": "integer"
},
"created": {
"type": "integer"
},
"updated": {
"type": "integer"
}
}
}
Worked examples
Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Replace synthetic identifiers using credential-scoped discovery. A local success is not evidence of a deployed effect, configured provider or delivered message.
Successful request
Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.
Input · payload.json:
{
"csv": "e\nada@x.io\n",
"mapping": {
"email": "e"
},
"mode": "preview"
}
CLI:
topolo actions validate app_topolo_nurture.contacts.import --data @payload.json --json
topolo actions plan app_topolo_nurture.contacts.import --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.contacts.import --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_nurture.contacts.import",
"input": {
"csv": "e\nada@x.io\n",
"mapping": {
"email": "e"
},
"mode": "preview"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"mode": "preview",
"mapping": {
"email": "e"
},
"columns": [
"e"
],
"suggestedMapping": null,
"rows": 1,
"valid": 1,
"invalid": [],
"duplicatesInFile": 0,
"existing": 1,
"skippedArchived": 0,
"unchanged": 1,
"warnings": [],
"wouldCreate": 0,
"wouldUpdate": 0
}
HTTP 200. Run preview first and confirm invalid[] and wouldCreate/wouldUpdate with the user; after commit, confirm created and updated match the preview.
Another supported request
Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.
Input · payload.json:
{
"csv": "email\nu0@x.io\nu1@x.io\nu2@x.io\nu3@x.io\nu4@x.io\nu5@x.io\nu6@x.io\nu7@x.io\nu8@x.io\nu9@x.io\nu10@x.io\nu11@x.io\nu12@x.io\nu13@x.io\nu14@x.io\nu15@x.io\nu16@x.io\nu17@x.io\nu18@x.io\nu19@x.io\nu20@x.io\nu21@x.io\nu22@x.io\nu23@x.io\nu24@x.io\nu25@x.io\nu26@x.io\nu27@x.io\nu28@x.io\nu29@x.io\nu30@x.io\nu31@x.io\nu32@x.io\nu33@x.io\nu34@x.io\nu35@x.io\nu36@x.io\nu37@x.io\nu38@x.io\nu39@x.io\nu40@x.io\nu41@x.io\nu42@x.io\nu43@x.io\nu44@x.io\nu45@x.io\nu46@x.io\nu47@x.io\nu48@x.io\nu49@x.io\nu50@x.io\nu51@x.io\nu52@x.io\nu53@x.io\nu54@x.io\nu55@x.io\nu56@x.io\nu57@x.io\nu58@x.io\nu59@x.io\nu60@x.io\nu61@x.io\nu62@x.io\nu63@x.io\nu64@x.io\nu65@x.io\nu66@x.io\nu67@x.io\nu68@x.io\nu69@x.io\nu70@x.io\nu71@x.io\nu72@x.io\nu73@x.io\nu74@x.io\nu75@x.io\nu76@x.io\nu77@x.io\nu78@x.io\nu79@x.io\nu80@x.io\nu81@x.io\nu82@x.io\nu83@x.io\nu84@x.io\nu85@x.io\nu86@x.io\nu87@x.io\nu88@x.io\nu89@x.io\nu90@x.io\nu91@x.io\nu92@x.io\nu93@x.io\nu94@x.io\nu95@x.io\nu96@x.io\nu97@x.io\nu98@x.io\nu99@x.io\nu100@x.io\nu101@x.io\nu102@x.io\nu103@x.io\nu104@x.io\nu105@x.io\nu106@x.io\nu107@x.io\nu108@x.io\nu109@x.io\nu110@x.io\nu111@x.io\nu112@x.io\nu113@x.io\nu114@x.io\nu115@x.io\nu116@x.io\nu117@x.io\nu118@x.io\nu119@x.io\nu120@x.io\nu121@x.io\nu122@x.io\nu123@x.io\nu124@x.io\nu125@x.io\nu126@x.io\nu127@x.io\nu128@x.io\nu129@x.io\nu130@x.io\nu131@x.io\nu132@x.io\nu133@x.io\nu134@x.io\nu135@x.io\nu136@x.io\nu137@x.io\nu138@x.io\nu139@x.io\nu140@x.io\nu141@x.io\nu142@x.io\nu143@x.io\nu144@x.io\nu145@x.io\nu146@x.io\nu147@x.io\nu148@x.io\nu149@x.io\nu150@x.io\nu151@x.io\nu152@x.io\nu153@x.io\nu154@x.io\nu155@x.io\nu156@x.io\nu157@x.io\nu158@x.io\nu159@x.io\nu160@x.io\nu161@x.io\nu162@x.io\nu163@x.io\nu164@x.io\nu165@x.io\nu166@x.io\nu167@x.io\nu168@x.io\nu169@x.io\nu170@x.io\nu171@x.io\nu172@x.io\nu173@x.io\nu174@x.io\nu175@x.io\nu176@x.io\nu177@x.io\nu178@x.io\nu179@x.io\nu180@x.io\nu181@x.io\nu182@x.io\nu183@x.io\nu184@x.io\nu185@x.io\nu186@x.io\nu187@x.io\nu188@x.io\nu189@x.io\nu190@x.io\nu191@x.io\nu192@x.io\nu193@x.io\nu194@x.io\nu195@x.io\nu196@x.io\nu197@x.io\nu198@x.io\nu199@x.io\nu200@x.io\nu201@x.io\nu202@x.io\nu203@x.io\nu204@x.io\nu205@x.io\nu206@x.io\nu207@x.io\nu208@x.io\nu209@x.io\nu210@x.io\nu211@x.io\nu212@x.io\nu213@x.io\nu214@x.io\nu215@x.io\nu216@x.io\nu217@x.io\nu218@x.io\nu219@x.io\nu220@x.io\nu221@x.io\nu222@x.io\nu223@x.io\nu224@x.io\nu225@x.io\nu226@x.io\nu227@x.io\nu228@x.io\nu229@x.io\nu230@x.io\nu231@x.io\nu232@x.io\nu233@x.io\nu234@x.io\nu235@x.io\nu236@x.io\nu237@x.io\nu238@x.io\nu239@x.io\nu240@x.io\nu241@x.io\nu242@x.io\nu243@x.io\nu244@x.io\nu245@x.io\nu246@x.io\nu247@x.io\nu248@x.io\nu249@x.io",
"mapping": {
"email": "email"
},
"mode": "commit",
"delimiter": ";"
}
CLI:
topolo actions validate app_topolo_nurture.contacts.import --data @payload.json --json
topolo actions plan app_topolo_nurture.contacts.import --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_nurture.contacts.import --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --confirm --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_nurture.contacts.import",
"input": {
"csv": "email\nu0@x.io\nu1@x.io\nu2@x.io\nu3@x.io\nu4@x.io\nu5@x.io\nu6@x.io\nu7@x.io\nu8@x.io\nu9@x.io\nu10@x.io\nu11@x.io\nu12@x.io\nu13@x.io\nu14@x.io\nu15@x.io\nu16@x.io\nu17@x.io\nu18@x.io\nu19@x.io\nu20@x.io\nu21@x.io\nu22@x.io\nu23@x.io\nu24@x.io\nu25@x.io\nu26@x.io\nu27@x.io\nu28@x.io\nu29@x.io\nu30@x.io\nu31@x.io\nu32@x.io\nu33@x.io\nu34@x.io\nu35@x.io\nu36@x.io\nu37@x.io\nu38@x.io\nu39@x.io\nu40@x.io\nu41@x.io\nu42@x.io\nu43@x.io\nu44@x.io\nu45@x.io\nu46@x.io\nu47@x.io\nu48@x.io\nu49@x.io\nu50@x.io\nu51@x.io\nu52@x.io\nu53@x.io\nu54@x.io\nu55@x.io\nu56@x.io\nu57@x.io\nu58@x.io\nu59@x.io\nu60@x.io\nu61@x.io\nu62@x.io\nu63@x.io\nu64@x.io\nu65@x.io\nu66@x.io\nu67@x.io\nu68@x.io\nu69@x.io\nu70@x.io\nu71@x.io\nu72@x.io\nu73@x.io\nu74@x.io\nu75@x.io\nu76@x.io\nu77@x.io\nu78@x.io\nu79@x.io\nu80@x.io\nu81@x.io\nu82@x.io\nu83@x.io\nu84@x.io\nu85@x.io\nu86@x.io\nu87@x.io\nu88@x.io\nu89@x.io\nu90@x.io\nu91@x.io\nu92@x.io\nu93@x.io\nu94@x.io\nu95@x.io\nu96@x.io\nu97@x.io\nu98@x.io\nu99@x.io\nu100@x.io\nu101@x.io\nu102@x.io\nu103@x.io\nu104@x.io\nu105@x.io\nu106@x.io\nu107@x.io\nu108@x.io\nu109@x.io\nu110@x.io\nu111@x.io\nu112@x.io\nu113@x.io\nu114@x.io\nu115@x.io\nu116@x.io\nu117@x.io\nu118@x.io\nu119@x.io\nu120@x.io\nu121@x.io\nu122@x.io\nu123@x.io\nu124@x.io\nu125@x.io\nu126@x.io\nu127@x.io\nu128@x.io\nu129@x.io\nu130@x.io\nu131@x.io\nu132@x.io\nu133@x.io\nu134@x.io\nu135@x.io\nu136@x.io\nu137@x.io\nu138@x.io\nu139@x.io\nu140@x.io\nu141@x.io\nu142@x.io\nu143@x.io\nu144@x.io\nu145@x.io\nu146@x.io\nu147@x.io\nu148@x.io\nu149@x.io\nu150@x.io\nu151@x.io\nu152@x.io\nu153@x.io\nu154@x.io\nu155@x.io\nu156@x.io\nu157@x.io\nu158@x.io\nu159@x.io\nu160@x.io\nu161@x.io\nu162@x.io\nu163@x.io\nu164@x.io\nu165@x.io\nu166@x.io\nu167@x.io\nu168@x.io\nu169@x.io\nu170@x.io\nu171@x.io\nu172@x.io\nu173@x.io\nu174@x.io\nu175@x.io\nu176@x.io\nu177@x.io\nu178@x.io\nu179@x.io\nu180@x.io\nu181@x.io\nu182@x.io\nu183@x.io\nu184@x.io\nu185@x.io\nu186@x.io\nu187@x.io\nu188@x.io\nu189@x.io\nu190@x.io\nu191@x.io\nu192@x.io\nu193@x.io\nu194@x.io\nu195@x.io\nu196@x.io\nu197@x.io\nu198@x.io\nu199@x.io\nu200@x.io\nu201@x.io\nu202@x.io\nu203@x.io\nu204@x.io\nu205@x.io\nu206@x.io\nu207@x.io\nu208@x.io\nu209@x.io\nu210@x.io\nu211@x.io\nu212@x.io\nu213@x.io\nu214@x.io\nu215@x.io\nu216@x.io\nu217@x.io\nu218@x.io\nu219@x.io\nu220@x.io\nu221@x.io\nu222@x.io\nu223@x.io\nu224@x.io\nu225@x.io\nu226@x.io\nu227@x.io\nu228@x.io\nu229@x.io\nu230@x.io\nu231@x.io\nu232@x.io\nu233@x.io\nu234@x.io\nu235@x.io\nu236@x.io\nu237@x.io\nu238@x.io\nu239@x.io\nu240@x.io\nu241@x.io\nu242@x.io\nu243@x.io\nu244@x.io\nu245@x.io\nu246@x.io\nu247@x.io\nu248@x.io\nu249@x.io",
"mapping": {
"email": "email"
},
"mode": "commit",
"delimiter": ";"
},
"resourceType": "workspace",
"resourceId": "<identifier returned by resource discovery>",
"confirm": true
}
}
Captured local response · HTTP 200:
{
"mode": "commit",
"mapping": {
"email": "email"
},
"columns": [
"email"
],
"suggestedMapping": {
"attributes": {},
"email": "email"
},
"rows": 250,
"valid": 250,
"invalid": [],
"duplicatesInFile": 0,
"existing": 0,
"skippedArchived": 0,
"unchanged": 0,
"warnings": [],
"created": 250,
"updated": 0
}
HTTP 200. Run preview first and confirm invalid[] and wouldCreate/wouldUpdate with the user; after commit, confirm created and updated match the preview.
Refused request · invalid_csv
Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.
Input · payload.json:
{
"csv": "email\n\"open",
"mapping": {
"email": "email"
},
"mode": "preview"
}
CLI:
topolo actions validate app_topolo_nurture.contacts.import --data @payload.json --json
topolo actions plan app_topolo_nurture.contacts.import --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 422:
{
"error": {
"code": "invalid_csv",
"message": "quoted field is not terminated",
"details": {
"line": 2
}
}
}
HTTP 422. Preserve the refusal details and do not claim success.
Refused request · mapping_column_missing
Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.
Input · payload.json:
{
"csv": "email\na@x.io",
"mapping": {
"email": "mail"
},
"mode": "preview"
}
CLI:
topolo actions validate app_topolo_nurture.contacts.import --data @payload.json --json
topolo actions plan app_topolo_nurture.contacts.import --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 422:
{
"error": {
"code": "mapping_column_missing",
"message": "The CSV header has no column named mail.",
"details": {
"missingColumns": [
"mail"
]
}
}
}
HTTP 422. Preserve the refusal details and do not claim success.
Refused request · invalid_input
Actual dispatcher and migration-created SQLite; verified identity/workspace and external CRM, Engage, Notify, Consent, Nexus, Brand, Generator, Voice and delivery dependencies are simulated. No live authorization, paid generation or external delivery is established.
Input · payload.json:
{
"csv": "x",
"mapping": {
"email": "email"
},
"mode": "bogus"
}
CLI:
topolo actions validate app_topolo_nurture.contacts.import --data @payload.json --json
topolo actions plan app_topolo_nurture.contacts.import --resource-type workspace --resource-id "$NURTURE_WORKSPACE_ID" --data @payload.json --json
Captured local response · HTTP 422:
{
"error": {
"code": "invalid_input",
"message": "The input does not match the action schema.",
"details": [
{
"code": "invalid_value",
"values": [
"preview",
"commit"
],
"path": [
"mode"
],
"message": "Invalid option: expected one of \"preview\"|\"commit\""
}
]
}
}
HTTP 422. Preserve the refusal details and do not claim success.
Verify the result
- Run preview first and confirm invalid[] and wouldCreate/wouldUpdate with the user; after commit, confirm created and updated match the preview.
Errors and recovery
organization_required(HTTP 403): Select an organization available to the verified caller before choosing a Nurture workspace.permission_denied(HTTP 403): Grant the credential the required Nurture workspace permission.workspace_required(HTTP 409): Create a Nurture workspace, or pass the workspace resource context.invalid_input(HTTP 422): Correct the fields named in error.details using inputSchema, then retry.invalid_csv(HTTP 422): Fix the CSV at error.details.line (usually an unclosed quote), then retry.mapping_column_missing(HTTP 422): Map only columns that exist in the header row; see error.details.missingColumns.mapping_required(HTTP 422): No header looks like an email; send mapping.email naming the email column (see error.details.columns).too_many_rows(HTTP 422): Split the file into parts of at most 10,000 rows.
Auth or gateway failures may precede this handler. Preserve the exact response shape, error string/code, request id and credential context; no synthetic fixture establishes live credential access.
Recovery boundary
An import cannot be undone as a whole; list contacts with source csv and archive or erase the ones imported in error.
Related actions
- List contacts: List the contacts Nurture holds for the caller's workspace, ordered by email, optionally filtered by status and a prefix search on email, first or last name. Pages of up to 200; pass nextCursor back as cursor for the next page.
- Erase contact permanently: Right to erasure: permanently delete one contact, remove all of its segment membership history, journey enrollments (with their steps and intended sends), lead score, score history and lead handoff records, subscription history, confirmation tokens, send reservations and contact-scoped suppression events, and detach it from every lifecycle event (the events remain without a contact). Org-wide address suppressions (hard_bounce, deliverable, complaint, wrong_person) are deliberately KEPT, keyed only by the salted address hash, so an erased address that bounced or complained can never be mailed again, and an address-scoped erased suppression event is recorded so the erased address stays suppressed org-wide for every purpose, even if it is imported again (nothing lifts it). Requires confirm: true. Event properties sent by callers are not rewritten.
Evidence
Actual dispatcher and migration-created SQLite or Worker handlers; identity/workspace and external service dependencies are simulated. Fixture identifiers and timestamps are synthetic. These responses establish no live authorization, paid generation, credential provisioning or message delivery. Test scenario and capture digests are retained with each fixture.