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

# Bulk-clear (soft-archive) persisted edits

> Clear active edits in bulk — sets cleared_at, removing them from future
overlays (ENG-3219).

A CONTENT edit pins its file's body against every future regen until
cleared; recovering a set of manually-patched files previously meant one
DELETE per edit id. Rows are kept for audit, same as the single-edit
DELETE. ADD-edit prompt cleanup intentionally matches the single-edit
endpoint.



## OpenAPI

````yaml https://app.stainlessapi.com/api/spec/documented/hyperspell.yaml post /context-documents/tree/edits/clear
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/tree/edits/clear:
    post:
      tags:
        - Context Documents
      summary: Bulk-clear (soft-archive) persisted edits
      description: |-
        Clear active edits in bulk — sets cleared_at, removing them from future
        overlays (ENG-3219).

        A CONTENT edit pins its file's body against every future regen until
        cleared; recovering a set of manually-patched files previously meant one
        DELETE per edit id. Rows are kept for audit, same as the single-edit
        DELETE. ADD-edit prompt cleanup intentionally matches the single-edit
        endpoint.
      operationId: bulk_clear_tree_edits_context_documents_tree_edits_clear_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkClearEditsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkClearEditsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
        - AsUser: []
components:
  schemas:
    BulkClearEditsRequest:
      properties:
        paths:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Paths
          description: Only clear edits at these paths. None = any path.
        kinds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Kinds
          description: >-
            Only clear these edit kinds (content/rename/delete/add). None = any
            kind.
      type: object
      title: BulkClearEditsRequest
      description: >-
        Filters for bulk-clearing persisted tree edits. Empty = ALL active
        edits.
    BulkClearEditsResponse:
      properties:
        cleared:
          type: integer
          title: Cleared
      type: object
      required:
        - cleared
      title: BulkClearEditsResponse
    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

````