# listdocuments: RAG – List Documents

> listdocuments (RAG – List Documents) is a 1001fx API function in the group Knowledge bases (RAG): POST https://api.1001fx.com/rag/listdocuments, 0 credits per call. It works as a ready-made module in Make or as a plain HTTP call.

Documents of a knowledge base with their metadata, newest lastModified first (sort lastModified, updatedAt or title), optionally filtered by status or metadata. Up to 1,000 per call (limit, offset). Free.

- Group: Knowledge bases (RAG)
- Endpoint: `POST https://api.1001fx.com/rag/listdocuments`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 0 credits per call
- Ready-made in: Make
- Docs: https://1001fx.com/functions/listdocuments

## Parameters

- `knowledgeBase` (string, required) – Knowledge base: Name or ID of the knowledge base, e.g. "Support FAQ" or support-faq (same knowledge base). rag/adddocument creates it if it does not exist.
- `limit` (number, optional, default `100`, min 1, max 1000) – Limit: 1-1000, default 100.
- `offset` (number, optional, default `0`, min 0) – Offset: Documents to skip.
- `status` (enum, optional, one of `queued`, `processing`, `ready`, `failed`) – Status: Only documents with this status.
- `sort` (enum, optional, one of `lastModified`, `updatedAt`, `title`, default `lastModified`) – Sort: lastModified (default, newest first), updatedAt or title.
- `filter` (any, optional) – Filter: Only documents whose metadata match. Object {"department": "billing", "lastModified": {"$gte": "2026-01-01"}} (operators $eq $ne $in $nin $gt $gte $lt $lte $exists $contains, $and $or $not) or array [{"key", "operator", "value", "type"}] (all must match).
- `filterJson` (string, optional) – Filter (JSON): The filter as JSON text, e.g. for OR conditions from Make: {"$or": [{"department": "billing"}, {"department": "sales"}]}.

## Example: RAG – List Documents

```bash
curl -X POST 'https://api.1001fx.com/rag/listdocuments' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"knowledgeBase":"Support FAQ","limit":50}'
```
