> ## Documentation Index
> Fetch the complete documentation index at: https://orchata.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# List Documents

> Retrieve a paginated list of documents in a space with optional status filtering



## OpenAPI

````yaml api/openapi.json get /api/documents
openapi: 3.1.0
info:
  version: '0.1'
  title: Orchata API
servers:
  - url: https://api.orchata.ai
    description: Orchata API Server
security:
  - ApiKey: []
paths:
  /api/documents:
    get:
      tags:
        - Documents
      summary: List Documents
      description: >-
        Retrieve a paginated list of documents in a space with optional status
        filtering
      parameters:
        - schema:
            type: number
            minimum: 1
            default: 1
          required: false
          name: page
          in: query
        - schema:
            type: number
            minimum: 1
            maximum: 100
            default: 20
          required: false
          name: pageSize
          in: query
        - schema:
            type: string
            enum:
              - PENDING
              - PROCESSING
              - COMPLETED
              - FAILED
          required: false
          name: status
          in: query
        - schema:
            type: string
          required: false
          name: metadata
          in: query
        - schema:
            type: string
            example: space_123
            description: The ID of the space containing the documents
          required: true
          description: The ID of the space containing the documents
          name: spaceId
          in: query
      responses:
        '200':
          description: Successfully retrieved documents
          content:
            application/json:
              schema:
                type: object
                properties:
                  documents:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        orgId:
                          type: string
                        spaceId:
                          type: string
                        filename:
                          type: string
                        mimeType:
                          type: string
                        fileSize:
                          type: string
                        storageUrl:
                          type: string
                        status:
                          type: string
                        errorMessage:
                          type:
                            - string
                            - 'null'
                        embeddingModel:
                          type: string
                        indexingType:
                          type: string
                        metadata: {}
                        createdAt:
                          type: string
                          format: date-time
                        updatedAt:
                          type: string
                          format: date-time
                      required:
                        - id
                        - orgId
                        - spaceId
                        - filename
                        - mimeType
                        - fileSize
                        - storageUrl
                        - status
                        - errorMessage
                        - embeddingModel
                        - indexingType
                        - createdAt
                        - updatedAt
                  total:
                    type: number
                  page:
                    type: number
                  pageSize:
                    type: number
                  totalPages:
                    type: number
                required:
                  - documents
                  - total
                  - page
                  - pageSize
                  - totalPages
        '401':
          description: Authentication required
        '404':
          description: Space not found
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |-
            import { Orchata } from '@orchata-ai/sdk';

            const client = new Orchata({ apiKey: 'oai_your_api_key' });

            const { documents } = await client.documents.list({
              spaceId: 'space_123'
            });
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Oai-Api-Key

````