---
title: "Get Collection Documents"
method: GET
path: "/rag/collections/{collection_id}/documents/"
tags: ["rag"]
---

# Get Collection Documents

`GET /rag/collections/{collection_id}/documents/`

Get all documents and their chunks for a collection.

## Path parameters

- `collection_id` string, required

## Response `200`

Successful Response

- DocumentWithChunksSchema[]
  - `id` string, nullable
  - `text` string, required
  - `metadata` DocumentMetadataSchema — Metadata for a document.
    - `source` 'file' | 'url' | 'text'
    - `source_id` string, nullable
    - `created_at` string, nullable
    - `author` string, nullable
    - `title` string, nullable
    - `custom_metadata` object, nullable
  - `chunks` DocumentChunkSchema[]
    - `id` string, required
    - `text` string, required
    - `metadata` DocumentChunkMetadataSchema, required — Metadata for a document chunk.
      - `source` 'file' | 'url' | 'text'
      - `source_id` string, nullable
      - `created_at` string, nullable
      - `author` string, nullable
      - `title` string, nullable
      - `custom_metadata` object, nullable
      - `document_id` string, nullable
      - `chunk_index` integer, nullable
    - `embedding` number[], nullable

## Other responses

- `422` — Validation Error

## Changes

- **2025-03-12** `181efcea9e6e` — 1 info
  - endpoint added
- **2024-11-23** `a2d864f3a8db` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/pyspur-dev/apis/pyspur-api/changes/rag/collections/:collection_id/documents/get.md)

---

[API](https://skmtc.dev/pyspur-dev/apis/pyspur-api.md) · [All operations](https://skmtc.dev/pyspur-dev/apis/pyspur-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pyspur-dev/pyspur-api/revisions/adc77484c851/schema)
