Skip to main content
POST /contacts/batch runs up to 1000 operations in one request. Use it for a first load, and for a nightly sync.

The four operations

Name the contact with id, or with an identity such as external_id.

A batch

Read the response

One bad operation does not stop the others. Kai runs every operation and reports each one on its own. The status code describes the request, not the rows. A request that Kai understands returns 200, even when every operation in it failed. Always read summary.errors and the results array.

Import 40,000 contacts

1

Create the attributes first

Send POST /attributes for each attribute that your rows carry. Kai refuses an attribute key that the workspace does not define.
2

Split the rows into batches of 1000

A larger request would run for minutes and can stop at a proxy timeout with no report of what it did.
3

Send the batches one after the other

Two batches that run at the same time can hold the same person and make two contacts. Send them in sequence.
4

Log the failed rows

Record index and error.type for each failed operation. Correct those rows and send them again.

Repeat a batch safely

An upsert matches on identity, so the same batch sent twice updates the same contacts. It does not make copies. Give every row an external_id if your system has one. It is the strongest match, because you control it. See Identity.