Skip to content

Import Contacts (CSV)

Send the file as multipart/form-data under the field name file. It is read as UTF-8. Save it without a byte-order mark (Excel’s “CSV UTF-8” adds one): with one, the first header is not recognised — if that is phone, every row lacks a phone.

cURL
curl -X POST https://api.whatbot.in/public/v1/contacts/csv \
-H "X-API-Key: wa_live_xxx" \
-F "file=@contacts.csv"

The first row is a header. Each row needs a phone or a source_ref; any column that isn’t one of the named ones below becomes a custom attribute on the contact.

contacts.csv
phone,name,tags,city,product_interest,budget
9876543210,Ravi Kumar,"gold,vip",Chennai,gold coins,15L
9812300002,Priya Nair,silver,Mumbai,silver,5L
9843311220,Arjun Rao,,Bengaluru,coins,25L
ColumnRequiredBecomes
phoneOne of phone / source_refThe contact’s number (normalized to E.164)
source_refOne of phone / source_refYour own reference for the contact
name—Contact display name
tags—Tags, comma-separated inside the cell (quote the cell)
opt_in—1, true, yes, y or opted_in (any case) marks the contact opted in. Otherwise an opt_in_status column is used if present (opted_in, opted_out or pending); without one the contact is pending
ext_lead_id—An external lead reference
anything else—A custom attribute. Empty cells are skipped.

Rows with neither a usable phone nor a source_ref are skipped.

200
{ "upserted": 3 }

upserted counts the rows that were created or updated.