---
title: "Overwrite a Team document body"
method: PUT
path: "/api/team/v1/documents/{id}/body"
tags: ["Team documents"]
---

# Overwrite a Team document body

`PUT /api/team/v1/documents/{id}/body`

## Request

- Base URL: `https://mdflow.cz`
- URL: `https://mdflow.cz/api/team/v1/documents/{id}/body`
- Auth: HTTP bearer

Replaces the entire markdown body of one Team document; title and folder are preserved. An empty body is refused with 400 unless the request also sends `confirmEmpty: true`. The edit is attributed to the token's creator in version history and the audit feed. Returns the document without its body.

## Path parameters

- `id` string, uuid, required

## Request body

- UpdateTeamDocumentBodyInput
  - `body` string, required: Replacement markdown body. UTF-8 encoded content must not exceed 512000 bytes.
  - `confirmEmpty` boolean: Must be true when body is an empty string. An empty body is otherwise refused with 400.

## Response `200`

Updated Team document (without body).

- TeamDocumentListItem
  - `id` string, uuid, required
  - `workspace_id` string, uuid, required: The Team workspace this document belongs to. Never changes.
  - `folder_id` string, uuid, nullable, required: Containing folder, or null for a document at the workspace root.
  - `title` string, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Request body was malformed or failed validation, or an empty body was sent without confirmEmpty.
- `401`: Missing, malformed, invalid, or revoked Team access token — including a personal `mdf_` token sent to a Team route, and a token whose creator has left the team. The body includes a `message` with Team token guidance, and the response carries a `WWW-Authenticate` challenge.
- `403`: The Team access token is valid but the operation exceeds its effective access: a write from a read-only token or from a creator whose current workspace permission is read-only, a write while the Team account is not active (setup, grace, or read_only), or any request while the account is being deleted. No plan check is involved — eligibility comes from the Team seat. The body includes a `message` with guidance.
- `404`: The document does not exist in a workspace the token can read.
- `429`: The token or authenticated user exceeded a 60 requests per minute rate limit.
- `500`: Unexpected server error, or the live membership lookup failed. Retry rather than discarding the token — this is never a revocation signal.

---

[API](https://skmtc.dev/mdflow/apis/mdflow-public-api.md) · [All operations](https://skmtc.dev/mdflow/apis/mdflow-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mdflow/apis/mdflow-public-api/revisions/3691fc5d1688?raw)
