Batch Add or Update Items

search suggestions
curl -X PUT -H "Content-Type: application/json" \
-d '{"items": [ {"item_name": "Golden Retriever"}, {"item_name": "Poodle"} ],
"section":"Search Suggestions"}' \
-u"[your token]:" "[your API key]"
curl -X PUT -H "Content-Type: application/json" \
-d '{
"items": [
"item_name": "Labradoodle",
"suggested_score": 360,
"keywords": ["poodle","labrador","retriever"],
"url": "",
"image_url": "",
"description": "A crossbreed dog created by crossing the Labrador Retriever and the Poodle",
"metadata": { "animal": "dog" },
"group_ids": [ "23", "45" ]
"item_name": "Australian Shepherd",
"suggested_score": 130,
"keywords": ["aussie"],
"url": "",
"image_url": "",
"description": "A medium-sized breed of dog developed on ranches in the Western United States",
"metadata": { "animal": "dog" },
"group_ids": [ "67", "89" ]
}' \
-u"[your token]:" "[your API key]"

The above command(s) return a 204 Success response on success.

A batch add or update allows you to add a group of items to your index without first checking to make sure no item in the batch already exists.

Any items that don't already exist are created, and any items that already exist are updated. This is also known as an UPSERT operation.

To add or update a batch of items to your index, use the PUT /batch_items call, with ?force=1. Options are the same as for the standard Batch Add Items call: item_name and section are required and all other parameters are optional.

We determine whether items already exist based on the item_name and section set for each item. However, if the optional id parameter is set for the items, we determine whether items already exist using this parameter.

There is a limit of 1,000 items per batch request.

HTTP Request#

PUT[your API key]

JSON Parameters#

sectionYesYour autosuggest and search reuslts can have multiple sections like "Products" and "Search Suggestions". This indicates which section this item is for. See your dashboard for the section names to use.
itemsYesA list of items with the same attributes as defined in the Add an Item resource