# Get one document's chunks

Operation ID: `graph.getVectorDocumentChunks`

Return every stored chunk of one document, ordered by chunk_index. Concatenating them reconstructs the text that was embedded. The doc_id is the identifier carried on each search hit. Reading a document from the payer-policy collection requires payer_key, the same rule the search follows: knowing a document id is not on its own enough to read another payer's policy.

## Public method

`getVectorDocumentChunks`

Signature: `graph.getVectorDocumentChunks(docId, query)`

Return type: `Promise<GetVectorDocumentChunksResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /graph/vector/documents/{doc_id}`

## Path parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `doc_id` | `string` | Yes |  |  |  | No |  |

## Query parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `collection` | `string` | No |  |  |  | No | Collection to read from; defaults to the documents corpus |
| `limit` | `integer` | No |  |  | `100` | No |  |
| `payer_key` | `string` | No |  |  |  | No | Payer slug; REQUIRED when reading from the payer-policy collection |

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`GetVectorDocumentChunksResponse`](../models/GetVectorDocumentChunksResponse.md) | application/json | The document's chunks, ordered by chunk_index |

## Success response examples

### 200

```json
{
  "chunk_count": 0,
  "chunks": [
    {
      "chunk_index": 0,
      "collection_group": "string",
      "doc_id": "string",
      "id": "string",
      "language": "string",
      "metadata": {},
      "network_id": "string",
      "payer_key": "string",
      "score": 0,
      "source": "string",
      "tags": [
        "string"
      ],
      "text": "string",
      "title": "string",
      "url": "string"
    }
  ],
  "collection": "string",
  "collection_group": "string",
  "doc_id": "string",
  "language": "string",
  "metadata": {},
  "payer_key": "string",
  "source": "string",
  "tags": [
    "string"
  ],
  "title": "string",
  "url": "string"
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | The request was invalid — a required parameter was missing or a filter value was not recognized |
| `401` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
| `404` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | No chunks exist for doc_id in the collection |
| `500` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | Internal server error |
| `503` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | Vector search is not configured in this environment |

## Error examples

### 400 — A required query parameter was missing or a filter value was not recognized (sanitized example)

```json
{
  "error": "Bad request"
}
```

### 401 — Missing or invalid access token

```json
{
  "error": "Authorization required"
}
```

### 404 — The document is not loaded in this collection

```json
{
  "error": "Document not found in the vector store"
}
```

### 500 — Unexpected service failure (sanitized example)

```json
{
  "error": "Internal server error"
}
```

### 503 — No Milvus endpoint or embedding key is provisioned

```json
{
  "error": "Vector search is not configured"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
```

```ts
const docId = "<DOC_ID>";

const query = {
  "collection": "<COLLECTION>",
  "limit": 100,
  "payer_key": "<PAYER_KEY>"
};

const result = await graph.getVectorDocumentChunks(docId, query);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-graph.health.cloud/graph/vector/documents/%3CDOC_ID%3E?collection=%3CCOLLECTION%3E&limit=100&payer_key=%3CPAYER_KEY%3E'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
