Documents

Duplicate a document

POST/documents/{id}/copies

Copies a document's file and returns it with a Location. folder_id picks another folder and name a new name (default: the source's; a used name becomes a(1).pdf). Unlike the platform's copy, it takes the destination folder's permissions, keeps description, metadata and download settings, and is owned by you. Needs write on the folder, else 403. 409 invalid_state if not available; conflict for masked, video, locked folder. dry_run copies no file. Emits document.created after commit; no email. DELETE /documents/{id} 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.

Headers

  • Idempotency-Keystring#

    Makes a retry safe. Send a new UUID for each new request and reuse it only to retry that request; the first response is replayed for 24 hours.

Request body

application/json, optional · DocumentDuplicate

  • folder_idstring (uuid)#

    The folder to put the copy in. It must be a folder you can see and write. Defaults to the source's folder, which is required when the source is in no folder.

  • namestring#

    The copy's name. A name already used in the folder is numbered. Defaults to the source's name.

{
  "folder_id": "071829a3-4b5c-4d6e-8f90-1a2b3c4d5e6f",
  "name": "term-sheet-copy.pdf"
}

Responses

201

The copy was made.

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 POST https://your-org-domain/kong/core/api/v2/documents/{id}/copies\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "folder_id": "071829a3-4b5c-4d6e-8f90-1a2b3c4d5e6f",
  "name": "term-sheet-copy.pdf"
}'