---
title: "Update Chunk"
method: PUT
path: "/api/chunk"
tags: ["Chunk"]
---

# Update Chunk

`PUT /api/chunk`

Update a chunk. If you try to change the tracking_id of the chunk to have the same tracking_id as an existing chunk, the request will fail. Auth'ed user or api key must have an admin or owner role for the specified dataset's organization.

## Headers

- `TR-Dataset` string, uuid, required

## Request body

- UpdateChunkReqPayload
  - `chunk_html` string, nullable — HTML content of the chunk you want to update. This can also be plaintext. The innerText of the HTML will be used to create the embedding vector. The point of using HTML is for convienience, as some users have applications where users submit HTML content. If no chunk_html is provided, the existing chunk_html will be used.
  - `chunk_id` string, uuid, nullable — Id of the chunk you want to update. You can provide either the chunk_id or the tracking_id. If both are provided, the chunk_id will be used.
  - `convert_html_to_text` boolean, nullable — Convert HTML to raw text before processing to avoid adding noise to the vector embeddings. By default this is true. If you are using HTML content that you want to be included in the vector embeddings, set this to false.
  - `fulltext_boost` FullTextBoost — Boost the presence of certain tokens for fulltext (SPLADE) and keyword (BM25) search. I.e. boosting title phrases to priortize title matches or making sure that the listing for AirBNB itself ranks higher than companies who make software for AirBNB hosts by boosting the in-document-frequency of the AirBNB token (AKA word) for its official listing. Conceptually it multiples the in-document-importance second value in the tuples of the SPLADE or BM25 sparse vector of the chunk_html innerText for all tokens present in the boost phrase by the boost factor like so: (token, in-document-importance) -> (token, in-document-importance*boost_factor).
    - `boost_factor` number, double, required — Amount to multiplicatevly increase the frequency of the tokens in the phrase by
    - `phrase` string, required — The phrase to boost in the fulltext document frequency index
  - `group_ids` string[], nullable — Group ids are the ids of the groups that the chunk should be placed into. This is useful for when you want to update a chunk and add it to a group or multiple groups in one request.
  - `group_tracking_ids` string[], nullable — Group tracking_ids are the tracking_ids of the groups that the chunk should be placed into. This is useful for when you want to update a chunk and add it to a group or multiple groups in one request.
  - `image_urls` string[], nullable — Image urls are a list of urls to images that are associated with the chunk. This is useful for when you want to associate images with a chunk. If no image_urls are provided, the existing image_urls will be used.
  - `link` string, nullable — Link of the chunk you want to update. This can also be any string. Frequently, this is a link to the source of the chunk. The link value will not affect the embedding creation. If no link is provided, the existing link will be used.
  - `location` GeoInfo — Location that you want to use as the center of the search.
    - `lat` union, required
      - integer
      - number, double
    - `lon` union, required
      - integer
      - number, double
  - `metadata` unknown
  - `num_value` number, double, nullable — Num value is an arbitrary numerical value that can be used to filter chunks. This is useful for when you want to filter chunks by numerical value. If no num_value is provided, the existing num_value will be used.
  - `semantic_boost` SemanticBoost — Semantic boosting moves the dense vector of the chunk in the direction of the distance phrase for semantic search. I.e. you can force a cluster by moving every chunk for a PDF closer to its title or push a chunk with a chunk_html of "iphone" 25% closer to the term "flagship" by using the distance phrase "flagship" and a distance factor of 0.25. Conceptually it's drawing a line (euclidean/L2 distance) between the vector for the innerText of the chunk_html and distance_phrase then moving the vector of the chunk_html distance_factor*L2Distance closer to or away from the distance_phrase point along the line between the two points.
    - `distance_factor` number, float, required — Arbitrary float (positive or negative) specifying the multiplicate factor to apply before summing the phrase vector with the chunk_html embedding vector
    - `phrase` string, required — Terms to embed in order to create the vector which is weighted summed with the chunk_html embedding vector
  - `tag_set` string[], nullable — Tag set is a list of tags. This can be used to filter chunks by tag. Unlike with metadata filtering, HNSW indices will exist for each tag such that there is not a performance hit for filtering on them. If no tag_set is provided, the existing tag_set will be used.
  - `time_stamp` string, nullable — Time_stamp should be an ISO 8601 combined date and time without timezone. It is used for time window filtering and recency-biasing search results. If no time_stamp is provided, the existing time_stamp will be used.
  - `tracking_id` string, nullable — Tracking_id of the chunk you want to update. This is required to match an existing chunk.
  - `weight` number, double, nullable — Weight is a float which can be used to bias search results. This is useful for when you want to bias search results for a chunk. The magnitude only matters relative to other chunks in the chunk's dataset dataset. If no weight is provided, the existing weight will be used.

## Response `204`

No content Ok response indicating the chunk was updated as requested

## Other responses

- `400` — Service error relating to to updating chunk, likely due to conflicting tracking_id

---

[API](https://skmtc.net/devflowinc/apis/trieve-api.md) · [All operations](https://skmtc.net/devflowinc/apis/trieve-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/devflowinc/trieve-api/revisions/84583e7c9fc1/schema)
