---
title: "Upsert Document Summary"
method: PUT
path: "/documents/{document_id}/summary"
tags: ["Documents"]
---

# Upsert Document Summary

`PUT /documents/{document_id}/summary`

Create or update a document summary with optional versioning.

## Path parameters

- `document_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- SummaryUpsertRequest — Request payload for writing or updating an entity summary.
  - `content` string, required — Summary content to persist (markdown/text)
  - `versioning` boolean — When true, automatically increments the summary version instead of overwriting the latest version
  - `overwrite_latest` boolean — Allow overwriting the latest summary when versioning is disabled

## Response `200`

Successful Response

- SummaryResponse — Response payload returned when reading or writing summaries.
  - `content` string, required
  - `storage_key` string, required
  - `bucket` string, nullable
  - `version` integer, required
  - `updated_at` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/morphik-org/apis/fastapi.md) · [All operations](https://skmtc.net/morphik-org/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/morphik-org/fastapi/versions/2d9291c3821d/schema)
