---
title: "Update an Existing Document"
method: PUT
path: "/v1/document/{document_id}"
tags: ["Document"]
---

# Update an Existing Document

`PUT /v1/document/{document_id}`

Update an existing documents's details by document ID

## Path parameters

- `document_id` string, uuid, required

## Request body

- UpdateDocument
  - `context` BaseRequestContext
    - `projectId` string, uuid
    - `processPublicId` string, uuid, nullable
    - `processSectionPublicId` string, uuid, nullable
    - `processResponsePublicId` string, uuid, nullable
  - `name` string, nullable
  - `type` string, nullable
  - `description` union
    - object, nullable
    - Draftjs
      - `content` DraftjsContent, required
        - `blocks` DraftjsBlock[], required
          - `data` object, required
          - `depth` integer, required
          - `entityRanges` DraftjsEntityRange[], required
            - `offset` integer, required
            - `length` integer, required
            - `key` integer, required
          - `inlineStyleRanges` DraftjsInlineStyleRange[], required
            - `offset` integer, required
            - `length` integer, required
            - `style` string, required
          - `key` string, required
          - `text` string, required
          - `type` string, required
        - `entityMap` object, required
  - `plaintextDescription` string, nullable
  - `logo` string, nullable
  - `variables` string[], nullable
  - `expandByDefault` boolean
  - `allowComments` boolean
  - `isTemplate` boolean
  - `lockedTemplate` boolean

## Response `200`

Document successfully updated

- object
  - `metadata` object
  - `data` SimpleDocument
    - `publicId` string, uuid
    - `description` unknown
    - `logo` string
    - `name` string
    - `type` string
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `isDeleted` boolean
    - `deletedAt` string, date-time, nullable
    - `children` DocumentSection[]
      - `name` string
      - `publicId` string, uuid
    - `variables` string[]
    - `variableValues` string[]
    - `expandByDefault` boolean
    - `allowComments` boolean
    - `isTemplate` boolean
    - `lockedTemplate` boolean
    - `projectPublicId` string, uuid
    - `projectName` string

## Other responses

- `403` — Not authorized to update this document
- `404` — Document not found or user lacks ownership

---

[API](https://skmtc.net/morta-technology/apis/morta-api-reference.md) · [All operations](https://skmtc.net/morta-technology/apis/morta-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/morta-technology/morta-api-reference/versions/9c58c1c1e7e8/schema)
