# Find the Chunk of a Layout Block

`GET /api/knowledge/documents/hub-documents/{document_id}/chunks/by-source`

### Overview
Returns the `chunk_index` (lowest, if the block spans several chunks) of the active version whose `meta.source_ids` contains `source_id` (a layout block id such as `p6-b7`), plus `total` chunks, so the FE can jump to the right page of `/chunks`. Same access as the detail view. Active when `KNOWLEDGE_BACKEND=parser`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `document_id` | path | string | yes | Unique UUID of the knowledge document stored in the vector database. |
| `source_id` | query | string | yes |  |

## Responses

### 200 — Chunk position

### 400 — Bad Request - The request parameters or headers are invalid (e.g. unsupported API-Version).

### 401 — Unauthorized - Missing, invalid, or expired JWT Bearer token.

### 403 — Forbidden - Insufficient role permissions or resource access denied by RBAC policy.

### 404 — No such chunk, not visible, no processed version, or hub backend

### 410 — Share link expired

### 422 — `source_id` malformed (`[A-Za-z0-9_.:-]{1,64}`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `detail` | object[] | no |  |
| `detail[].loc` | string | integer[] | yes |  |
| `detail[].msg` | string | yes |  |
| `detail[].type` | string | yes |  |
| `detail[].input` | object | no |  |
| `detail[].ctx` | object | no |  |

```json
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

### 503 — Chunk store temporarily unavailable

## Example

```bash
curl -X GET "$PINTER_URL/api/knowledge/documents/hub-documents/doc_it_guidelines_2026/chunks/by-source?source_id=value" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
```
