---
title: "Update document"
method: PATCH
path: "/v1/documents/{id}"
tags: ["Document"]
---

# Update document

`PATCH /v1/documents/{id}`

Update the document by its ID. Optional library_id moves the document to another library and clears its folder. Optional folder_id moves it within the library; JSON null removes it from the folder.

## Request body

- object
  - `title` string — Title of the document.
  - `excerpt` string, nullable — Excerpt of the document.
  - `content` string — Body of the document.
  - `library_id` string — Move the document to this organization or namespace library. Clears the folder.
  - `folder_id` string, nullable — Move the document into this folder. JSON null removes it from the folder (library root).

## Response `200`

OK

- Document — A document in an organization or namespace library.
  - `id` string, required — Unique identifier of the document.
  - `title` string, required — Title of the document.
  - `excerpt` string, nullable — Excerpt of the document.
  - `content` string, required — Body of the document.
  - `created_by` PartialUser, required — A simplified user used on issue list and detail responses.
    - `id` string, required — Unique identifier of the user.
    - `first_name` string, required — First name of the user.
    - `last_name` string, required — Last name of the user.
    - `picture` string, uri, nullable — Profile picture of the user.
  - `library` DocumentLibrary, required — The organization or namespace a document or folder is scoped to.
    - `id` string, required — Unique identifier of the library.
    - `type` 'Organization' | 'Namespace', required — Resource type of the library.
    - `name` string, required — Name of the organization or namespace.
  - `folder` DocumentFolder, required — The folder a document or nested folder is located in.
    - `id` string, required — Unique identifier of the folder.
    - `name` string, required — Name of the folder.
    - `parent_id` string — Parent folder ID when the folder is nested.
  - `relations` DocumentRelation[], required — Projects and issues this document is related to.
    - `id` string, required — Unique identifier of the related resource.
    - `type` 'Project' | 'Issue', required — Resource type of the related resource.
    - `name` string, required — Project name, or issue key.
  - `labels` PartialLabel[], required — Labels attached to the document.
    - `id` string, required — Unique identifier of the label.
    - `name` string, required — Name of the label.
  - `comment_count` integer, nullable — Number of comments on the document when projected.
  - `attachment_count` integer, nullable — Number of attachments on the document when projected.
  - `created_at` string, date-time, required — Date when the document was created.
  - `updated_at` string, date-time, nullable, required — Date when the document was updated.

## Other responses

- `400` — Bad request
- `401` — Unauthorized request
- `403` — Forbidden
- `404` — The requested resource not found
- `500` — Internal Server Error

---

[API](https://skmtc.net/opcotech/apis/elemo-api.md) · [All operations](https://skmtc.net/opcotech/apis/elemo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/opcotech/elemo-api/revisions/addaba6fddad/schema)
