CRM: Import leads
crm_import_leadsImport up to 200 leads in one batch WITHOUT duplicates. Each row is matched against the workspace (same levels as crm_find_duplicates; or by 'lead_id' when you know it): a match is UPDATED — empty fields filled, filled ones never overwritten unless named in 'overwrite_fields' (reported as 'conflict:'), tags merged, status only moves forward ('stage_regression_ignored'); no match → CREATED; a weak match follows 'on_conflict' (merge = report as conflict and change nothing, skip, or create). Two rows of the batch with one key → the second is 'duplicate_in_batch'. 'custom' values are validated against crm_list_fields (EUR only for money; a 10-digit ЄДРПОУ is a personal code and is rejected, never stored). dry_run=true (DEFAULT) writes nothing and returns {summary, rows[{row, action, lead_id, match, reasons}]}. dry_run=false proposes the WHOLE batch for ONE confirm_action and applies it in one transaction; if the data changed before the confirm the confirm fails with plan_stale — call again. Same 'idempotency_key' → the same import is answered again. More than 200 rows → batch_too_large, nothing written: split the batch. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rows": "<rows>"
},
"name": "crm_import_leads"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | ||
| dry_run | No | ||
| dedup_keys | No | ||
| on_conflict | No | ||
| source_label | No | ||
| idempotency_key | No | ||
| overwrite_fields | No |