> ## 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.

# Generate a daily company digest

> Generate a date-windowed "what the company did today" digest.

Reuses TreeGenerationWorkflow in digest mode: a single company-wide doc,
retrieval bounded to the window, recency disabled. Returns immediately with
a tree_id (kind=DIGEST); poll GET /tree/{tree_id}/progress or fetch via
/tree/by-id/{tree_id}. See specs/flows/context-tree-daily-digest.md.

Gated per-app by the `context-tree-daily-digest` PostHog flag.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/hyperspell.yaml post /context-documents/digest
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/digest:
    post:
      tags:
        - Context Documents
      summary: Generate a daily company digest
      description: >-
        Generate a date-windowed "what the company did today" digest.


        Reuses TreeGenerationWorkflow in digest mode: a single company-wide doc,

        retrieval bounded to the window, recency disabled. Returns immediately
        with

        a tree_id (kind=DIGEST); poll GET /tree/{tree_id}/progress or fetch via

        /tree/by-id/{tree_id}. See specs/flows/context-tree-daily-digest.md.


        Gated per-app by the `context-tree-daily-digest` PostHog flag.
      operationId: generate_digest_endpoint_context_documents_digest_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DigestGenerateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreeGenerateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
        - AsUser: []
components:
  schemas:
    DigestGenerateRequest:
      properties:
        period:
          type: string
          title: Period
          description: >-
            Digest cadence: 'daily' or 'weekly'. Sets the default window when
            none is given.
          default: daily
        window_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window Start
          description: >-
            Inclusive lower bound of the digest window. Defaults to midnight UTC
            today (paired with window_end=now) when omitted. Both bounds must be
            supplied together.
        window_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window End
          description: Exclusive upper bound of the digest window. Defaults to now.
        sources:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Sources
          description: >-
            Integration sources to include (e.g., ['slack', 'github']). Defaults
            to all.
      type: object
      title: DigestGenerateRequest
      description: Request body for POST /context-documents/digest.
    TreeGenerateResponse:
      properties:
        tree_id:
          type: string
          title: Tree Id
        status:
          type: string
          title: Status
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - tree_id
        - status
        - created_at
      title: TreeGenerateResponse
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  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

````