---
title: "List a Collection's documents"
method: GET
path: "/collections/{collection_id}/documents"
tags: ["Collections"]
---

# List a Collection's documents

`GET /collections/{collection_id}/documents`

## Request

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

A user can list a Collection's documents.

## Path parameters

- `collection_id` string, required

## Query parameters

- `offset` integer
- `limit` integer
- `metadata_filter` string

## Response `200`

Successful operation

- Document[]
  - `id` string, required: A unique identifier of the document
  - `name` string, required: Name of the document
  - `username` string, required: A username owning the document
  - `type` string, required: Type of the document
  - `size` integer, required: Size of the document in bytes
  - `page_count` integer, required: A number of pages contained in the document
  - `status` 'unknown' | 'scheduled' | 'queued' | 'running' | 'completed' | 'failed' | 'canceled' | 'agent_only', required: Status of the document
  - `usage_stats` string: Usage stats
  - `connector` string
  - `original_type` string
  - `original_mtime` string, datetime
  - `created_at` string, date-time, required: Time when document was created
  - `updated_at` string, date-time, required: Last time when document was modified
  - `uri` string
  - `summary` string
  - `summary_parameters` string
  - `metadata_dict` Metadata
  - `is_encrypted` boolean: Whether the document files are encrypted at rest
  - `chat_session_id` string: A unique identifier of the chat session that generated the document. Returned by GET /documents. Only set for agent-generated files, null for user-uploaded documents.
  - `chat_session_name` string: Name of the chat session that generated the document. Returned by GET /documents. Null when the document was not generated by an agent, or when the session is not visible to the caller.
  - `chat_session_visible` boolean: Whether the caller can open the chat session that generated the document. Returned by GET /documents. Distinct from chat_session_name being null, which also happens when a visible session has no name yet.

## 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)
