# Documents and segments

Inspect source files and parsed image artifacts, or maintain a knowledge-base document's current segment snapshot. Before changing segments, read `data.etag` from document details and submit it through `if_match` or `If-Match`. After each change, use the returned snapshot's ETag.

## Choose a task

| Task | Page | Description |
| --- | --- | --- |
| Inspect current document segments | [Query document details](../get-document.md) | Read the current snapshot, ETag, and segment pagination cursor. |
| Read a source file | [Preview source original file](../preview-source-file.md) | Preview the original files associated with the knowledge base as a binary stream. |
| Read parsed image artifacts | [Preview analysis products](../preview-processed-artifact.md) | Preview the products generated by knowledge base file parsing, such as parsing images, in a binary stream. |
| Add a content segment | [Create segments](../create-segment.md) | Create a segment in the source's current snapshot. |
| Edit segment content | [Update segments](../update-segment.md) | Updates the contents of the specified section. |
| Control segment retrieval eligibility | [Enable or disable segmentation](../set-segment-enabled.md) | Update the enabled status of the specified segment and control whether the segment participates in retrieval. |
| Remove a segment | [Delete segment](../delete-segment.md) | Irreversibly remove a segment from the current snapshot; at least one must remain. |
| Recompute segment vectors | [Revectorize](../revectorize-data-source.md) | Revectorize enabled segments and return the document snapshot after the write. |

Initial segment import and historical version switching have been removed. Add content one segment at a time. Enabling or disabling a segment changes retrieval eligibility and does not restore historical content.

```{toctree}
:hidden:
:maxdepth: 1

Get document details <../get-document>
Preview a source file <../preview-source-file>
Preview a processed image <../preview-processed-artifact>
Create a segment <../create-segment>
Update a segment <../update-segment>
Enable or disable a segment <../set-segment-enabled>
Delete a segment <../delete-segment>
Re-vectorize a data source <../revectorize-data-source>
```
