Files

Rename or move a file

Renames the file (name) and/or moves it (folderId or folderPath, mutually exclusive; null folderId or path / targets the root). When both a rename and a move are requested they apply in sequence — rename, then move — and a move failure leaves the rename applied. A folderPath creates any missing folders along the path (mkdir -p), matching upload prepare.

patch/api/v1/files/{fileId}

Request

  • Base URL
    https://app.khotan.com
  • URL
    https://app.khotan.com/api/v1/files/{fileId}
  • Auth
    • HTTP bearer
    • or API key in header x-api-key

Path parameters

fileIdstring required

Request body

namestring
folderIdstring nullable

Destination folder id; null moves the file to the root.

folderPathstring

Destination folder path; "/" moves the file to the root. Missing folders along the path are created ("mkdir -p" semantics), matching upload prepare.

Response

The updated file record.

idstring required
namestring required
contentUrlstring required

Stable authenticated API URL for opening the file content. It redirects to a short-lived inline storage URL when the file is ready.

folderIdstring nullable required

The containing folder's id, or null for the root.

pathstring required

The file's full display path, including the file name. Paths change on rename/move; store ids.

kind'archive' | 'audio' | 'document' | 'image' | 'other' | 'pdf' | 'spreadsheet' | 'video' required
extensionstring nullable required
contentTypestring required
sizeBytesinteger required
status'pending' | 'ready' required
createdAtstring required
updatedAtstring required

Changes

No recorded changes to this operation across all 1 revision of this API.