Documents

Update a document

PATCH/documents/{id}

Changes the fields you send and returns the document. allow_download and apply_watermark (null inherits the organisation default) need the manage-user-documents permission, else 403 missing_permission; apply_watermark is 422 while organisation watermarking is off. A used name is numbered. 409 folder_locked, folder_deleted or conflict (deal image move). Other fields are read-only. Needs write access, else 403. dry_run previews it. Emits document.updated after commit; no email. Sending the old values undoes it.

Path parameters

  • idstring (uuid)Required#

    The record's id.

Query parameters

  • dry_runboolean#

    Validate and run the call without committing it, returning what the real call would return with meta.dry_run set.

Request body

application/json, required · DocumentUpdate

  • namestring#

    The new name. A name already used in the folder is numbered.

  • folder_idstring (uuid)#

    The folder to move it into. It must be a folder you can see. Permissions inherited from the old folder are stripped and the new folder's inherited.

  • descriptionstring | null#

    A note kept with the document. Send null to clear it.

  • metadataobject | null#

    Keys to merge into the document's metadata. A null value removes that key.

  • accessobject#

    Groups of users who may read and write the document without being listed in its permissions.

  • allow_downloadboolean | null#

    Whether people may download the document. Null follows the organisation's document settings. Needs the manage-user-documents permission.

  • apply_watermarkboolean | null#

    Whether downloads are watermarked. Null follows the organisation's document settings. Needs the manage-user-documents permission and organisation watermarking on.

{
  "name": "term-sheet-final.pdf",
  "description": "Signed copy"
}

Responses

200

The updated document.

Document
{
  "data": {
    "id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
    "name": "string",
    "folder_id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
    "deal_id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
    "type": "binary",
    "status": "not_validated",
    "mime_type": "string",
    "size": 1,
    "description": "string",
    "metadata": {},
    "owner_id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
    "allow_download": true,
    "apply_watermark": true,
    "masked": true,
    "access": {
      "internal_users": true,
      "deal_managers": true,
      "file_uploaders": true,
      "entrepreneurs": true
    },
    "permissions": {},
    "created_at": "2026-06-12T10:00:00+00:00",
    "updated_at": "2026-06-12T10:00:00+00:00"
  }
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
404

Resource not found (error.code = not_found).

Error
409

The request conflicts with existing state (error.code = conflict), e.g. a compliance flow with the requested name already exists.

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X PATCH https://your-org-domain/kong/core/api/v2/documents/{id}\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "name": "term-sheet-final.pdf",
  "description": "Signed copy"
}'