---
title: "Returns all chunks for a specific document."
method: GET
path: "/documents/{document_id}/chunks"
tags: ["Documents"]
---

# Returns all chunks for a specific document.

`GET /documents/{document_id}/chunks`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/documents/{document_id}/chunks`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/documents/:document_id/chunks/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns all chunks for a specific document.

## Path parameters

- `document_id` string, required

## Query parameters

- `collection_id` string, required

## Response `200`

Successful operation

- ChunkSearchResult[]
  - `text` string, required: The text represented by the chunk
  - `id` integer, required: The identifier of the chunk
  - `name` string, required
  - `size` integer, required: The size in bytes.
  - `pages` string, required
  - `start_time` number, double, nullable: For audio/video transcript chunks, the start time in seconds of the chunk's content, located within the document's diarization segments: exact at a speaker segment's boundary, and linearly interpolated by character position when a segment spans multiple chunks. Populated for transcript chunks returned by the get_chunks endpoint (including a mid-segment continuation chunk); null for non-transcript chunks and documents without captured segment timestamps. Chunk search and match results do not carry per-chunk times — use get_chunks, or get_audio_timestamps for full exact per-segment timing.
  - `end_time` number, double, nullable: For audio/video transcript chunks, the end time in seconds of the chunk's content, located within the document's diarization segments: exact at a speaker segment's boundary (so the final chunk ends at the true segment end) and linearly interpolated by character position within a segment that spans multiple chunks, so it never overshoots the text the chunk holds. Populated for transcript chunks returned by the get_chunks endpoint; null for non-transcript chunks and documents without captured segment timestamps. Chunk search and match results do not carry per-chunk times.
  - `topic` string, required
  - `score` number, double, required

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
