---
title: "Replace the doc body"
method: PUT
path: "/api/workspaces/{slug}/doc"
tags: ["Doc body"]
---

# Replace the doc body

`PUT /api/workspaces/{slug}/doc`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/workspaces/{slug}/doc`
- Auth: HTTP bearer

Send either `content` (ProseMirror JSON) or `markdown` (string). When both are present, `content` wins. Markdown gets converted server-side via remark + remark-gfm + Dock's rich format set (mermaid, math, callouts, cross-refs, embeds).

## Path parameters

- `slug` string, required

## Request body

- object
  - `content` unknown
  - `markdown` string

## Response `200`

Replaced.

- object
  - `content` unknown
  - `markdown` string: CommonMark + GFM. Returned when `?format=markdown` (or `Accept: text/markdown` with no `?format`).
  - `text` string: Plain text, formatting marks stripped. Returned when `?format=text` (or `Accept: text/plain` with no `?format`).
  - `updatedAt` string, date-time, required
  - `updatedBy` string, required

## Other responses

- `400`: Body shape failed validation, OR doc body exceeded byte/depth/node-count cap.

---

[API](https://skmtc.dev/trydock/apis/dock-rest-api.md) - [All operations](https://skmtc.dev/trydock/apis/dock-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trydock/apis/dock-rest-api/revisions/dd96ae96a412?raw)
