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

# Documents currently active but unretrieved (or stale beyond N days)



## OpenAPI

````yaml /api-reference/openapi.json get /v1/analytics/knowledge/documents/stale
openapi: 3.1.0
info:
  title: Feather API
  description: >-
    Unified customer experience platform API. Manages identity, conversations,
    memory, agents, procedures, policies, model routing, knowledge bases,
    integrations, and runtime execution.
  version: 1.21.0
servers:
  - url: https://api-sandbox.featherhq.com
    description: Sandbox
  - url: http://localhost:8000
    description: Local dev
security: []
paths:
  /v1/analytics/knowledge/documents/stale:
    get:
      tags:
        - analytics
      summary: Documents currently active but unretrieved (or stale beyond N days)
      operationId: getStaleDocuments
      parameters:
        - name: kb_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Kb Id
        - name: stale_after_days
          in: query
          required: false
          schema:
            type: integer
            maximum: 365
            minimum: 1
            default: 30
            title: Stale After Days
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 100
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StaleDocumentRow'
                title: Response Getstaledocuments
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    StaleDocumentRow:
      properties:
        document_id:
          type: string
          title: Document Id
        knowledge_base_id:
          type: string
          title: Knowledge Base Id
        last_completed_at:
          type: string
          format: date-time
          title: Last Completed At
        last_retrieved_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Retrieved At
        days_since_last_hit:
          anyOf:
            - type: integer
            - type: 'null'
          title: Days Since Last Hit
      type: object
      required:
        - document_id
        - knowledge_base_id
        - last_completed_at
      title: StaleDocumentRow
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response returned by all API error handlers.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````