Batch indexing operations on multiple indices

Adds, updates, or deletes records in multiple indices with a single API request.

  • Actions are applied in the order they are specified.
  • Actions are equivalent to the individual API requests of the same name.

Usage

1
2
3
4
5
6
7
8
import { algoliasearch } from 'algoliasearch';

//
const client = algoliasearch('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');

const response = await client.multipleBatch({
  requests: [{ action: 'addObject', body: { key: 'value' }, indexName: 'theIndexName' }],
});
Did you find this page helpful?
JavaScript API clients v5