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

# Seed or update scratchpad

> Trigger cross-pollination scratchpad seeding or update for a session.
The scratchpad tracks themes, emerging consensus, open tensions, and
well-covered questions across all participant conversations.

**Modes:**
- `seed` (default): Process all user messages from scratch. Resumes from
  existing progress if the session was partially seeded.
- `update`: Process only new messages since the last update.
- `status`: Return current scratchpad state without processing.

Cross-pollination must be enabled on the session. Requires editor role.

For large sessions, seeding may take multiple calls (up to 5 minutes per
call). Each batch is persisted to the database, so partial progress
survives timeouts. Re-call the endpoint to continue.




## OpenAPI

````yaml /api-reference/openapi.yaml post /sessions/{id}/scratchpad
openapi: 3.1.0
info:
  title: Harmonica API
  version: 1.0.0
  description: >
    REST API for the Harmonica structured deliberation platform.

    Provides access to sessions and their data, including creating, updating,
    and querying sessions, plus response submission for active sessions.
  contact:
    name: Harmonica
    url: https://harmonica.chat
servers:
  - url: https://app.harmonica.chat/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - apiKey: []
paths:
  /sessions/{id}/scratchpad:
    post:
      tags:
        - Sessions
      summary: Seed or update scratchpad
      description: |
        Trigger cross-pollination scratchpad seeding or update for a session.
        The scratchpad tracks themes, emerging consensus, open tensions, and
        well-covered questions across all participant conversations.

        **Modes:**
        - `seed` (default): Process all user messages from scratch. Resumes from
          existing progress if the session was partially seeded.
        - `update`: Process only new messages since the last update.
        - `status`: Return current scratchpad state without processing.

        Cross-pollination must be enabled on the session. Requires editor role.

        For large sessions, seeding may take multiple calls (up to 5 minutes per
        call). Each batch is persisted to the database, so partial progress
        survives timeouts. Re-call the endpoint to continue.
      operationId: seedScratchpad
      parameters:
        - $ref: '#/components/parameters/sessionId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - seed
                    - update
                    - status
                  default: seed
                  description: Processing mode
      responses:
        '200':
          description: Scratchpad result
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - completed
                      - partial
                      - no_data
                      - exists
                      - empty
                    description: |
                      `completed` — all messages processed.
                      `partial` — timed out, call again to continue.
                      `no_data` — no user messages in session.
                      `exists`/`empty` — status mode response.
                  themes:
                    type: integer
                    description: Number of themes identified
                  participants:
                    type: integer
                    description: Number of participants tracked
                  batches_processed:
                    type: integer
                    description: Batches completed in this call
                  batches_total:
                    type: integer
                    description: Total batches needed for remaining messages
                required:
                  - status
                  - themes
                  - participants
        '400':
          description: Cross-pollination not enabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: validation_error
                  message: Cross-pollination is not enabled for this session
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    sessionId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Session ID
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - not_found
                - validation_error
                - rate_limited
                - internal_error
                - unprocessable
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or missing API key
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: forbidden
              message: You don't have access to this session
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: Session not found
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: |
        API key authentication. Pass your key as a Bearer token.
        Keys use the format `hm_live_<32 hex chars>`.
        Generate keys from your Harmonica dashboard settings.

````