Import Contacts (CSV)
Request
Section titled “Request”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 -X POST https://api.whatbot.in/public/v1/contacts/csv \ -H "X-API-Key: wa_live_xxx" \ -F "file=@contacts.csv"CSV format
Section titled “CSV format”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.
phone,name,tags,city,product_interest,budget9876543210,Ravi Kumar,"gold,vip",Chennai,gold coins,15L9812300002,Priya Nair,silver,Mumbai,silver,5L9843311220,Arjun Rao,,Bengaluru,coins,25L| Column | Required | Becomes |
|---|---|---|
phone | One of phone / source_ref | The contact’s number (normalized to E.164) |
source_ref | One of phone / source_ref | Your 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.
Response
Section titled “Response”{ "upserted": 3 }upserted counts the rows that were created or updated.