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

# List Documents

> List documents for the current tenant with optional filtering and pagination.



## OpenAPI

````yaml /openapi.json get /documents
openapi: 3.1.0
info:
  title: Factio SRI API
  description: >-
    Plataforma headless, multi-tenant, API-first para emitir comprobantes
    electrónicos válidos ante el SRI de Ecuador.


    ## Autenticación


    Soporta tres métodos:

    - **JWT Bearer por Google OAuth**: `/auth/google/callback`

    - **JWT Bearer por email/password**: `/auth/login`

    - **API Key**: header `X-API-Key` con clave generada en `/auth/api-keys`


    ## Multi-tenant


    El aislamiento por tenant combina PostgreSQL RLS y validaciones explícitas
    en backend. El `tenant_id` se resuelve desde el contexto de autenticación.


    ## Flujo de Emisión


    1. `POST /documents` — reserva secuencial y encola el documento (responde
    202)

    2. `GET /documents/{id}` — consulta el estado actual por polling

    3. Cuando `status = AUTHORIZED`, el campo `authorization_number` contiene la
    clave de autorización del SRI


    Documentación completa en https://docs.factioapp.com
  version: 0.1.0
servers:
  - url: http://localhost:8000
    description: Local
  - url: https://api.factioapp.com
    description: Producción
  - url: https://api.staging.factioapp.com
    description: Sandbox (datos de prueba, sin efecto fiscal real)
security: []
paths:
  /documents:
    get:
      tags:
        - documents
      summary: List Documents
      description: >-
        List documents for the current tenant with optional filtering and
        pagination.
      operationId: list_documents_documents_get
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Page Size
        - name: document_type
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Document Type
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/DocumentStatus'
              - type: 'null'
            title: Status
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Search
        - name: date_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            title: Date From
        - name: date_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            title: Date To
        - name: issuer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Issuer Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - name: x-tenant-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Tenant-Id
        - name: factio_access_token
          in: cookie
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Factio Access Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DocumentStatus:
      type: string
      enum:
        - DRAFT
        - VALIDATED
        - NUMBER_RESERVED
        - XML_GENERATED
        - SIGNED
        - RECEPTION_PENDING
        - SUBMITTED_TO_SRI
        - RECEIVED_BY_SRI
        - AUTHORIZATION_PENDING
        - AUTHORIZED
        - REJECTED
        - RECEPTION_RETRY_SCHEDULED
        - AUTHORIZATION_RETRY_SCHEDULED
        - RECEPTION_UNKNOWN
        - AUTHORIZATION_UNKNOWN
        - MANUAL_REVIEW_REQUIRED
        - FAILED_PERMANENT
        - CANCELLATION_REQUESTED
        - CANCELLED
        - VOIDED_BY_NC
      title: DocumentStatus
      description: Status values for document lifecycle.
    DocumentListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DocumentListItem'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        page:
          type: integer
          title: Page
        page_size:
          type: integer
          title: Page Size
      type: object
      required:
        - items
        - total
        - page
        - page_size
      title: DocumentListResponse
      description: Respuesta paginada del listado de documentos.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentListItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        issuer_id:
          type: string
          format: uuid
          title: Issuer Id
        issuer_razon_social:
          type: string
          title: Issuer Razon Social
        document_type:
          $ref: '#/components/schemas/DocumentType'
        sequential:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sequential
        issue_date:
          type: string
          format: date
          title: Issue Date
        total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total
        status:
          $ref: '#/components/schemas/DocumentStatus'
        buyer_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Buyer Name
        buyer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Buyer Id
        access_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Access Key
        authorization_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Authorization Number
        authorization_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Authorization Date
        sri_environment:
          $ref: '#/components/schemas/SRIEnvironment'
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - issuer_id
        - issuer_razon_social
        - document_type
        - sequential
        - issue_date
        - total
        - status
        - buyer_name
        - buyer_id
        - access_key
        - authorization_number
        - authorization_date
        - sri_environment
        - created_at
        - updated_at
      title: DocumentListItem
      description: >-
        Item del listado de documentos — subconjunto de campos de
        DocumentResponse.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DocumentType:
      type: string
      enum:
        - '01'
        - '04'
        - '05'
        - '06'
        - '07'
      title: DocumentType
      description: Types of fiscal documents supported by the SRI.
    SRIEnvironment:
      type: string
      enum:
        - TEST
        - PRODUCTION
      title: SRIEnvironment
      description: SRI environment types.

````