Skip to content

Content Update

POST
View MD

This endpoint is the primary method for adding new objects or completely replacing existing ones in your search index. You send an array of objects in a JSON payload, and Luigi’s Box processes them in a batch.

The fundamental unit of data you send is the index-object. Your request body must be a JSON object containing a single root key, objects, which holds an array of these index-objects.

ParameterTypeRequiredDescription
objectsArrayAn array of one or more objects to be indexed. Recommended batch size: around 100 objects.

Each object in the objects array must follow this structure:

ParameterTypeRequiredDescription
identityStringA unique identity for the object at the index level. It must match the identity reported by analytics events. See the Identity guide.
typeStringObject type such as item, category, or article. Different types can be searched separately.
generationStringObject generation marker for bulk data synchronization.
active_fromStringISO 8601 date/time when the object should become searchable, for example 2019-05-17T21:12:35+00:00.
active_toStringISO 8601 date/time when the object should stop being searchable, for example 2019-05-17T21:12:35+00:00.
fieldsObjectObject attributes. Every field is searchable and can be used for filtering. It must include a title field.
nestedArrayArray of nested objects such as categories or variants linked to the current object.

When structuring the fields object:

  • Required: Include a title field. This serves as the object display name.
  • Numeric fields: Format values as numbers, not strings, for example "height": 70.5.
  • Date fields: Use ISO 8601 format with the T delimiter.
  • Array values: Arrays are supported for any field, for example "color": ["red", "black", "blue"].
  • Nesting: Use only one level of nesting and avoid deeply nested objects.
  • Facets: Any field you send can become a facet for filtering search results.

Read more about structuring your data.

The examples show how to prepare and send your objects array to the API endpoint.

Authentication is required for all requests. The code demonstrates how to construct the necessary headers, including Date and Authorization. The Authorization header requires a dynamically generated HMAC signature. For a detailed explanation of how to create this signature, refer to the main API Authentication guide.

HTTP StatusDescription
400 Bad RequestThe request structure is invalid, JSON is malformed, or some objects failed validation. Check the response body for details.
413 Payload Too LargeThe request exceeds 5 MB, or 10 MB if compressed. Reduce batch size or enable compression.
429 Too Many RequestsThe rate limit has been exceeded. Check the Retry-After header and see the Throttling docs.

For optimal indexing performance, avoid:

  • High nested count: More than 10 nested records per object.
  • High field count: More than 10 fields per object.
  • Large objects: More than 30 KB per object.
  • Large batches: More than 100 objects per request.