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

# Upsert Folder Summary

> Create or update a folder summary with optional versioning.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/morphik/openapi.documented.yml put /folders/{folder_id_or_name}/summary
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /folders/{folder_id_or_name}/summary:
    put:
      tags:
        - Folders
      summary: Upsert Folder Summary
      description: Create or update a folder summary with optional versioning.
      operationId: upsert_folder_summary_folders__folder_id_or_name__summary_put
      parameters:
        - name: folder_id_or_name
          in: path
          required: true
          schema:
            type: string
            title: Folder Id Or Name
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SummaryUpsertRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SummaryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Morphik from 'morphik';


            const client = new Morphik({
              apiKey: process.env['MORPHIK_API_KEY'], // This is the default and can be omitted
            });


            const summaryResponse = await
            client.folders.upsertSummary('folder_id_or_name', {
              content: 'content',
            });


            console.log(summaryResponse.content);
        - lang: cURL
          source: |-
            curl https://api.morphik.ai/folders/$FOLDER_ID_OR_NAME/summary \
                -X PUT \
                -H 'Content-Type: application/json' \
                -H "Authorization: Bearer $MORPHIK_API_KEY" \
                -d '{
                      "content": "content"
                    }'
components:
  schemas:
    SummaryUpsertRequest:
      properties:
        content:
          type: string
          title: Content
          description: Summary content to persist (markdown/text)
        versioning:
          type: boolean
          title: Versioning
          description: >-
            When true, automatically increments the summary version instead of
            overwriting the latest version
          default: true
        overwrite_latest:
          type: boolean
          title: Overwrite Latest
          description: Allow overwriting the latest summary when versioning is disabled
          default: false
      type: object
      required:
        - content
      title: SummaryUpsertRequest
      description: Request payload for writing or updating an entity summary.
    SummaryResponse:
      properties:
        content:
          type: string
          title: Content
        storage_key:
          type: string
          title: Storage Key
        bucket:
          anyOf:
            - type: string
            - type: 'null'
          title: Bucket
        version:
          type: integer
          title: Version
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
      type: object
      required:
        - content
        - storage_key
        - version
      title: SummaryResponse
      description: Response payload returned when reading or writing summaries.
    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

````