Import

Import contacts or companies from a CSV

import_csv · Changes data · Markdown

Imports contacts or companies from a CSV, as text or a link, matching columns by their names; importing it again updates instead of duplicating.

$0.001 per record imported (created or updated)

From your agent’s balance. A call that fails costs nothing.

An example

Import the leads from the hospitality fair in Hamburg. Lena exported them from the badge scanner as a CSV.

Your agent callsimport_csv$0.001 per record imported (created or updated)

The example business is Hansen & Voss, a restaurant-equipment wholesaler in Hamburg with 60 staff. The reply is the one the tool really gives.

With these arguments
{
  "kind": "contacts",
  "csv": "Email,First name,Last name,Company,City\nmarie.koch@restaurant-koch.example,Marie,Koch,Restaurant Koch,Hamburg\nb.yilmaz@yilmaz-hotels.example,Berk,Yilmaz,Yilmaz Hotels,Kiel\n"
}
What comes back
{
  "source": "csv",
  "done": true,
  "records_imported": 2,
  "imported": {
    "contacts": {
      "created": 2,
      "updated": 0,
      "unchanged": 0,
      "skipped": 0
    }
  },
  "kind": "contacts",
  "rows_in_file": 2,
  "rows_read": 2,
  "columns": {
    "mapped": {
      "Email": "email",
      "First name": "first_name",
      "Last name": "last_name",
      "Company": "company",
      "City": "location"
    },
    "ignored": []
  }
}

Use it when

People or companies arrive as a spreadsheet: a trade fair list, an export from another tool.

What it does

Import contacts or companies from a CSV file: send its text as csv, or an https link to it as url (a public Google Sheets CSV link works). Columns are matched by their header names in any case or spelling: email, name, first name, last name, phone or mobile, company or organization, domain, website, title or job title, notes, address, city or country (joined into location), lifecycle stage, timezone, language; for companies: name, domain, website, industry, employees, lifecycle stage, notes. The result lists the columns it mapped and the ones it ignored. Contacts match existing ones by email, companies by domain and then by name, so importing the same file again updates instead of duplicating. Up to 5,000 rows a call: a longer file returns next_cursor to continue. Unchanged records are free, and 1,000 imported records cost $1. max_records x $0.001 is reserved while it runs and only what was imported is charged; lower max_records if your balance is smaller.

What comes back

source, done, records_imported, imported (created, updated, unchanged, skipped), kind, rows_in_file, rows_read and columns (mapped and ignored); next_cursor when rows remain. Every reply also carries cost_usd and balance_usd.

Inputs

NameTypeWhat it is
kindstringWhat each row is. One of: contacts,companies. Default: contacts.
csvstringThe CSV text, column names in the first row (up to about 2 MB; use url for more). 1 to 2,000,000 characters.
urlstringAn https link to the CSV file, instead of csv. At most 20 MB. 8 to 2,048 characters.
max_recordsintegerThe most rows to read in this call (5,000 at most). 1 to 5,000. Default: 5000.
next_cursorstringThe next_cursor a previous run of this import returned, to continue where it stopped. Up to 2,000 characters.

The call

Over MCP, call import_csv on https://api.conecto.chat/mcp/imports. Over REST:

Terminal
curl -X POST https://api.conecto.chat/v1/tools/import_csv \
  -H "Authorization: Bearer $CONECTO_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"contacts","csv":"Email,First name,Last name,Company,City\nmarie.koch@restaurant-koch.example,Marie,Koch,Restaurant Koch,Hamburg\nb.yilmaz@yilmaz-hotels.example,Berk,Yilmaz,Yilmaz Hotels,Kiel\n"}'

When it refuses

A refused call costs nothing and says what to do next.

CodeWhenWhat to do
invalid_input400Neither or both of csv and url were given, the CSV is empty or has no header row, or url is not a public https:// link.Send one of them, with the column names in the first row.
unmapped_columns422No column looks like an email, name or phone (for companies: a name, domain or website).Name the columns like Email, Name, Company and send it again.
fetch_failed422The link answered with an error or redirected too often.Make sure anyone with the link can open the CSV itself.
fetch_failed502The link did not answer.Check it and try again.
too_large413The file at the link is over 20 MB.Split it and import the parts one by one.
invalid_cursor400next_cursor is not one this import returned.Pass back exactly the next_cursor of the last run, or leave it out to start again (nothing is duplicated).

Give this to your agent.

Set up Conecto from https://conecto.chat/SKILL.md