> This page is for 文档.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Get Documents

GET https://fai.buildwithfern.com/document/{domain}

Reference: https://buildwithfern.com/learn/docs/ai-features/ask-fern/api-reference/document/get-documents

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://fai.buildwithfern.com` (Production, default)
- `https://fai-dev.buildwithfern.com` (Development)
- `http://localhost:8080` (Local)

## Request

### Path parameters

- `domain` (string, required)

### Query parameters

- `page` (integer, optional, nullable) — The page number for pagination
- `limit` (integer, optional, nullable) — The number of documents per page

### Headers

- `x-fern-basepath` (string, optional, nullable) — The basepath of the docs site that the document belongs to, e.g. `/plants` for a site served at `docs.example.com/plants`. Omit this for sites served at the root of the domain. Documents are only retrieved by Ask Fern on the site matching the domain and basepath they were created with.

## Response

### 200

Successful Response

- `documents` (list of Document, required) — List of documents for the domain
- `pagination` (PaginationResponse, required) — Pagination information for the document list

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### Document

- `document_id` (string, required)
- `domain` (string, required)
- `chunk` (string, required)
- `document` (string, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `basepath` (string, optional, nullable)
- `title` (string, optional, nullable)
- `url` (string, optional, nullable)
- `version` (string, optional, nullable)
- `product` (string, optional, nullable)
- `keywords` (list of string, optional, nullable)
- `authed` (boolean, optional, nullable)

### PaginationResponse

- `total` (integer, required)
- `page` (integer, required)
- `limit` (integer, required)

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "documents": [
    {
      "document_id": "string",
      "domain": "string",
      "chunk": "string",
      "document": "string",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "basepath": "string",
      "title": "string",
      "url": "string",
      "version": "string",
      "product": "string",
      "keywords": [
        "string"
      ],
      "authed": true
    }
  ],
  "pagination": {
    "total": 1,
    "page": 1,
    "limit": 1
  }
}
```