Documents

Bulk-upload documents

POST/folders/{folderId}/documents/bulk
documents:writebulk_upload_documentsDeprecatedSunset 2027-06-30

Uploads up to 50 files (multipart/form-data, array field files[]) and reports each one; not atomic. 201 when one succeeds, 422 when all fail. An unreadable or hidden folder returns 404, an unwritable one 403 forbidden, a locked one 409 conflict. dry_run returns 422. Emits document.created per stored file after commit; no email. Can't be undone here. Deprecated: use upload tokens, then POST /documents/bulk/create. Withdrawn on 2027-06-30. Responses carry Deprecation, Sunset and a successor Link.

Path parameters

  • folderIdstring (uuid)Required#

    The folder's public uuid.

Request body

multipart/form-data, required

  • filesstring (binary)[]Required#

Responses

201

At least one file uploaded.

BulkUploadResult
{
  "succeeded": [
    {
      "id": "5e6f7081-92a3-4b4c-9d6e-7f8091a2b3c4",
      "name": "term-sheet.pdf",
      "folder_id": "071829a3-4b5c-4d6e-8f90-1a2b3c4d5e6f",
      "size": 482113,
      "mime_type": "application/pdf",
      "created_at": "2026-06-15T10:30:00+00:00"
    },
    {
      "id": "6f708192-a3b4-4c5d-8e6f-7081a2b3c4d5",
      "name": "cap-table.xlsx",
      "folder_id": "071829a3-4b5c-4d6e-8f90-1a2b3c4d5e6f",
      "size": 65920,
      "mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
      "created_at": "2026-06-15T10:30:05+00:00"
    }
  ],
  "failed": [
    {
      "name": "corrupt-scan.tiff",
      "reason": "upload_failed"
    }
  ]
}
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

Validation failure, or every file failed to upload.

429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X POST https://your-org-domain/kong/core/api/v2/folders/{folderId}/documents/bulk\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"