---
title: "Replace Chunk Metadata"
method: PUT
path: "/v3/collections/{collection_name}/chunks/{chunk_id}/metadata"
tags: ["file-search"]
---

# Replace Chunk Metadata

`PUT /v3/collections/{collection_name}/chunks/{chunk_id}/metadata`

Replace the custom metadata object attached to a chunk.

## Path parameters

- `collection_name` string, required
- `chunk_id` string, required

## Request body

- UpdateChunkMetadataRequestV3
  - `metadata` UpdateChunkMetadataRequestV3Metadata

## Response `200`

Replace Chunk Metadata response.

- ChunkMetadataResponseV3
  - `chunk_id` string, required
  - `metadata` ChunkMetadataResponseV3Metadata
  - `updated_at` string, nullable

## Other responses

- `401` — Missing or invalid authentication.
- `403` — API key cannot write to this collection.
- `404` — Collection not found.

---

[API](https://skmtc.dev/runcaptain/apis/api-reference.md) · [All operations](https://skmtc.dev/runcaptain/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/runcaptain/api-reference/revisions/fe4649e3f4aa/schema)
