Connections, auth and API

How do I create, update or delete dataset records in bulk with the API?

Send up to 500 records per call to the dataset batch endpoint as a JSON array in the Data form field; include _id to update.

How-to

Short answer: Call Create or update dataset records in bulk (POST /dataset/2/{account_id}/{dataset_id}/batch). Send a multipart form field named Data that holds a JSON array of up to 500 records.

Why it happens

  • The batch endpoint expects multipart/form-data, not a raw JSON body. Sending the array the wrong way fails with errors such as InvalidSchemaArguments.
  • The endpoint decides what to do from each record's _id. An existing _id updates that record. A new or missing _id creates one.

How to fix it

To create or update records:

  1. Get the _id of each record you want to update with List all dataset records (GET /dataset/2/{account_id}/{dataset_id}/list). Page through it, since the default page size is 10.
  2. Build a JSON array of up to 500 objects, for example [{"_id": "<row_id_1>", "Name": "123", "Code": 1111}, {"_id": "<row_id_2>", "Name": "456", "Code": 2222}].
  3. Send it as the value of the form field Data in a multipart/form-data request to the batch endpoint.
  4. Split larger loads into calls of 500 records.

To delete dataset records:

  1. Call Delete a dataset record (DELETE /dataset/2/{account_id}/{dataset_id}) once per record.
  2. Identify the record by its Key column value in the body, for example {"Name": "Acme Corporation"}.

To delete rows from a process item's table:

  1. Call Update a process item (Admin) (PUT /process/2/{account_id}/admin/{process_id}/{instance_id}).
  2. Send the table with the row marked as deleted, for example {"_id": "<instance_id>", "<table_id>": [{"_id": "<row_id>", "_is_deleted": true}]}.

For users, Perform bulk user actions (POST /user/2/{account_id}/batch) takes an array of objects, each with the user's _id.

See API and SDK documentation for the full reference.

Important

The Kissflow Dataset connector has no delete action, and its Bulk update dataset records action handles up to 200 records. There's no bulk API to update existing process items.

Related answers