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

# Update a document

`PATCH /documents/{id}`

Updates a document. Only drafts and stored contracts can be updated.

## Path parameters

- `id` string, uuid, required

## Request body

- DocumentUpdateRequest — Used to update the document
  - `document` object, required — Document parameters
    - `attachments` object[], nullable — Document attachments
      - `filename` string, nullable — Optional attachment name. We will use it when the user downloads the attachment, as well as display it next to the attachment in the app and in the PDF.
      - `original` string, uri — URL of the attachment
      - `preview` string[] — If the original is a document, this field will hold an list URL with image previews of each page
    - `attachments_signed_separately` boolean — Indicates if the attachments should be signed and sealed separately
    - `company_logo_url` string, uri, nullable — The URL of the logo shown in the contract
    - `data_fields` object[] — Data fields in the document
      - `config` object — Additional config for this data field. Contains `options` for `select`, or `label` for `checkbox`.
        - `label` string, nullable
        - `options` string[]
      - `description` string, nullable — Description
      - `formatting` object, nullable — Formatting
        - `fractional` boolean, nullable
        - `grouping` '' | 'dot' | 'comma' | 'space', nullable
      - `id` string, uuid — Unique ID
      - `name` string, required — Name
      - `required` boolean — Whether this data field must be filled to send the document for signature
      - `source` 'drafter_questionnaire' | 'ai' | 'salesforce', nullable — Source of data for this data field
      - `source_mapping` string, nullable — Integration data mapping for this data field. Revealed only when connected to the same integration instance.
      - `source_sync_type` 'downstream' | 'upstream' | 'bidirectional', nullable — Integration sync mode for this data field. Revealed only when connected to the same integration instance.
      - `type` 'text' | 'number' | 'date' | 'select' | 'checkbox', required — Type
      - `value` string, nullable, required — Value
    - `dynamic_tables` object[]
      - `attrs` object, required — Attributes of the dynamic table
        - `columns` string[], required — Column names
        - `id` string, required — Dynamic table ID
        - `rows` array[], required — Data for the table rows
          - string[] — Table row
    - `language` string, nullable — Language
    - `message` object
      - `content` string — Message content
    - `parties` object[] — Parties and signees
      - `address` string, nullable — Address
      - `id` string, uuid, nullable — Unique ID
      - `name` string, nullable — Name
      - `number` string, nullable — Company's VAT number or CVR
      - `reference` string, nullable — How the party will be referred to in the document
      - `signees` object[] — Party's signees
        - `changes_requested_at` string, date-time, nullable — Date and time when the signee requested changes to the document
        - `email` string, email, nullable — Signee's email address
        - `full_name` string, nullable — Signee's full name
        - `id` string, uuid, nullable — Unique ID
        - `opened_at` string, date-time, nullable — Date and time when the signee opened the document
        - `order` integer — Signee's signing order. When the signing order mode is set to `grouped`, then this number represents the signee's group number.
        - `rejected_at` string, date-time, nullable — Date and time when the signee rejected the document
        - `signature_verification_methods` string[], nullable — List of allowed signature types for the signee
        - `signed_at` string, date-time, nullable — Date and time when the signee signed the document
        - `title` string, nullable — Signee's title
      - `type` 'personal' | 'company' — Type
    - `signing_order_mode` 'random' | 'strict' | 'grouped' — The signing order mode. When it's set to grouped, each signee in `parties.signees`, should have the order field set to the group's number starting from 0.
    - `tags` string[] — Document's tags
    - `title` string — Document title
    - `to_be_signed_by` 'owner_and_others' | 'others_only' | 'owner_only' — Who should sign the document
    - `version` string, uuid — The version has to be provided on update and match the latest document's version. You can get it from the response when you get a document by ID. It is also available in the response from document create or update actions.

## Response `201`

Document

- DocumentShowResponse — A single document
  - `document` object
    - `attachments` object[] — Document attachments
      - `original` string, uri — URL of the attachment
      - `preview` string[] — If the original is a document, this field will hold a list of URLs with image previews of each page
    - `comments` object[] — Comments
      - `account` object — Account information
        - `email` string, email — Email
        - `id` string, uuid — Account ID
        - `profile` object — Profile of the commenter
          - `full_name` string — Full name
          - `id` string, uuid — Profile ID
      - `body` string — Comment body or suggestion text (if it is a suggestion)
      - `document_piece` string — A piece of the document text the comment relates to
      - `id` string, uuid — Comment ID
      - `inserted_at` string, date-time — Creation date and time of the comment
      - `resolved` boolean — Whether the comment has been resolved
      - `seen` boolean — Whether the comment has been seen
      - `thread_id` string, uuid — Comment's thread ID
      - `updated_at` string, date-time — Modification date and time of the comment
    - `company_logo_url` string, uri, nullable — The URL of the logo shown in the contract
    - `created_at` string, date-time — Date and time the document was created
    - `data_fields` DataField[] — Data fields in the document
      - `config` object, required — Additional config for this data field. Contains `options` for `select`, or `label` for `checkbox`.
        - `label` string, nullable
        - `options` string[]
      - `description` string, nullable, required — Description
      - `formatting` object, nullable, required — Formatting
        - `fractional` boolean, nullable
        - `grouping` '' | 'dot' | 'comma' | 'space', nullable
      - `id` string, uuid, required — Unique ID
      - `name` string, required — Name
      - `required` boolean, required — Whether this data field must be filled to send the document for signature
      - `source` 'drafter_questionnaire' | 'ai' | 'salesforce', nullable, required — Source of data for this data field
      - `source_mapping` string, nullable, required — Integration data mapping for this data field. Revealed only when connected to the same integration instance.
      - `source_sync_type` 'downstream' | 'upstream' | 'bidirectional', nullable, required — Integration sync mode for this data field. Revealed only when connected to the same integration instance.
      - `type` 'text' | 'number' | 'date' | 'select' | 'checkbox', required — Type
      - `value` string, nullable, required — Value
    - `events` object[] — Document events
      - `action` 'archived' | 'changes_requested' | 'created' | 'downloaded' | 'edited' | 'edited_properties' | 'opened' | 'rejected' | 'resent' | 'sent_for_signature' | 'shared' | 'signature_updated' | 'signed' | 'task_created' | 'task_deleted' | 'task_status_updated' | 'task_updated' | 'unshared' | 'uploaded' — Event action
      - `comment` string — Event comment
      - `email` string, email — Email address of the account triggering the event
      - `metadata` object — Metadata
      - `profile_id` string, uuid — Profile ID of the account triggering the event
      - `seen` boolean — Whether the event has been seen
      - `timestamp` string, date-time — Event date and time
    - `id` string, uuid — Document ID
    - `language` 'ar' | 'az' | 'be' | 'bg' | 'bn' | 'bs' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'el' | 'en-GB' | 'es' | 'et' | 'fi' | 'fil' | 'fo' | 'fr' | 'he' | 'hi' | 'hr' | 'hu' | 'hy' | 'id' | 'is' | 'it' | 'ja' | 'kk' | 'ko' | 'ku' | 'lt' | 'lv' | 'mk' | 'mr' | 'ms' | 'mt' | 'my' | 'nb' | 'nl' | 'pa' | 'pl' | 'pt' | 'ro' | 'ru' | 'sk' | 'sl' | 'so' | 'sq' | 'sr' | 'sr-Latn-ME' | 'sv' | 'sw' | 'ta' | 'th' | 'tr' | 'uk' | 'ur' | 'vi' | 'zh' — Language
    - `ocr_status` 'none' | 'not_started' | 'pending' | 'success' | 'failure', nullable — OCR status of the document
    - `owner` object — Document's owner information
      - `email` string, email — Owner's email address
      - `full_name` string — Owner's full name
      - `id` string, uuid — Owner's profile ID
    - `parties` object[] — Parties and signees
      - `address` string, nullable — Address
      - `id` string, uuid, nullable — Unique ID
      - `name` string, nullable — Name
      - `number` string, nullable — Company's VAT number or CVR
      - `reference` string, nullable — How the party will be referred to in the document
      - `signees` object[] — Party's signees
        - `changes_requested_at` string, date-time, nullable — Date and time when the signee requested changes to the document
        - `email` string, email, nullable — Signee's email address
        - `full_name` string, nullable — Signee's full name
        - `id` string, uuid, nullable — Unique ID
        - `opened_at` string, date-time, nullable — Date and time when the signee opened the document
        - `order` integer — Signee's signing order. When the signing order mode is set to `grouped`, then this number represents the signee's group number.
        - `rejected_at` string, date-time, nullable — Date and time when the signee rejected the document
        - `signature_verification_methods` string[], nullable — List of allowed signature types for the signee
        - `signed_at` string, date-time, nullable — Date and time when the signee signed the document
        - `title` string, nullable — Signee's title
      - `type` 'personal' | 'company' — Type
    - `sample` boolean — Whether this document exists for demonstration purposes or not
    - `shared` boolean — Whether the document is shared or not
    - `signed_at` string, date-time, nullable — Date and time the document was signed
    - `signing_order_mode` 'random' | 'strict' | 'grouped' — The signing order mode. When it's set to grouped, each signee in `parties.signees`, should have the order field set to the group's number starting from 0.
    - `source_template_id` string, uuid, nullable — ID of the template this document was created from
    - `state` 'draft' | 'rejected' | 'changes_requested' | 'pending' | 'signed' | 'irrelevant' — Document state
    - `tags` string[], nullable — Document's tags
    - `template` object, nullable — Template
    - `title` string — Document title
    - `to_be_signed_by` 'owner_and_others' | 'others_only' | 'owner_only', nullable — Who should sign the document
    - `type` 'draft' | 'contract' | 'stored_contract' — Document type
    - `updated_at` string, date-time — Date and time the document was last modified
    - `version` string, uuid, nullable — Version
    - `visibilities` object[] — Document's users visibilities
      - `email` string, email — Email address
      - `full_name` string — Full name
      - `role` 'owner' | 'manager' | 'editor' | 'filler' | 'reviewer' — Role
    - `workspace` object, nullable — Information about the workspace the document is present in
      - `id` string, uuid — Workspace ID
      - `name` string — Workspace name
      - `permissions` string[] — List of permissions of the current user for the workspace

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `409` — Conflict

---

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