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

# Check staleness of context documents

> Check if context documents are stale — i.e., underlying sources have
changed since the last tree was generated.

Returns the number of resources modified since the last generation,
which sources have new data, and a staleness level.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/hyperspell.yaml get /context-documents/staleness
openapi: 3.1.0
info:
  title: Hyperspell API
  summary: >-
    Hyperspell is the memory layer for AI apps and agents. Through the API, you
    can add memories, connect data sources to index them in real-time, and
    search memories with our natural language query engine.
  termsOfService: https://hyperspell.com/blog/tos
  contact:
    name: Hyperspell
    url: https://hyperspell.com/
    email: hello@hyperspell.com
  version: 0.32.1
servers:
  - url: https://api.hyperspell.com
    description: Production
security:
  - APIKey: []
    AsUser: []
paths:
  /context-documents/staleness:
    get:
      tags:
        - Context Documents
      summary: Check staleness of context documents
      description: |-
        Check if context documents are stale — i.e., underlying sources have
        changed since the last tree was generated.

        Returns the number of resources modified since the last generation,
        which sources have new data, and a staleness level.
      operationId: get_staleness_context_documents_staleness_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StalenessResponse'
      security:
        - APIKey: []
        - AsUser: []
components:
  schemas:
    StalenessResponse:
      properties:
        last_generated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Generated At
        resources_since:
          type: integer
          title: Resources Since
        sources_with_changes:
          items:
            type: string
          type: array
          title: Sources With Changes
        staleness_level:
          type: string
          title: Staleness Level
      type: object
      required:
        - last_generated_at
        - resources_since
        - sources_with_changes
        - staleness_level
      title: StalenessResponse
  securitySchemes:
    APIKey:
      type: http
      description: >-
        API Key or JWT User Token. If using an API Key, set the X-As-User header
        to act as a specific user. A JWT User Token is always scoped to a
        specific user.
      scheme: bearer
      bearerFormat: Bearer <token>
    AsUser:
      type: apiKey
      description: >-
        Optionally set this header to act as a specific user when using an API
        Key, equivalent to first exchanging the API Key for a User Token
      in: header
      name: X-As-User

````