Add contacts to an import draft
flow_import_contactsImports contacts from a file or list the user shares: read its rows and send them here, as columns (named once) and rows (arrays of values in that order), which is about half the writing of contacts objects. Send as many rows per call as fit, up to the limit below, rather than small parts. Before the first call, ask the user which country the numbers are from, suggesting the country most of them appear to be from; send it as defaultCountry. Adds up to 5,000 contacts per call to an import draft; nothing is imported until flow_commit_contact_import. The first call starts the draft and sets defaultCountry (required), groupIds and keepContactsWithInvalidDetails; later calls pass the draftId it answered and only the rows (or contacts). Every row carries the same fields as the first (phoneNumber, plus any of firstName, lastName, email). Keep each call under about 900 KB of JSON (about 5,000 short rows); send fewer rows when they are long. Each row is checked as it arrives: invalid rows are listed by their index in the call and left out, and a row whose number the draft already holds replaces the earlier row (the last one sent wins). A draft holds up to 100,000 contacts and 20 MB (the Flow API's body limit; the answer says how much is left), and expires 2 hours after its last call, 24 hours after its first at most. A brand may have 3 drafts holding contacts; flow_discard_contact_import drops one. Whether a number or email is valid is decided after the commit, as for a file upload. When you can run code with network access, flow_start_contact_import sends a file of more than a few hundred rows in one request instead; use this tool if that request cannot reach the link.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "flow_import_contacts"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | One array per contact, values in the order of columns, null for an empty one, such as ["+385911234567", "Ana"] | |
| brandId | No | The id of the brand this change is for: the active brand (flow_whoami). Required when the connection covers several brands; the change is refused when another brand is active. | |
| columns | No | The fields of each row, in order; phoneNumber required | |
| draftId | No | Left out on the first call; then the draftId the first call answered | |
| contacts | No | The same rows as objects; send columns and rows instead | |
| groupIds | No | First call only: groups every contact joins, ids from flow_list_groups | |
| defaultCountry | No | First call only: ISO 3166-1 alpha-2 country of numbers written without a country code, such as HR | |
| keepContactsWithInvalidDetails | No | First call only: true keeps a contact whose name or email is invalid with that field left blank; false (default) rejects it |