JSON API

Partial Updates (Patch)

4min

Overview

The PATCH API allows for partial updates of records within the Klevu indexing system. This means that you can update specific fields of a record without needing to resend the entire record. This is particularly useful for making quick, incremental updates to your data, reducing bandwidth usage, and improving efficiency. The PATCH API adheres to the JSON PATCH (RFC 6902) standard, ensuring a flexible and standardized approach to partial updates.

Use Cases

  1. Price Updates: A retailer wants to update the prices of products frequently based on market trends or promotional events. Using the PATCH API, they can update the price attribute without resending the entire product record.
  2. Stock Level Adjustments: An online store needs to update the stock levels of products as sales occur. The PATCH API allows them to adjust the stock attribute efficiently.
  3. Metadata Updates: A content management system (CMS) needs to update metadata like tags or descriptions of articles without altering the core content. Using the PATCH API, they can target these specific attributes.

Limitations

  • Immutable Fields: The id and type attributes cannot be changed. Any attempt to modify these fields will result in an error.
  • JSON PATCH Operations: The API only supports operations defined by JSON PATCH (RFC 6902) such as add, remove, replace



For more detailed information on API specifications, we recommend referring data indexing API definition on the Swagger online editor, please click the link

Examples of partial updates

please refer to the examples available Relations

Updated 05 Jul 2024
Doc contributor
Did this page help you?