> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# Filterable Chunk Metadata

* **Chunk metadata now works in query filters**: metadata set with the [chunk metadata endpoints](/reference/v3/documents/chunk/metadata) is written to the search index, so `filter` matches it the same way as metadata set at upload time. Previously it was returned in responses but could not be filtered on.
* **Clearer filter errors**: a filter that references an unknown field or uses an unsupported shape now returns a `400` with the underlying error message instead of a `500`. Filter keys are top-level field names, for example `{"userId": {"$eq": "..."}}`; see [Advanced Search & Relations](/guides/advanced-querying).
* **Reserved field protection**: internal field names such as `file_id` and `content` are rejected as custom metadata keys with a `400`.