---
title: "Update an EDMS document (subject to change)"
method: PUT
path: "/projects/{projectId}/items/documents/{documentId}"
tags: ["Documents", "Preview"]
---

# Update an EDMS document (subject to change)

`PUT /projects/{projectId}/items/documents/{documentId}`

## Request

- Base URL: `https://app.ketryx.com/api/v1`
- URL: `https://app.ketryx.com/api/v1/projects/{projectId}/items/documents/{documentId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/ketryx/apis/ketryx-api/docs/projects/:projectId/items/documents/:documentId/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates the title, the file, or both, which adds a new record. A new file version is an update carrying a different `uploadedFileId`; omitting it keeps the current file. A write that changes nothing adds no record. Moving the document between folders is `POST .../move`, a separate operation because a move is an item write and never adds a record.

## Path parameters

- `projectId` string, required: Ketryx ID of the project, e.g., `KXPRJ12345`
- `documentId` string, required: Ketryx ID of the document item, e.g., `KXITM12345`

## Request body

- object
  - `uploadedFileId` string: Ketryx ID of a file previously uploaded via `POST /projects/{projectId}/uploads`, to become the new file version. Omit to keep the current file.
  - `title` string: New title of the document
  - `fields` union[]: Custom field values to set, in the `fields` format of `POST /projects/{projectId}/items`. A field is addressed by its label; read-only, non-editable and computed fields are refused, as are built-in fields such as the title, which `title` sets. A computed field that fails to evaluate refuses the write. Fields left out keep their current value.
    - union
      - object
        - `label` string, required
        - `type` 'string' | 'select' | 'date', required
        - `value` string, required
      - object
        - `label` string, required
        - `type` 'jdf', required
        - `value` unknown, required
      - object
        - `label` string, required
        - `type` 'multiselect', required
        - `value` string[], required

## Response `200`

Successful response

- object
  - `document` object, required
    - `id` string, required: Ketryx ID of the document item, e.g., `KXITM12345`
    - `title` string, required: Title of the document, per its current record
    - `type` string, required: Document type by its user-facing label in this organization
    - `folderPath` string, required: Path of the containing EDMS folder, with `/` separating folder names. Empty for the project root.
    - `createdAt` string, date-time, required: Document creation date and time
    - `isDeleted` boolean, required: Whether the document has been deleted
    - `file` object, nullable, required: File backing the current record, if it has one
      - `id` string, required: Ketryx ID of the uploaded file, e.g., `KXUPF12345`
      - `filename` string, required: Filename the file was uploaded under
      - `contentType` string, required: MIME type of the file
      - `sizeBytes` integer, required: Size of the file in bytes
    - `contentUrl` string, nullable, required: URL to download the file backing this document, or `null` if it has no file
    - `currentRecord` object, required: Current record of this document
      - `id` string, required
    - `controlledRecord` object, nullable, required: Latest controlled record of this document
      - `id` string, required
    - `fields` object[], required: Fields and values of the current record, as `GET /projects/{projectId}/items/{itemId}/records` reports them, without the record content
      - `label` string, required: Human-readable label of the field
      - `type` 'string' | 'jdf' | 'select' | 'multiselect' | 'date' | 'number', required: Type of field value
      - `value` unknown, required
      - `isCustom` boolean, required: True for custom fields — either organization-defined (customFieldsConfiguration) or project-level legacy (extraFieldNames). False for built-in system fields.

## Other responses

- `400`: Invalid input data
- `401`: Authorization not provided
- `403`: Insufficient access
- `404`: Not found
- `500`: Internal server error

---

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